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

void RAN__Information__Request__Application__Container::copy_value(const RAN__Information__Request__Application__Container& other_value)
{
switch (other_value.union_selection) {
case ALT_nacc:
field_nacc = new RAN__Information__Request__Application__Container__NACC(*other_value.field_nacc);
break;
case ALT_si3:
field_si3 = new RAN__Information__Request__Application__Container__SI3(*other_value.field_si3);
break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel = new RAN__Information__Request__Application__Container__MBMS__data__channel(*other_value.field_mBMS__data__channel);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean RAN__Information__Request__Application__Container::operator==(const RAN__Information__Request__Application__Container& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_nacc:
return *field_nacc == *other_value.field_nacc;
case ALT_si3:
return *field_si3 == *other_value.field_si3;
case ALT_mBMS__data__channel:
return *field_mBMS__data__channel == *other_value.field_mBMS__data__channel;
default:
return FALSE;
}
}

RAN__Information__Request__Application__Container__NACC& RAN__Information__Request__Application__Container::nacc()
{
if (union_selection != ALT_nacc) {
clean_up();
field_nacc = new RAN__Information__Request__Application__Container__NACC;
union_selection = ALT_nacc;
}
return *field_nacc;
}

const RAN__Information__Request__Application__Container__NACC& RAN__Information__Request__Application__Container::nacc() const
{
if (union_selection != ALT_nacc) TTCN_error("Using non-selected field nacc in a value of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
return *field_nacc;
}

RAN__Information__Request__Application__Container__SI3& RAN__Information__Request__Application__Container::si3()
{
if (union_selection != ALT_si3) {
clean_up();
field_si3 = new RAN__Information__Request__Application__Container__SI3;
union_selection = ALT_si3;
}
return *field_si3;
}

const RAN__Information__Request__Application__Container__SI3& RAN__Information__Request__Application__Container::si3() const
{
if (union_selection != ALT_si3) TTCN_error("Using non-selected field si3 in a value of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
return *field_si3;
}

RAN__Information__Request__Application__Container__MBMS__data__channel& RAN__Information__Request__Application__Container::mBMS__data__channel()
{
if (union_selection != ALT_mBMS__data__channel) {
clean_up();
field_mBMS__data__channel = new RAN__Information__Request__Application__Container__MBMS__data__channel;
union_selection = ALT_mBMS__data__channel;
}
return *field_mBMS__data__channel;
}

const RAN__Information__Request__Application__Container__MBMS__data__channel& RAN__Information__Request__Application__Container::mBMS__data__channel() const
{
if (union_selection != ALT_mBMS__data__channel) TTCN_error("Using non-selected field mBMS_data_channel in a value of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
return *field_mBMS__data__channel;
}

boolean RAN__Information__Request__Application__Container::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.RAN_Information_Request_Application_Container.");
return union_selection == checked_selection;
}

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

boolean RAN__Information__Request__Application__Container::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_nacc: return field_nacc->is_value();
case ALT_si3: return field_si3->is_value();
case ALT_mBMS__data__channel: return field_mBMS__data__channel->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void RAN__Information__Request__Application__Container::clean_up()
{
switch (union_selection) {
case ALT_nacc:
  delete field_nacc;
  break;
case ALT_si3:
  delete field_si3;
  break;
case ALT_mBMS__data__channel:
  delete field_mBMS__data__channel;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void RAN__Information__Request__Application__Container::log() const
{
switch (union_selection) {
case ALT_nacc:
TTCN_Logger::log_event_str("{ nacc := ");
field_nacc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mBMS__data__channel:
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
field_mBMS__data__channel->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void RAN__Information__Request__Application__Container::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, "nacc")) {
    nacc().set_param(*mp_last);
    if (!nacc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si3")) {
    si3().set_param(*mp_last);
    if (!si3().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mBMS_data_channel")) {
    mBMS__data__channel().set_param(*mp_last);
    if (!mBMS__data__channel().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.RAN_Information_Request_Application_Container.", last_name);
}

void RAN__Information__Request__Application__Container::set_implicit_omit()
{
switch (union_selection) {
case ALT_nacc:
field_nacc->set_implicit_omit(); break;
case ALT_si3:
field_si3->set_implicit_omit(); break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel->set_implicit_omit(); break;
default: break;
}
}

void RAN__Information__Request__Application__Container::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_nacc:
field_nacc->encode_text(text_buf);
break;
case ALT_si3:
field_si3->encode_text(text_buf);
break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
}

void RAN__Information__Request__Application__Container::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_nacc:
nacc().decode_text(text_buf);
break;
case ALT_si3:
si3().decode_text(text_buf);
break;
case ALT_mBMS__data__channel:
mBMS__data__channel().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
}

void RAN__Information__Request__Application__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(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 RAN__Information__Request__Application__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 RAN__Information__Request__Application__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 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, RAN__Information__Request__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = nacc().RAW_decode(RAN__Information__Request__Application__Container__NACC_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, RAN__Information__Request__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(RAN__Information__Request__Application__Container__SI3_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, RAN__Information__Request__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = mBMS__data__channel().RAW_decode(RAN__Information__Request__Application__Container__MBMS__data__channel_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, RAN__Information__Request__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = nacc().RAW_decode(RAN__Information__Request__Application__Container__NACC_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, RAN__Information__Request__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(RAN__Information__Request__Application__Container__SI3_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, RAN__Information__Request__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = mBMS__data__channel().RAW_decode(RAN__Information__Request__Application__Container__MBMS__data__channel_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int RAN__Information__Request__Application__Container::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_nacc:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Request__Application__Container__NACC_descr_.raw);
    encoded_length = field_nacc->RAW_encode(RAN__Information__Request__Application__Container__NACC_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Request__Application__Container__NACC_descr_;
    break;
  case ALT_si3:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RAN__Information__Request__Application__Container__SI3_descr_.raw);
    encoded_length = field_si3->RAW_encode(RAN__Information__Request__Application__Container__SI3_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RAN__Information__Request__Application__Container__SI3_descr_;
    break;
  case ALT_mBMS__data__channel:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, RAN__Information__Request__Application__Container__MBMS__data__channel_descr_.raw);
    encoded_length = field_mBMS__data__channel->RAW_encode(RAN__Information__Request__Application__Container__MBMS__data__channel_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &RAN__Information__Request__Application__Container__MBMS__data__channel_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void RAN__Information__Request__Application__Container_template::copy_value(const RAN__Information__Request__Application__Container& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
single_value.field_nacc = new RAN__Information__Request__Application__Container__NACC_template(other_value.nacc());
break;
case RAN__Information__Request__Application__Container::ALT_si3:
single_value.field_si3 = new RAN__Information__Request__Application__Container__SI3_template(other_value.si3());
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new RAN__Information__Request__Application__Container__MBMS__data__channel_template(other_value.mBMS__data__channel());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Request__Application__Container_template::copy_template(const RAN__Information__Request__Application__Container_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 RAN__Information__Request__Application__Container::ALT_nacc:
single_value.field_nacc = new RAN__Information__Request__Application__Container__NACC_template(*other_value.single_value.field_nacc);
break;
case RAN__Information__Request__Application__Container::ALT_si3:
single_value.field_si3 = new RAN__Information__Request__Application__Container__SI3_template(*other_value.single_value.field_si3);
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new RAN__Information__Request__Application__Container__MBMS__data__channel_template(*other_value.single_value.field_mBMS__data__channel);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
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 RAN__Information__Request__Application__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 RAN__Information__Request__Application__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Request__Application__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 template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
set_selection(other_value);
}

RAN__Information__Request__Application__Container_template::RAN__Information__Request__Application__Container_template()
{
}

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

RAN__Information__Request__Application__Container_template::RAN__Information__Request__Application__Container_template(const RAN__Information__Request__Application__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void RAN__Information__Request__Application__Container_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
delete single_value.field_nacc;
break;
case RAN__Information__Request__Application__Container::ALT_si3:
delete single_value.field_si3;
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
delete single_value.field_mBMS__data__channel;
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;
}

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

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

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

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

boolean RAN__Information__Request__Application__Container_template::match(const RAN__Information__Request__Application__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:
{
RAN__Information__Request__Application__Container::union_selection_type value_selection = other_value.get_selection();
if (value_selection == RAN__Information__Request__Application__Container::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
return single_value.field_nacc->match(other_value.nacc(), legacy);
case RAN__Information__Request__Application__Container::ALT_si3:
return single_value.field_si3->match(other_value.si3(), legacy);
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
return single_value.field_mBMS__data__channel->match(other_value.mBMS__data__channel(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
}
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.RAN_Information_Request_Application_Container.");
}
return FALSE;
}

boolean RAN__Information__Request__Application__Container_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
return single_value.field_nacc->is_value();
case RAN__Information__Request__Application__Container::ALT_si3:
return single_value.field_si3->is_value();
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
return single_value.field_mBMS__data__channel->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.RAN_Information_Request_Application_Container.");
}
}

RAN__Information__Request__Application__Container RAN__Information__Request__Application__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 union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
RAN__Information__Request__Application__Container ret_val;
switch (single_value.union_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
ret_val.nacc() = single_value.field_nacc->valueof();
break;
case RAN__Information__Request__Application__Container::ALT_si3:
ret_val.si3() = single_value.field_si3->valueof();
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
ret_val.mBMS__data__channel() = single_value.field_mBMS__data__channel->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.RAN_Information_Request_Application_Container.");
}
return ret_val;
}

RAN__Information__Request__Application__Container_template& RAN__Information__Request__Application__Container_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.RAN_Information_Request_Application_Container.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
return value_list.list_value[list_index];
}
void RAN__Information__Request__Application__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 ("Internal error: Setting an invalid list for a template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RAN__Information__Request__Application__Container_template[list_length];
}

RAN__Information__Request__Application__Container__NACC_template& RAN__Information__Request__Application__Container_template::nacc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RAN__Information__Request__Application__Container::ALT_nacc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nacc = new RAN__Information__Request__Application__Container__NACC_template(ANY_VALUE);
else single_value.field_nacc = new RAN__Information__Request__Application__Container__NACC_template;
single_value.union_selection = RAN__Information__Request__Application__Container::ALT_nacc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nacc;
}

const RAN__Information__Request__Application__Container__NACC_template& RAN__Information__Request__Application__Container_template::nacc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nacc in a non-specific template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
if (single_value.union_selection != RAN__Information__Request__Application__Container::ALT_nacc) TTCN_error("Accessing non-selected field nacc in a template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
return *single_value.field_nacc;
}

RAN__Information__Request__Application__Container__SI3_template& RAN__Information__Request__Application__Container_template::si3()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RAN__Information__Request__Application__Container::ALT_si3) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si3 = new RAN__Information__Request__Application__Container__SI3_template(ANY_VALUE);
else single_value.field_si3 = new RAN__Information__Request__Application__Container__SI3_template;
single_value.union_selection = RAN__Information__Request__Application__Container::ALT_si3;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si3;
}

const RAN__Information__Request__Application__Container__SI3_template& RAN__Information__Request__Application__Container_template::si3() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si3 in a non-specific template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
if (single_value.union_selection != RAN__Information__Request__Application__Container::ALT_si3) TTCN_error("Accessing non-selected field si3 in a template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
return *single_value.field_si3;
}

RAN__Information__Request__Application__Container__MBMS__data__channel_template& RAN__Information__Request__Application__Container_template::mBMS__data__channel()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RAN__Information__Request__Application__Container::ALT_mBMS__data__channel) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mBMS__data__channel = new RAN__Information__Request__Application__Container__MBMS__data__channel_template(ANY_VALUE);
else single_value.field_mBMS__data__channel = new RAN__Information__Request__Application__Container__MBMS__data__channel_template;
single_value.union_selection = RAN__Information__Request__Application__Container::ALT_mBMS__data__channel;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mBMS__data__channel;
}

const RAN__Information__Request__Application__Container__MBMS__data__channel_template& RAN__Information__Request__Application__Container_template::mBMS__data__channel() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mBMS_data_channel in a non-specific template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
if (single_value.union_selection != RAN__Information__Request__Application__Container::ALT_mBMS__data__channel) TTCN_error("Accessing non-selected field mBMS_data_channel in a template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
return *single_value.field_mBMS__data__channel;
}

boolean RAN__Information__Request__Application__Container_template::ischosen(RAN__Information__Request__Application__Container::union_selection_type checked_selection) const
{
if (checked_selection == RAN__Information__Request__Application__Container::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == RAN__Information__Request__Application__Container::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.RAN_Information_Request_Application_Container.");
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.RAN_Information_Request_Application_Container 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 RAN__Information__Request__Application__Container_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
TTCN_Logger::log_event_str("{ nacc := ");
single_value.field_nacc->log();
TTCN_Logger::log_event_str(" }");
break;
case RAN__Information__Request__Application__Container::ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
single_value.field_mBMS__data__channel->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 RAN__Information__Request__Application__Container_template::log_match(const RAN__Information__Request__Application__Container& 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 RAN__Information__Request__Application__Container::ALT_nacc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nacc");
single_value.field_nacc->log_match(match_value.nacc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nacc := ");
single_value.field_nacc->log_match(match_value.nacc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RAN__Information__Request__Application__Container::ALT_si3:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si3");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mBMS_data_channel");
single_value.field_mBMS__data__channel->log_match(match_value.mBMS__data__channel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
single_value.field_mBMS__data__channel->log_match(match_value.mBMS__data__channel(), 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 RAN__Information__Request__Application__Container_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 RAN__Information__Request__Application__Container::ALT_nacc:
single_value.field_nacc->encode_text(text_buf);
break;
case RAN__Information__Request__Application__Container::ALT_si3:
single_value.field_si3->encode_text(text_buf);
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel->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.RAN_Information_Request_Application_Container.");
}
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.RAN_Information_Request_Application_Container.");
}
}

void RAN__Information__Request__Application__Container_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = RAN__Information__Request__Application__Container::UNBOUND_VALUE;
RAN__Information__Request__Application__Container::union_selection_type new_selection = (RAN__Information__Request__Application__Container::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
single_value.field_nacc = new RAN__Information__Request__Application__Container__NACC_template;
single_value.field_nacc->decode_text(text_buf);
break;
case RAN__Information__Request__Application__Container::ALT_si3:
single_value.field_si3 = new RAN__Information__Request__Application__Container__SI3_template;
single_value.field_si3->decode_text(text_buf);
break;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new RAN__Information__Request__Application__Container__MBMS__data__channel_template;
single_value.field_mBMS__data__channel->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
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 RAN__Information__Request__Application__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: Unrecognized selector was received in a template of type @BSSGP_Types.RAN_Information_Request_Application_Container.");
}
}

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

boolean RAN__Information__Request__Application__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 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 RAN__Information__Request__Application__Container_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.RAN_Information_Request_Application_Container'");
    }
    if (strcmp("nacc", param_field) == 0) {
      nacc().set_param(param);
      return;
    } else if (strcmp("si3", param_field) == 0) {
      si3().set_param(param);
      return;
    } else if (strcmp("mBMS_data_channel", param_field) == 0) {
      mBMS__data__channel().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.RAN_Information_Request_Application_Container'", 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: {
    RAN__Information__Request__Application__Container_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.RAN_Information_Request_Application_Container");
    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, "nacc")) {
      nacc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si3")) {
      si3().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mBMS_data_channel")) {
      mBMS__data__channel().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.RAN_Information_Request_Application_Container.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Request__Application__Container_template* precondition = new RAN__Information__Request__Application__Container_template;
    precondition->set_param(*m_p->get_elem(0));
    RAN__Information__Request__Application__Container_template* implied_template = new RAN__Information__Request__Application__Container_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RAN__Information__Request__Application__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.RAN_Information_Request_Application_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Request__Application__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;
switch (single_value.union_selection) {
case RAN__Information__Request__Application__Container::ALT_nacc:
single_value.field_nacc->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Request_Application_Container");
return;
case RAN__Information__Request__Application__Container::ALT_si3:
single_value.field_si3->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Request_Application_Container");
return;
case RAN__Information__Request__Application__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Request_Application_Container");
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.RAN_Information_Request_Application_Container.");
}
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.RAN_Information_Request_Application_Container");
}

RAN__Information__Request__Application__Container__NACC::RAN__Information__Request__Application__Container__NACC()
{
}

RAN__Information__Request__Application__Container__NACC::RAN__Information__Request__Application__Container__NACC(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier)
{
}

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

void RAN__Information__Request__Application__Container__NACC::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
}

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

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

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

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

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

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

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

void RAN__Information__Request__Application__Container__NACC::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 RAN__Information__Request__Application__Container__NACC::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 RAN__Information__Request__Application__Container__NACC::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, RAN__Information__Request__Application__Container__NACC_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Request__Application__Container__NACC_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, RAN__Information__Request__Application__Container__NACC_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Request__Application__Container__NACC_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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_137) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Request__Application__Container__NACC::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, RAN__Information__Request__Application__Container__NACC_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Request__Application__Container__NACC_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Request__Application__Container__NACC_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Request__Application__Container__NACC_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_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(RAN__Information__Request__Application__Container__NACC_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(RAN__Information__Request__Application__Container__NACC_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_137) {
  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_137.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 RAN__Information__Request__Application__Container__NACC_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
};

void RAN__Information__Request__Application__Container__NACC_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_reporting__Cell__Identifier = ANY_VALUE;
}
}
}

void RAN__Information__Request__Application__Container__NACC_template::copy_value(const RAN__Information__Request__Application__Container__NACC& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Request__Application__Container__NACC_template::copy_template(const RAN__Information__Request__Application__Container__NACC_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__NACC_template[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 RAN__Information__Request__Application__Container__NACC_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Request__Application__Container__NACC_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.RAN_Information_Request_Application_Container_NACC.");
break;
}
set_selection(other_value);
}

RAN__Information__Request__Application__Container__NACC_template::RAN__Information__Request__Application__Container__NACC_template()
{
}

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

RAN__Information__Request__Application__Container__NACC_template::RAN__Information__Request__Application__Container__NACC_template(const RAN__Information__Request__Application__Container__NACC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Request__Application__Container__NACC_template::match(const RAN__Information__Request__Application__Container__NACC& 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), 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.RAN_Information_Request_Application_Container_NACC.");
}
return FALSE;
}

boolean RAN__Information__Request__Application__Container__NACC_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_reporting__Cell__Identifier.is_bound();
}

boolean RAN__Information__Request__Application__Container__NACC_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_reporting__Cell__Identifier.is_value();
}

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

RAN__Information__Request__Application__Container__NACC RAN__Information__Request__Application__Container__NACC_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.RAN_Information_Request_Application_Container_NACC.");
RAN__Information__Request__Application__Container__NACC 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Request__Application__Container__NACC_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Request__Application__Container__NACC_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Request_Application_Container_NACC.");
return single_value->field_reporting__Cell__Identifier;
}

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

void RAN__Information__Request__Application__Container__NACC_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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__NACC_template::log_match(const RAN__Information__Request__Application__Container__NACC& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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 RAN__Information__Request__Application__Container__NACC_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_reporting__Cell__Identifier.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.RAN_Information_Request_Application_Container_NACC.");
}
}

void RAN__Information__Request__Application__Container__NACC_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_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__NACC_template[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.RAN_Information_Request_Application_Container_NACC.");
}
}

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

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

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

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

RAN__Information__Request__Application__Container__SI3::RAN__Information__Request__Application__Container__SI3()
{
}

RAN__Information__Request__Application__Container__SI3::RAN__Information__Request__Application__Container__SI3(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier)
{
}

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

void RAN__Information__Request__Application__Container__SI3::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
}

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

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

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

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

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

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

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

void RAN__Information__Request__Application__Container__SI3::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 RAN__Information__Request__Application__Container__SI3::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 RAN__Information__Request__Application__Container__SI3::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, RAN__Information__Request__Application__Container__SI3_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Request__Application__Container__SI3_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, RAN__Information__Request__Application__Container__SI3_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Request__Application__Container__SI3_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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_137) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Request__Application__Container__SI3::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, RAN__Information__Request__Application__Container__SI3_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Request__Application__Container__SI3_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Request__Application__Container__SI3_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Request__Application__Container__SI3_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_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(RAN__Information__Request__Application__Container__SI3_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(RAN__Information__Request__Application__Container__SI3_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_137) {
  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_137.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 RAN__Information__Request__Application__Container__SI3_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
};

void RAN__Information__Request__Application__Container__SI3_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_reporting__Cell__Identifier = ANY_VALUE;
}
}
}

void RAN__Information__Request__Application__Container__SI3_template::copy_value(const RAN__Information__Request__Application__Container__SI3& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Request__Application__Container__SI3_template::copy_template(const RAN__Information__Request__Application__Container__SI3_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__SI3_template[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 RAN__Information__Request__Application__Container__SI3_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Request__Application__Container__SI3_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.RAN_Information_Request_Application_Container_SI3.");
break;
}
set_selection(other_value);
}

RAN__Information__Request__Application__Container__SI3_template::RAN__Information__Request__Application__Container__SI3_template()
{
}

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

RAN__Information__Request__Application__Container__SI3_template::RAN__Information__Request__Application__Container__SI3_template(const RAN__Information__Request__Application__Container__SI3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Request__Application__Container__SI3_template::match(const RAN__Information__Request__Application__Container__SI3& 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), 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.RAN_Information_Request_Application_Container_SI3.");
}
return FALSE;
}

boolean RAN__Information__Request__Application__Container__SI3_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_reporting__Cell__Identifier.is_bound();
}

boolean RAN__Information__Request__Application__Container__SI3_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_reporting__Cell__Identifier.is_value();
}

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

RAN__Information__Request__Application__Container__SI3 RAN__Information__Request__Application__Container__SI3_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.RAN_Information_Request_Application_Container_SI3.");
RAN__Information__Request__Application__Container__SI3 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Request__Application__Container__SI3_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Request__Application__Container__SI3_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Request_Application_Container_SI3.");
return single_value->field_reporting__Cell__Identifier;
}

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

void RAN__Information__Request__Application__Container__SI3_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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__SI3_template::log_match(const RAN__Information__Request__Application__Container__SI3& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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 RAN__Information__Request__Application__Container__SI3_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_reporting__Cell__Identifier.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.RAN_Information_Request_Application_Container_SI3.");
}
}

void RAN__Information__Request__Application__Container__SI3_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_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__SI3_template[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.RAN_Information_Request_Application_Container_SI3.");
}
}

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

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

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

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

RAN__Information__Request__Application__Container__MBMS__data__channel::RAN__Information__Request__Application__Container__MBMS__data__channel()
{
}

RAN__Information__Request__Application__Container__MBMS__data__channel::RAN__Information__Request__Application__Container__MBMS__data__channel(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier)
{
}

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

void RAN__Information__Request__Application__Container__MBMS__data__channel::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
}

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

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

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

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

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

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

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

void RAN__Information__Request__Application__Container__MBMS__data__channel::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 RAN__Information__Request__Application__Container__MBMS__data__channel::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 RAN__Information__Request__Application__Container__MBMS__data__channel::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, RAN__Information__Request__Application__Container__MBMS__data__channel_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Request__Application__Container__MBMS__data__channel_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, RAN__Information__Request__Application__Container__MBMS__data__channel_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Request__Application__Container__MBMS__data__channel_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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_137) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Request__Application__Container__MBMS__data__channel::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, RAN__Information__Request__Application__Container__MBMS__data__channel_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Request__Application__Container__MBMS__data__channel_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Request__Application__Container__MBMS__data__channel_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Request__Application__Container__MBMS__data__channel_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_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(RAN__Information__Request__Application__Container__MBMS__data__channel_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(RAN__Information__Request__Application__Container__MBMS__data__channel_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_137) {
  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_137.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 RAN__Information__Request__Application__Container__MBMS__data__channel_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
};

void RAN__Information__Request__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier = ANY_VALUE;
}
}
}

void RAN__Information__Request__Application__Container__MBMS__data__channel_template::copy_value(const RAN__Information__Request__Application__Container__MBMS__data__channel& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Request__Application__Container__MBMS__data__channel_template::copy_template(const RAN__Information__Request__Application__Container__MBMS__data__channel_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__MBMS__data__channel_template[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 RAN__Information__Request__Application__Container__MBMS__data__channel_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Request__Application__Container__MBMS__data__channel_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.RAN_Information_Request_Application_Container_MBMS_data_channel.");
break;
}
set_selection(other_value);
}

RAN__Information__Request__Application__Container__MBMS__data__channel_template::RAN__Information__Request__Application__Container__MBMS__data__channel_template()
{
}

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

RAN__Information__Request__Application__Container__MBMS__data__channel_template::RAN__Information__Request__Application__Container__MBMS__data__channel_template(const RAN__Information__Request__Application__Container__MBMS__data__channel& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Request__Application__Container__MBMS__data__channel_template::match(const RAN__Information__Request__Application__Container__MBMS__data__channel& 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), 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.RAN_Information_Request_Application_Container_MBMS_data_channel.");
}
return FALSE;
}

boolean RAN__Information__Request__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.is_bound();
}

boolean RAN__Information__Request__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.is_value();
}

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

RAN__Information__Request__Application__Container__MBMS__data__channel RAN__Information__Request__Application__Container__MBMS__data__channel_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.RAN_Information_Request_Application_Container_MBMS_data_channel.");
RAN__Information__Request__Application__Container__MBMS__data__channel 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Request__Application__Container__MBMS__data__channel_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Request__Application__Container__MBMS__data__channel_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Request_Application_Container_MBMS_data_channel.");
return single_value->field_reporting__Cell__Identifier;
}

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

void RAN__Information__Request__Application__Container__MBMS__data__channel_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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__MBMS__data__channel_template::log_match(const RAN__Information__Request__Application__Container__MBMS__data__channel& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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 RAN__Information__Request__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.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.RAN_Information_Request_Application_Container_MBMS_data_channel.");
}
}

void RAN__Information__Request__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__MBMS__data__channel_template[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.RAN_Information_Request_Application_Container_MBMS_data_channel.");
}
}

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

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

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

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

SON__Transfer__Application__Identity__TLV::SON__Transfer__Application__Identity__TLV()
{
}

SON__Transfer__Application__Identity__TLV::SON__Transfer__Application__Identity__TLV(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_sON__Transfer__Application__Identity)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_sON__Transfer__Application__Identity(par_sON__Transfer__Application__Identity)
{
}

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

void SON__Transfer__Application__Identity__TLV::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_sON__Transfer__Application__Identity.clean_up();
}

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

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

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

void SON__Transfer__Application__Identity__TLV::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (sON__Transfer__Application__Identity().is_bound()) sON__Transfer__Application__Identity().set_implicit_omit();
}

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

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

void SON__Transfer__Application__Identity__TLV::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_sON__Transfer__Application__Identity.decode_text(text_buf);
}

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

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

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

int SON__Transfer__Application__Identity__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SON__Transfer__Application__Identity__TLV_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SON__Transfer__Application__Identity__TLV_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(SON__Transfer__Application__Identity__TLV_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(SON__Transfer__Application__Identity__TLV_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_sON__Transfer__Application__Identity.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(SON__Transfer__Application__Identity__TLV_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(SON__Transfer__Application__Identity__TLV_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_138) {
  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_138.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 SON__Transfer__Application__Identity__TLV_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_sON__Transfer__Application__Identity;
};

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

void SON__Transfer__Application__Identity__TLV_template::copy_value(const SON__Transfer__Application__Identity__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.sON__Transfer__Application__Identity().is_bound()) {
  single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
} else {
  single_value->field_sON__Transfer__Application__Identity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

SON__Transfer__Application__Identity__TLV_template::SON__Transfer__Application__Identity__TLV_template()
{
}

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

SON__Transfer__Application__Identity__TLV_template::SON__Transfer__Application__Identity__TLV_template(const SON__Transfer__Application__Identity__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SON__Transfer__Application__Identity__TLV_template::match(const SON__Transfer__Application__Identity__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.sON__Transfer__Application__Identity().is_bound()) return FALSE;
if(!single_value->field_sON__Transfer__Application__Identity.match(other_value.sON__Transfer__Application__Identity(), 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.SON_Transfer_Application_Identity_TLV.");
}
return FALSE;
}

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

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

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

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

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

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

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

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

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

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

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

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

OCTETSTRING_template& SON__Transfer__Application__Identity__TLV_template::sON__Transfer__Application__Identity()
{
set_specific();
return single_value->field_sON__Transfer__Application__Identity;
}

const OCTETSTRING_template& SON__Transfer__Application__Identity__TLV_template::sON__Transfer__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_Transfer_Application_Identity of a non-specific template of type @BSSGP_Types.SON_Transfer_Application_Identity_TLV.");
return single_value->field_sON__Transfer__Application__Identity;
}

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

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

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

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

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

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

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

RAN__Information__RIM__Container::RAN__Information__RIM__Container()
{
}

RAN__Information__RIM__Container::RAN__Information__RIM__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const RIM__Application__Identity& par_rIM__Application__Identity,
    const RIM__Sequence__Number& par_rIM__Sequence__Number,
    const RIM__PDU__Indications& par_rIM__PDU__Indications,
    const OPTIONAL< RIM__Protocol__Version__Number >& par_rIM__Protocol__Version__Number,
    const OPTIONAL< ApplContainer__or__ApplErrContainer >& par_applContainer__or__ApplErrContainer,
    const OPTIONAL< SON__Transfer__Application__Identity__TLV >& par_sON__Transfer__Application__Identity)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_rIM__Application__Identity(par_rIM__Application__Identity),
  field_rIM__Sequence__Number(par_rIM__Sequence__Number),
  field_rIM__PDU__Indications(par_rIM__PDU__Indications),
  field_rIM__Protocol__Version__Number(par_rIM__Protocol__Version__Number),
  field_applContainer__or__ApplErrContainer(par_applContainer__or__ApplErrContainer),
  field_sON__Transfer__Application__Identity(par_sON__Transfer__Application__Identity)
{
}

RAN__Information__RIM__Container::RAN__Information__RIM__Container(const RAN__Information__RIM__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
else field_rIM__Application__Identity.clean_up();
if (other_value.rIM__Sequence__Number().is_bound()) field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
else field_rIM__Sequence__Number.clean_up();
if (other_value.rIM__PDU__Indications().is_bound()) field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
else field_rIM__PDU__Indications.clean_up();
if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
else field_rIM__Protocol__Version__Number.clean_up();
if (other_value.applContainer__or__ApplErrContainer().is_bound()) field_applContainer__or__ApplErrContainer = other_value.applContainer__or__ApplErrContainer();
else field_applContainer__or__ApplErrContainer.clean_up();
if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
else field_sON__Transfer__Application__Identity.clean_up();
}

void RAN__Information__RIM__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_rIM__Application__Identity.clean_up();
field_rIM__Sequence__Number.clean_up();
field_rIM__PDU__Indications.clean_up();
field_rIM__Protocol__Version__Number.clean_up();
field_applContainer__or__ApplErrContainer.clean_up();
field_sON__Transfer__Application__Identity.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__RIM__Container::get_descriptor() const { return &RAN__Information__RIM__Container_descr_; }
RAN__Information__RIM__Container& RAN__Information__RIM__Container::operator=(const RAN__Information__RIM__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
  else field_rIM__Application__Identity.clean_up();
  if (other_value.rIM__Sequence__Number().is_bound()) field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
  else field_rIM__Sequence__Number.clean_up();
  if (other_value.rIM__PDU__Indications().is_bound()) field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
  else field_rIM__PDU__Indications.clean_up();
  if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
  else field_rIM__Protocol__Version__Number.clean_up();
  if (other_value.applContainer__or__ApplErrContainer().is_bound()) field_applContainer__or__ApplErrContainer = other_value.applContainer__or__ApplErrContainer();
  else field_applContainer__or__ApplErrContainer.clean_up();
  if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
  else field_sON__Transfer__Application__Identity.clean_up();
}
return *this;
}

boolean RAN__Information__RIM__Container::operator==(const RAN__Information__RIM__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_rIM__Application__Identity==other_value.field_rIM__Application__Identity
  && field_rIM__Sequence__Number==other_value.field_rIM__Sequence__Number
  && field_rIM__PDU__Indications==other_value.field_rIM__PDU__Indications
  && field_rIM__Protocol__Version__Number==other_value.field_rIM__Protocol__Version__Number
  && field_applContainer__or__ApplErrContainer==other_value.field_applContainer__or__ApplErrContainer
  && field_sON__Transfer__Application__Identity==other_value.field_sON__Transfer__Application__Identity;
}

boolean RAN__Information__RIM__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_rIM__Application__Identity.is_bound())
  || (field_rIM__Sequence__Number.is_bound())
  || (field_rIM__PDU__Indications.is_bound())
  || (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_bound())
  || (OPTIONAL_OMIT == field_applContainer__or__ApplErrContainer.get_selection() || field_applContainer__or__ApplErrContainer.is_bound())
  || (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_bound());
}
boolean RAN__Information__RIM__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_rIM__Application__Identity.is_value()
  && field_rIM__Sequence__Number.is_value()
  && field_rIM__PDU__Indications.is_value()
  && (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_value())
  && (OPTIONAL_OMIT == field_applContainer__or__ApplErrContainer.get_selection() || field_applContainer__or__ApplErrContainer.is_value())
  && (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_value());
}
int RAN__Information__RIM__Container::size_of() const
{
  int ret_val = 6;
  if (field_rIM__Protocol__Version__Number.ispresent()) ret_val++;
  if (field_applContainer__or__ApplErrContainer.ispresent()) ret_val++;
  if (field_sON__Transfer__Application__Identity.ispresent()) ret_val++;
  return ret_val;
}

void RAN__Information__RIM__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(", rIM_Application_Identity := ");
field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
field_rIM__Sequence__Number.log();
TTCN_Logger::log_event_str(", rIM_PDU_Indications := ");
field_rIM__PDU__Indications.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", applContainer_or_ApplErrContainer := ");
field_applContainer__or__ApplErrContainer.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
field_sON__Transfer__Application__Identity.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__RIM__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 (rIM__Application__Identity().is_bound()) rIM__Application__Identity().set_implicit_omit();
if (rIM__Sequence__Number().is_bound()) rIM__Sequence__Number().set_implicit_omit();
if (rIM__PDU__Indications().is_bound()) rIM__PDU__Indications().set_implicit_omit();
if (!rIM__Protocol__Version__Number().is_bound()) rIM__Protocol__Version__Number() = OMIT_VALUE;
else rIM__Protocol__Version__Number().set_implicit_omit();
if (!applContainer__or__ApplErrContainer().is_bound()) applContainer__or__ApplErrContainer() = OMIT_VALUE;
else applContainer__or__ApplErrContainer().set_implicit_omit();
if (!sON__Transfer__Application__Identity().is_bound()) sON__Transfer__Application__Identity() = OMIT_VALUE;
else sON__Transfer__Application__Identity().set_implicit_omit();
}

void RAN__Information__RIM__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 (9<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RAN_Information_RIM_Container has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__Sequence__Number().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__PDU__Indications().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) applContainer__or__ApplErrContainer().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_Sequence_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Sequence__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_PDU_Indications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__PDU__Indications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "applContainer_or_ApplErrContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          applContainer__or__ApplErrContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RAN_Information_RIM_Container");
  }
}

void RAN__Information__RIM__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_rIM__Application__Identity.encode_text(text_buf);
field_rIM__Sequence__Number.encode_text(text_buf);
field_rIM__PDU__Indications.encode_text(text_buf);
field_rIM__Protocol__Version__Number.encode_text(text_buf);
field_applContainer__or__ApplErrContainer.encode_text(text_buf);
field_sON__Transfer__Application__Identity.encode_text(text_buf);
}

void RAN__Information__RIM__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_rIM__Application__Identity.decode_text(text_buf);
field_rIM__Sequence__Number.decode_text(text_buf);
field_rIM__PDU__Indications.decode_text(text_buf);
field_rIM__Protocol__Version__Number.decode_text(text_buf);
field_applContainer__or__ApplErrContainer.decode_text(text_buf);
field_sON__Transfer__Application__Identity.decode_text(text_buf);
}

void RAN__Information__RIM__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 RAN__Information__RIM__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 RAN__Information__RIM__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, RAN__Information__RIM__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__RIM__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, RAN__Information__RIM__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__RIM__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, RIM__Application__Identity_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Application__Identity.RAW_decode(RIM__Application__Identity_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, RIM__Sequence__Number_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Sequence__Number.RAW_decode(RIM__Sequence__Number_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, RIM__PDU__Indications_descr_.raw->forceomit);
  decoded_field_length = field_rIM__PDU__Indications.RAW_decode(RIM__PDU__Indications_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 (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_rIM__Protocol__Version__Number = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, RIM__Protocol__Version__Number_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Protocol__Version__Number().RAW_decode(RIM__Protocol__Version__Number_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_rIM__Protocol__Version__Number = 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_rIM__Protocol__Version__Number=OMIT_VALUE;
  if (field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_26) selected_field = 0;
  else if (field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_27) selected_field = 1;
  else if (field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_59) selected_field = 2;
  else selected_field = -1;
  if (limit > 0 && value_of_length_field2 > 0 && (field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_26 || field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_27 || field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_59)&& selected_field!=-1){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_applContainer__or__ApplErrContainer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, RAN__Information__RIM__Container_applContainer__or__ApplErrContainer_descr_.raw->forceomit);
  decoded_field_length = field_applContainer__or__ApplErrContainer().RAW_decode(RAN__Information__RIM__Container_applContainer__or__ApplErrContainer_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, selected_field, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_applContainer__or__ApplErrContainer = 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_applContainer__or__ApplErrContainer=OMIT_VALUE;
  if (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_sON__Transfer__Application__Identity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, SON__Transfer__Application__Identity__TLV_descr_.raw->forceomit);
  decoded_field_length = field_sON__Transfer__Application__Identity().RAW_decode(SON__Transfer__Application__Identity__TLV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_sON__Transfer__Application__Identity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  }
  }
  }
  else field_sON__Transfer__Application__Identity=OMIT_VALUE;
  if (field_iEI !=  os_83) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__RIM__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 = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RAN__Information__RIM__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__RIM__Container_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RIM__Application__Identity_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RIM__Sequence__Number_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RIM__PDU__Indications_descr_.raw);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RIM__Protocol__Version__Number_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_applContainer__or__ApplErrContainer.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, RAN__Information__RIM__Container_applContainer__or__ApplErrContainer_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, SON__Transfer__Application__Identity__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__RIM__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__RIM__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rIM__Application__Identity.RAW_encode(RIM__Application__Identity_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rIM__Sequence__Number.RAW_encode(RIM__Sequence__Number_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_rIM__PDU__Indications.RAW_encode(RIM__PDU__Indications_descr_, *myleaf.body.node.nodes[5]);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  encoded_length += field_rIM__Protocol__Version__Number().RAW_encode(RIM__Protocol__Version__Number_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_applContainer__or__ApplErrContainer.ispresent()) {
  encoded_length += field_applContainer__or__ApplErrContainer().RAW_encode(RAN__Information__RIM__Container_applContainer__or__ApplErrContainer_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  encoded_length += field_sON__Transfer__Application__Identity().RAW_encode(SON__Transfer__Application__Identity__TLV_descr_, *myleaf.body.node.nodes[8]);
  }
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 6;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(6);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = 0;
  }
  if (field_applContainer__or__ApplErrContainer.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].pos = 0;
  }
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].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(RAN__Information__RIM__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(RAN__Information__RIM__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_applContainer__or__ApplErrContainer.ispresent() && (field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_26 && field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_27 && field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_59)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,3};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_26.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+2;
  int new_pos1[]={3,3};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   os_27.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+2;
  int new_pos2[]={3,3};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   os_59.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_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_applContainer__or__ApplErrContainer.ispresent()) {
  switch (field_applContainer__or__ApplErrContainer().get_selection()) {
  case ApplContainer__or__ApplErrContainer::ALT_nacc:
  if (field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_26) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 3, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_26.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ApplContainer__or__ApplErrContainer::ALT_si3:
  if (field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_27) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 3, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_27.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
  if (field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_59) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 3, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_59.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_pos.pos);
  }
  break;
  default:;
  }
  }
  if (field_iEI !=  os_83) {
  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_83.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 RAN__Information__RIM__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
RIM__Application__Identity_template field_rIM__Application__Identity;
RIM__Sequence__Number_template field_rIM__Sequence__Number;
RIM__PDU__Indications_template field_rIM__PDU__Indications;
RIM__Protocol__Version__Number_template field_rIM__Protocol__Version__Number;
ApplContainer__or__ApplErrContainer_template field_applContainer__or__ApplErrContainer;
SON__Transfer__Application__Identity__TLV_template field_sON__Transfer__Application__Identity;
};

void RAN__Information__RIM__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_rIM__Application__Identity = ANY_VALUE;
single_value->field_rIM__Sequence__Number = ANY_VALUE;
single_value->field_rIM__PDU__Indications = ANY_VALUE;
single_value->field_rIM__Protocol__Version__Number = ANY_OR_OMIT;
single_value->field_applContainer__or__ApplErrContainer = ANY_OR_OMIT;
single_value->field_sON__Transfer__Application__Identity = ANY_OR_OMIT;
}
}
}

void RAN__Information__RIM__Container_template::copy_value(const RAN__Information__RIM__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.rIM__Application__Identity().is_bound()) {
  single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
  single_value->field_rIM__Application__Identity.clean_up();
}
if (other_value.rIM__Sequence__Number().is_bound()) {
  single_value->field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
} else {
  single_value->field_rIM__Sequence__Number.clean_up();
}
if (other_value.rIM__PDU__Indications().is_bound()) {
  single_value->field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
} else {
  single_value->field_rIM__PDU__Indications.clean_up();
}
if (other_value.rIM__Protocol__Version__Number().is_bound()) {
  if (other_value.rIM__Protocol__Version__Number().ispresent()) single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number()();
  else single_value->field_rIM__Protocol__Version__Number = OMIT_VALUE;
} else {
  single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (other_value.applContainer__or__ApplErrContainer().is_bound()) {
  if (other_value.applContainer__or__ApplErrContainer().ispresent()) single_value->field_applContainer__or__ApplErrContainer = other_value.applContainer__or__ApplErrContainer()();
  else single_value->field_applContainer__or__ApplErrContainer = OMIT_VALUE;
} else {
  single_value->field_applContainer__or__ApplErrContainer.clean_up();
}
if (other_value.sON__Transfer__Application__Identity().is_bound()) {
  if (other_value.sON__Transfer__Application__Identity().ispresent()) single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity()();
  else single_value->field_sON__Transfer__Application__Identity = OMIT_VALUE;
} else {
  single_value->field_sON__Transfer__Application__Identity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__RIM__Container_template::copy_template(const RAN__Information__RIM__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.rIM__Application__Identity().get_selection()) {
single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
single_value->field_rIM__Application__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Sequence__Number().get_selection()) {
single_value->field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
} else {
single_value->field_rIM__Sequence__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__PDU__Indications().get_selection()) {
single_value->field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
} else {
single_value->field_rIM__PDU__Indications.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Protocol__Version__Number().get_selection()) {
single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
} else {
single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.applContainer__or__ApplErrContainer().get_selection()) {
single_value->field_applContainer__or__ApplErrContainer = other_value.applContainer__or__ApplErrContainer();
} else {
single_value->field_applContainer__or__ApplErrContainer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sON__Transfer__Application__Identity().get_selection()) {
single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
} else {
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__RIM__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 RAN__Information__RIM__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__RIM__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.RAN_Information_RIM_Container.");
break;
}
set_selection(other_value);
}

RAN__Information__RIM__Container_template::RAN__Information__RIM__Container_template()
{
}

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

RAN__Information__RIM__Container_template::RAN__Information__RIM__Container_template(const RAN__Information__RIM__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__RIM__Container_template::match(const RAN__Information__RIM__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.rIM__Application__Identity().is_bound()) return FALSE;
if(!single_value->field_rIM__Application__Identity.match(other_value.rIM__Application__Identity(), legacy))return FALSE;
if(!other_value.rIM__Sequence__Number().is_bound()) return FALSE;
if(!single_value->field_rIM__Sequence__Number.match(other_value.rIM__Sequence__Number(), legacy))return FALSE;
if(!other_value.rIM__PDU__Indications().is_bound()) return FALSE;
if(!single_value->field_rIM__PDU__Indications.match(other_value.rIM__PDU__Indications(), legacy))return FALSE;
if(!other_value.rIM__Protocol__Version__Number().is_bound()) return FALSE;
if((other_value.rIM__Protocol__Version__Number().ispresent() ? !single_value->field_rIM__Protocol__Version__Number.match((const RIM__Protocol__Version__Number&)other_value.rIM__Protocol__Version__Number(), legacy) : !single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)))return FALSE;
if(!other_value.applContainer__or__ApplErrContainer().is_bound()) return FALSE;
if((other_value.applContainer__or__ApplErrContainer().ispresent() ? !single_value->field_applContainer__or__ApplErrContainer.match((const ApplContainer__or__ApplErrContainer&)other_value.applContainer__or__ApplErrContainer(), legacy) : !single_value->field_applContainer__or__ApplErrContainer.match_omit(legacy)))return FALSE;
if(!other_value.sON__Transfer__Application__Identity().is_bound()) return FALSE;
if((other_value.sON__Transfer__Application__Identity().ispresent() ? !single_value->field_sON__Transfer__Application__Identity.match((const SON__Transfer__Application__Identity__TLV&)other_value.sON__Transfer__Application__Identity(), legacy) : !single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_RIM_Container.");
}
return FALSE;
}

boolean RAN__Information__RIM__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_rIM__Application__Identity.is_bound()
 || single_value->field_rIM__Sequence__Number.is_bound()
 || single_value->field_rIM__PDU__Indications.is_bound()
 || (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_bound())
 || (single_value->field_applContainer__or__ApplErrContainer.is_omit() || single_value->field_applContainer__or__ApplErrContainer.is_bound())
 || (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_bound());
}

boolean RAN__Information__RIM__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_rIM__Application__Identity.is_value()
 && single_value->field_rIM__Sequence__Number.is_value()
 && single_value->field_rIM__PDU__Indications.is_value()
 && (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_value())
 && (single_value->field_applContainer__or__ApplErrContainer.is_omit() || single_value->field_applContainer__or__ApplErrContainer.is_value())
 && (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_value());
}

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

RAN__Information__RIM__Container RAN__Information__RIM__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.RAN_Information_RIM_Container.");
RAN__Information__RIM__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_rIM__Application__Identity.is_bound()) {
ret_val.rIM__Application__Identity() = single_value->field_rIM__Application__Identity.valueof();
}
if (single_value->field_rIM__Sequence__Number.is_bound()) {
ret_val.rIM__Sequence__Number() = single_value->field_rIM__Sequence__Number.valueof();
}
if (single_value->field_rIM__PDU__Indications.is_bound()) {
ret_val.rIM__PDU__Indications() = single_value->field_rIM__PDU__Indications.valueof();
}
if (single_value->field_rIM__Protocol__Version__Number.is_omit()) ret_val.rIM__Protocol__Version__Number() = OMIT_VALUE;
else if (single_value->field_rIM__Protocol__Version__Number.is_bound()) {
ret_val.rIM__Protocol__Version__Number() = single_value->field_rIM__Protocol__Version__Number.valueof();
}
if (single_value->field_applContainer__or__ApplErrContainer.is_omit()) ret_val.applContainer__or__ApplErrContainer() = OMIT_VALUE;
else if (single_value->field_applContainer__or__ApplErrContainer.is_bound()) {
ret_val.applContainer__or__ApplErrContainer() = single_value->field_applContainer__or__ApplErrContainer.valueof();
}
if (single_value->field_sON__Transfer__Application__Identity.is_omit()) ret_val.sON__Transfer__Application__Identity() = OMIT_VALUE;
else if (single_value->field_sON__Transfer__Application__Identity.is_bound()) {
ret_val.sON__Transfer__Application__Identity() = single_value->field_sON__Transfer__Application__Identity.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

RIM__Application__Identity_template& RAN__Information__RIM__Container_template::rIM__Application__Identity()
{
set_specific();
return single_value->field_rIM__Application__Identity;
}

const RIM__Application__Identity_template& RAN__Information__RIM__Container_template::rIM__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_RIM_Container.");
return single_value->field_rIM__Application__Identity;
}

RIM__Sequence__Number_template& RAN__Information__RIM__Container_template::rIM__Sequence__Number()
{
set_specific();
return single_value->field_rIM__Sequence__Number;
}

const RIM__Sequence__Number_template& RAN__Information__RIM__Container_template::rIM__Sequence__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Sequence_Number of a non-specific template of type @BSSGP_Types.RAN_Information_RIM_Container.");
return single_value->field_rIM__Sequence__Number;
}

RIM__PDU__Indications_template& RAN__Information__RIM__Container_template::rIM__PDU__Indications()
{
set_specific();
return single_value->field_rIM__PDU__Indications;
}

const RIM__PDU__Indications_template& RAN__Information__RIM__Container_template::rIM__PDU__Indications() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_PDU_Indications of a non-specific template of type @BSSGP_Types.RAN_Information_RIM_Container.");
return single_value->field_rIM__PDU__Indications;
}

RIM__Protocol__Version__Number_template& RAN__Information__RIM__Container_template::rIM__Protocol__Version__Number()
{
set_specific();
return single_value->field_rIM__Protocol__Version__Number;
}

const RIM__Protocol__Version__Number_template& RAN__Information__RIM__Container_template::rIM__Protocol__Version__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Protocol_Version_Number of a non-specific template of type @BSSGP_Types.RAN_Information_RIM_Container.");
return single_value->field_rIM__Protocol__Version__Number;
}

ApplContainer__or__ApplErrContainer_template& RAN__Information__RIM__Container_template::applContainer__or__ApplErrContainer()
{
set_specific();
return single_value->field_applContainer__or__ApplErrContainer;
}

const ApplContainer__or__ApplErrContainer_template& RAN__Information__RIM__Container_template::applContainer__or__ApplErrContainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field applContainer_or_ApplErrContainer of a non-specific template of type @BSSGP_Types.RAN_Information_RIM_Container.");
return single_value->field_applContainer__or__ApplErrContainer;
}

SON__Transfer__Application__Identity__TLV_template& RAN__Information__RIM__Container_template::sON__Transfer__Application__Identity()
{
set_specific();
return single_value->field_sON__Transfer__Application__Identity;
}

const SON__Transfer__Application__Identity__TLV_template& RAN__Information__RIM__Container_template::sON__Transfer__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_Transfer_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_RIM_Container.");
return single_value->field_sON__Transfer__Application__Identity;
}

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

void RAN__Information__RIM__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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
single_value->field_rIM__Sequence__Number.log();
TTCN_Logger::log_event_str(", rIM_PDU_Indications := ");
single_value->field_rIM__PDU__Indications.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", applContainer_or_ApplErrContainer := ");
single_value->field_applContainer__or__ApplErrContainer.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__RIM__Container_template::log_match(const RAN__Information__RIM__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_rIM__Application__Identity.match(match_value.rIM__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Application_Identity");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__Sequence__Number.match(match_value.rIM__Sequence__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Sequence_Number");
single_value->field_rIM__Sequence__Number.log_match(match_value.rIM__Sequence__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__PDU__Indications.match(match_value.rIM__PDU__Indications(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_PDU_Indications");
single_value->field_rIM__PDU__Indications.log_match(match_value.rIM__PDU__Indications(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rIM__Protocol__Version__Number().ispresent()){
if(!single_value->field_rIM__Protocol__Version__Number.match(match_value.rIM__Protocol__Version__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number");
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.applContainer__or__ApplErrContainer().ispresent()){
if(!single_value->field_applContainer__or__ApplErrContainer.match(match_value.applContainer__or__ApplErrContainer(), legacy)){
TTCN_Logger::log_logmatch_info(".applContainer_or_ApplErrContainer");
single_value->field_applContainer__or__ApplErrContainer.log_match(match_value.applContainer__or__ApplErrContainer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_applContainer__or__ApplErrContainer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".applContainer_or_ApplErrContainer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_applContainer__or__ApplErrContainer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sON__Transfer__Application__Identity().ispresent()){
if(!single_value->field_sON__Transfer__Application__Identity.match(match_value.sON__Transfer__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity");
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sON__Transfer__Application__Identity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sON__Transfer__Application__Identity.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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
single_value->field_rIM__Sequence__Number.log_match(match_value.rIM__Sequence__Number(), legacy);
TTCN_Logger::log_event_str(", rIM_PDU_Indications := ");
single_value->field_rIM__PDU__Indications.log_match(match_value.rIM__PDU__Indications(), legacy);
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
if (match_value.rIM__Protocol__Version__Number().ispresent()) {
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rIM__Protocol__Version__Number.log();
if (single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", applContainer_or_ApplErrContainer := ");
if (match_value.applContainer__or__ApplErrContainer().ispresent()) {
single_value->field_applContainer__or__ApplErrContainer.log_match(match_value.applContainer__or__ApplErrContainer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_applContainer__or__ApplErrContainer.log();
if (single_value->field_applContainer__or__ApplErrContainer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
if (match_value.sON__Transfer__Application__Identity().ispresent()) {
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sON__Transfer__Application__Identity.log();
if (single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__RIM__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_rIM__Application__Identity.encode_text(text_buf);
single_value->field_rIM__Sequence__Number.encode_text(text_buf);
single_value->field_rIM__PDU__Indications.encode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.encode_text(text_buf);
single_value->field_applContainer__or__ApplErrContainer.encode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_RIM_Container.");
}
}

void RAN__Information__RIM__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_rIM__Application__Identity.decode_text(text_buf);
single_value->field_rIM__Sequence__Number.decode_text(text_buf);
single_value->field_rIM__PDU__Indications.decode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.decode_text(text_buf);
single_value->field_applContainer__or__ApplErrContainer.decode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__RIM__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.RAN_Information_RIM_Container.");
}
}

void RAN__Information__RIM__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: {
    RAN__Information__RIM__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 (9<param.get_size()) {
      param.error("record template of type @BSSGP_Types.RAN_Information_RIM_Container has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__Sequence__Number().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__PDU__Indications().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) applContainer__or__ApplErrContainer().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_Sequence_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Sequence__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_PDU_Indications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__PDU__Indications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "applContainer_or_ApplErrContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          applContainer__or__ApplErrContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__RIM__Container_template* precondition = new RAN__Information__RIM__Container_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__RIM__Container_template* implied_template = new RAN__Information__RIM__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__RIM__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_RIM_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__RIM__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.RAN_Information_RIM_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_Container");
single_value->field_rIM__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_Container");
single_value->field_rIM__Sequence__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_Container");
single_value->field_rIM__PDU__Indications.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_Container");
single_value->field_rIM__Protocol__Version__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_Container");
single_value->field_applContainer__or__ApplErrContainer.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_Container");
single_value->field_sON__Transfer__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_RIM_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.RAN_Information_RIM_Container");
}

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

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

void ApplContainer__or__ApplErrContainer::copy_value(const ApplContainer__or__ApplErrContainer& other_value)
{
switch (other_value.union_selection) {
case ALT_nacc:
field_nacc = new ApplContainer__or__ApplErrContainer__NACC(*other_value.field_nacc);
break;
case ALT_si3:
field_si3 = new ApplContainer__or__ApplErrContainer__SI3(*other_value.field_si3);
break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel = new ApplContainer__or__ApplErrContainer__MBMS__data__channel(*other_value.field_mBMS__data__channel);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer::operator==(const ApplContainer__or__ApplErrContainer& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_nacc:
return *field_nacc == *other_value.field_nacc;
case ALT_si3:
return *field_si3 == *other_value.field_si3;
case ALT_mBMS__data__channel:
return *field_mBMS__data__channel == *other_value.field_mBMS__data__channel;
default:
return FALSE;
}
}

ApplContainer__or__ApplErrContainer__NACC& ApplContainer__or__ApplErrContainer::nacc()
{
if (union_selection != ALT_nacc) {
clean_up();
field_nacc = new ApplContainer__or__ApplErrContainer__NACC;
union_selection = ALT_nacc;
}
return *field_nacc;
}

const ApplContainer__or__ApplErrContainer__NACC& ApplContainer__or__ApplErrContainer::nacc() const
{
if (union_selection != ALT_nacc) TTCN_error("Using non-selected field nacc in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
return *field_nacc;
}

ApplContainer__or__ApplErrContainer__SI3& ApplContainer__or__ApplErrContainer::si3()
{
if (union_selection != ALT_si3) {
clean_up();
field_si3 = new ApplContainer__or__ApplErrContainer__SI3;
union_selection = ALT_si3;
}
return *field_si3;
}

const ApplContainer__or__ApplErrContainer__SI3& ApplContainer__or__ApplErrContainer::si3() const
{
if (union_selection != ALT_si3) TTCN_error("Using non-selected field si3 in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
return *field_si3;
}

ApplContainer__or__ApplErrContainer__MBMS__data__channel& ApplContainer__or__ApplErrContainer::mBMS__data__channel()
{
if (union_selection != ALT_mBMS__data__channel) {
clean_up();
field_mBMS__data__channel = new ApplContainer__or__ApplErrContainer__MBMS__data__channel;
union_selection = ALT_mBMS__data__channel;
}
return *field_mBMS__data__channel;
}

const ApplContainer__or__ApplErrContainer__MBMS__data__channel& ApplContainer__or__ApplErrContainer::mBMS__data__channel() const
{
if (union_selection != ALT_mBMS__data__channel) TTCN_error("Using non-selected field mBMS_data_channel in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
return *field_mBMS__data__channel;
}

boolean ApplContainer__or__ApplErrContainer::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.ApplContainer_or_ApplErrContainer.");
return union_selection == checked_selection;
}

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

boolean ApplContainer__or__ApplErrContainer::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_nacc: return field_nacc->is_value();
case ALT_si3: return field_si3->is_value();
case ALT_mBMS__data__channel: return field_mBMS__data__channel->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ApplContainer__or__ApplErrContainer::clean_up()
{
switch (union_selection) {
case ALT_nacc:
  delete field_nacc;
  break;
case ALT_si3:
  delete field_si3;
  break;
case ALT_mBMS__data__channel:
  delete field_mBMS__data__channel;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ApplContainer__or__ApplErrContainer::log() const
{
switch (union_selection) {
case ALT_nacc:
TTCN_Logger::log_event_str("{ nacc := ");
field_nacc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mBMS__data__channel:
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
field_mBMS__data__channel->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ApplContainer__or__ApplErrContainer::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, "nacc")) {
    nacc().set_param(*mp_last);
    if (!nacc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si3")) {
    si3().set_param(*mp_last);
    if (!si3().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mBMS_data_channel")) {
    mBMS__data__channel().set_param(*mp_last);
    if (!mBMS__data__channel().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer.", last_name);
}

void ApplContainer__or__ApplErrContainer::set_implicit_omit()
{
switch (union_selection) {
case ALT_nacc:
field_nacc->set_implicit_omit(); break;
case ALT_si3:
field_si3->set_implicit_omit(); break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel->set_implicit_omit(); break;
default: break;
}
}

void ApplContainer__or__ApplErrContainer::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_nacc:
field_nacc->encode_text(text_buf);
break;
case ALT_si3:
field_si3->encode_text(text_buf);
break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
}
}

void ApplContainer__or__ApplErrContainer::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_nacc:
nacc().decode_text(text_buf);
break;
case ALT_si3:
si3().decode_text(text_buf);
break;
case ALT_mBMS__data__channel:
mBMS__data__channel().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
}
}

void ApplContainer__or__ApplErrContainer::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 ApplContainer__or__ApplErrContainer::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 ApplContainer__or__ApplErrContainer::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, ApplContainer__or__ApplErrContainer__NACC_descr_.raw->forceomit);
      decoded_length = nacc().RAW_decode(ApplContainer__or__ApplErrContainer__NACC_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, ApplContainer__or__ApplErrContainer__SI3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(ApplContainer__or__ApplErrContainer__SI3_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, ApplContainer__or__ApplErrContainer__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = mBMS__data__channel().RAW_decode(ApplContainer__or__ApplErrContainer__MBMS__data__channel_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, ApplContainer__or__ApplErrContainer__NACC_descr_.raw->forceomit);
      decoded_length = nacc().RAW_decode(ApplContainer__or__ApplErrContainer__NACC_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, ApplContainer__or__ApplErrContainer__SI3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(ApplContainer__or__ApplErrContainer__SI3_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, ApplContainer__or__ApplErrContainer__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = mBMS__data__channel().RAW_decode(ApplContainer__or__ApplErrContainer__MBMS__data__channel_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int ApplContainer__or__ApplErrContainer::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_nacc:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, ApplContainer__or__ApplErrContainer__NACC_descr_.raw);
    encoded_length = field_nacc->RAW_encode(ApplContainer__or__ApplErrContainer__NACC_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &ApplContainer__or__ApplErrContainer__NACC_descr_;
    break;
  case ALT_si3:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, ApplContainer__or__ApplErrContainer__SI3_descr_.raw);
    encoded_length = field_si3->RAW_encode(ApplContainer__or__ApplErrContainer__SI3_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &ApplContainer__or__ApplErrContainer__SI3_descr_;
    break;
  case ALT_mBMS__data__channel:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, ApplContainer__or__ApplErrContainer__MBMS__data__channel_descr_.raw);
    encoded_length = field_mBMS__data__channel->RAW_encode(ApplContainer__or__ApplErrContainer__MBMS__data__channel_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &ApplContainer__or__ApplErrContainer__MBMS__data__channel_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void ApplContainer__or__ApplErrContainer_template::copy_value(const ApplContainer__or__ApplErrContainer& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer::ALT_nacc:
single_value.field_nacc = new ApplContainer__or__ApplErrContainer__NACC_template(other_value.nacc());
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
single_value.field_si3 = new ApplContainer__or__ApplErrContainer__SI3_template(other_value.si3());
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template(other_value.mBMS__data__channel());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
}
set_selection(SPECIFIC_VALUE);
}

void ApplContainer__or__ApplErrContainer_template::copy_template(const ApplContainer__or__ApplErrContainer_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 ApplContainer__or__ApplErrContainer::ALT_nacc:
single_value.field_nacc = new ApplContainer__or__ApplErrContainer__NACC_template(*other_value.single_value.field_nacc);
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
single_value.field_si3 = new ApplContainer__or__ApplErrContainer__SI3_template(*other_value.single_value.field_si3);
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template(*other_value.single_value.field_mBMS__data__channel);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
}
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 ApplContainer__or__ApplErrContainer_template[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 ApplContainer__or__ApplErrContainer_template(*other_value.implication_.precondition);
implication_.implied_template = new ApplContainer__or__ApplErrContainer_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.ApplContainer_or_ApplErrContainer.");
}
set_selection(other_value);
}

ApplContainer__or__ApplErrContainer_template::ApplContainer__or__ApplErrContainer_template()
{
}

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

ApplContainer__or__ApplErrContainer_template::ApplContainer__or__ApplErrContainer_template(const ApplContainer__or__ApplErrContainer& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ApplContainer__or__ApplErrContainer_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer::ALT_nacc:
delete single_value.field_nacc;
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
delete single_value.field_si3;
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
delete single_value.field_mBMS__data__channel;
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;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer_template::match(const ApplContainer__or__ApplErrContainer& 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:
{
ApplContainer__or__ApplErrContainer::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ApplContainer__or__ApplErrContainer::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ApplContainer__or__ApplErrContainer::ALT_nacc:
return single_value.field_nacc->match(other_value.nacc(), legacy);
case ApplContainer__or__ApplErrContainer::ALT_si3:
return single_value.field_si3->match(other_value.si3(), legacy);
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
return single_value.field_mBMS__data__channel->match(other_value.mBMS__data__channel(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
}
}
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.ApplContainer_or_ApplErrContainer.");
}
return FALSE;
}

boolean ApplContainer__or__ApplErrContainer_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer::ALT_nacc:
return single_value.field_nacc->is_value();
case ApplContainer__or__ApplErrContainer::ALT_si3:
return single_value.field_si3->is_value();
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
return single_value.field_mBMS__data__channel->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.ApplContainer_or_ApplErrContainer.");
}
}

ApplContainer__or__ApplErrContainer ApplContainer__or__ApplErrContainer_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.ApplContainer_or_ApplErrContainer.");
ApplContainer__or__ApplErrContainer ret_val;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer::ALT_nacc:
ret_val.nacc() = single_value.field_nacc->valueof();
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
ret_val.si3() = single_value.field_si3->valueof();
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
ret_val.mBMS__data__channel() = single_value.field_mBMS__data__channel->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.ApplContainer_or_ApplErrContainer.");
}
return ret_val;
}

ApplContainer__or__ApplErrContainer_template& ApplContainer__or__ApplErrContainer_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.ApplContainer_or_ApplErrContainer.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
return value_list.list_value[list_index];
}
void ApplContainer__or__ApplErrContainer_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.ApplContainer_or_ApplErrContainer.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ApplContainer__or__ApplErrContainer_template[list_length];
}

ApplContainer__or__ApplErrContainer__NACC_template& ApplContainer__or__ApplErrContainer_template::nacc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer::ALT_nacc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nacc = new ApplContainer__or__ApplErrContainer__NACC_template(ANY_VALUE);
else single_value.field_nacc = new ApplContainer__or__ApplErrContainer__NACC_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer::ALT_nacc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nacc;
}

const ApplContainer__or__ApplErrContainer__NACC_template& ApplContainer__or__ApplErrContainer_template::nacc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nacc in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer::ALT_nacc) TTCN_error("Accessing non-selected field nacc in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
return *single_value.field_nacc;
}

ApplContainer__or__ApplErrContainer__SI3_template& ApplContainer__or__ApplErrContainer_template::si3()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer::ALT_si3) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si3 = new ApplContainer__or__ApplErrContainer__SI3_template(ANY_VALUE);
else single_value.field_si3 = new ApplContainer__or__ApplErrContainer__SI3_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer::ALT_si3;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si3;
}

const ApplContainer__or__ApplErrContainer__SI3_template& ApplContainer__or__ApplErrContainer_template::si3() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si3 in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer::ALT_si3) TTCN_error("Accessing non-selected field si3 in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
return *single_value.field_si3;
}

ApplContainer__or__ApplErrContainer__MBMS__data__channel_template& ApplContainer__or__ApplErrContainer_template::mBMS__data__channel()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mBMS__data__channel = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template(ANY_VALUE);
else single_value.field_mBMS__data__channel = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mBMS__data__channel;
}

const ApplContainer__or__ApplErrContainer__MBMS__data__channel_template& ApplContainer__or__ApplErrContainer_template::mBMS__data__channel() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mBMS_data_channel in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel) TTCN_error("Accessing non-selected field mBMS_data_channel in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
return *single_value.field_mBMS__data__channel;
}

boolean ApplContainer__or__ApplErrContainer_template::ischosen(ApplContainer__or__ApplErrContainer::union_selection_type checked_selection) const
{
if (checked_selection == ApplContainer__or__ApplErrContainer::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ApplContainer__or__ApplErrContainer::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
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.ApplContainer_or_ApplErrContainer 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 ApplContainer__or__ApplErrContainer_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer::ALT_nacc:
TTCN_Logger::log_event_str("{ nacc := ");
single_value.field_nacc->log();
TTCN_Logger::log_event_str(" }");
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
single_value.field_mBMS__data__channel->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 ApplContainer__or__ApplErrContainer_template::log_match(const ApplContainer__or__ApplErrContainer& 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 ApplContainer__or__ApplErrContainer::ALT_nacc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nacc");
single_value.field_nacc->log_match(match_value.nacc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nacc := ");
single_value.field_nacc->log_match(match_value.nacc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si3");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mBMS_data_channel");
single_value.field_mBMS__data__channel->log_match(match_value.mBMS__data__channel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
single_value.field_mBMS__data__channel->log_match(match_value.mBMS__data__channel(), 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 ApplContainer__or__ApplErrContainer_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 ApplContainer__or__ApplErrContainer::ALT_nacc:
single_value.field_nacc->encode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
single_value.field_si3->encode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel->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.ApplContainer_or_ApplErrContainer.");
}
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.ApplContainer_or_ApplErrContainer.");
}
}

void ApplContainer__or__ApplErrContainer_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ApplContainer__or__ApplErrContainer::UNBOUND_VALUE;
ApplContainer__or__ApplErrContainer::union_selection_type new_selection = (ApplContainer__or__ApplErrContainer::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ApplContainer__or__ApplErrContainer::ALT_nacc:
single_value.field_nacc = new ApplContainer__or__ApplErrContainer__NACC_template;
single_value.field_nacc->decode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer::ALT_si3:
single_value.field_si3 = new ApplContainer__or__ApplErrContainer__SI3_template;
single_value.field_si3->decode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template;
single_value.field_mBMS__data__channel->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer.");
}
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 ApplContainer__or__ApplErrContainer_template[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.ApplContainer_or_ApplErrContainer.");
}
}

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

boolean ApplContainer__or__ApplErrContainer_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 ApplContainer__or__ApplErrContainer_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.ApplContainer_or_ApplErrContainer'");
    }
    if (strcmp("nacc", param_field) == 0) {
      nacc().set_param(param);
      return;
    } else if (strcmp("si3", param_field) == 0) {
      si3().set_param(param);
      return;
    } else if (strcmp("mBMS_data_channel", param_field) == 0) {
      mBMS__data__channel().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.ApplContainer_or_ApplErrContainer'", 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: {
    ApplContainer__or__ApplErrContainer_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.ApplContainer_or_ApplErrContainer");
    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, "nacc")) {
      nacc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si3")) {
      si3().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mBMS_data_channel")) {
      mBMS__data__channel().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    ApplContainer__or__ApplErrContainer_template* precondition = new ApplContainer__or__ApplErrContainer_template;
    precondition->set_param(*m_p->get_elem(0));
    ApplContainer__or__ApplErrContainer_template* implied_template = new ApplContainer__or__ApplErrContainer_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = ApplContainer__or__ApplErrContainer_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.ApplContainer_or_ApplErrContainer");
  }
  is_ifpresent = param.get_ifpresent();
}

void ApplContainer__or__ApplErrContainer_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 ApplContainer__or__ApplErrContainer::ALT_nacc:
single_value.field_nacc->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer");
return;
case ApplContainer__or__ApplErrContainer::ALT_si3:
single_value.field_si3->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer");
return;
case ApplContainer__or__ApplErrContainer::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer");
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.ApplContainer_or_ApplErrContainer.");
}
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.ApplContainer_or_ApplErrContainer");
}

void ApplContainer__or__ApplErrContainer__NACC::copy_value(const ApplContainer__or__ApplErrContainer__NACC& other_value)
{
switch (other_value.union_selection) {
case ALT_application__Container:
field_application__Container = new RAN__Information__Application__Container__NACC(*other_value.field_application__Container);
break;
case ALT_application__Error__Container:
field_application__Error__Container = new Application__Error__Container__NACC(*other_value.field_application__Error__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer__NACC::operator==(const ApplContainer__or__ApplErrContainer__NACC& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_application__Container:
return *field_application__Container == *other_value.field_application__Container;
case ALT_application__Error__Container:
return *field_application__Error__Container == *other_value.field_application__Error__Container;
default:
return FALSE;
}
}

RAN__Information__Application__Container__NACC& ApplContainer__or__ApplErrContainer__NACC::application__Container()
{
if (union_selection != ALT_application__Container) {
clean_up();
field_application__Container = new RAN__Information__Application__Container__NACC;
union_selection = ALT_application__Container;
}
return *field_application__Container;
}

const RAN__Information__Application__Container__NACC& ApplContainer__or__ApplErrContainer__NACC::application__Container() const
{
if (union_selection != ALT_application__Container) TTCN_error("Using non-selected field application_Container in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
return *field_application__Container;
}

Application__Error__Container__NACC& ApplContainer__or__ApplErrContainer__NACC::application__Error__Container()
{
if (union_selection != ALT_application__Error__Container) {
clean_up();
field_application__Error__Container = new Application__Error__Container__NACC;
union_selection = ALT_application__Error__Container;
}
return *field_application__Error__Container;
}

const Application__Error__Container__NACC& ApplContainer__or__ApplErrContainer__NACC::application__Error__Container() const
{
if (union_selection != ALT_application__Error__Container) TTCN_error("Using non-selected field application_Error_Container in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
return *field_application__Error__Container;
}

boolean ApplContainer__or__ApplErrContainer__NACC::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.ApplContainer_or_ApplErrContainer_NACC.");
return union_selection == checked_selection;
}

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

boolean ApplContainer__or__ApplErrContainer__NACC::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_application__Container: return field_application__Container->is_value();
case ALT_application__Error__Container: return field_application__Error__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ApplContainer__or__ApplErrContainer__NACC::clean_up()
{
switch (union_selection) {
case ALT_application__Container:
  delete field_application__Container;
  break;
case ALT_application__Error__Container:
  delete field_application__Error__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ApplContainer__or__ApplErrContainer__NACC::log() const
{
switch (union_selection) {
case ALT_application__Container:
TTCN_Logger::log_event_str("{ application_Container := ");
field_application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_application__Error__Container:
TTCN_Logger::log_event_str("{ application_Error_Container := ");
field_application__Error__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ApplContainer__or__ApplErrContainer__NACC::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, "application_Container")) {
    application__Container().set_param(*mp_last);
    if (!application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "application_Error_Container")) {
    application__Error__Container().set_param(*mp_last);
    if (!application__Error__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.", last_name);
}

void ApplContainer__or__ApplErrContainer__NACC::set_implicit_omit()
{
switch (union_selection) {
case ALT_application__Container:
field_application__Container->set_implicit_omit(); break;
case ALT_application__Error__Container:
field_application__Error__Container->set_implicit_omit(); break;
default: break;
}
}

void ApplContainer__or__ApplErrContainer__NACC::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_application__Container:
field_application__Container->encode_text(text_buf);
break;
case ALT_application__Error__Container:
field_application__Error__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
}
}

void ApplContainer__or__ApplErrContainer__NACC::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_application__Container:
application__Container().decode_text(text_buf);
break;
case ALT_application__Error__Container:
application__Error__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
}
}

void ApplContainer__or__ApplErrContainer__NACC::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 ApplContainer__or__ApplErrContainer__NACC::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 ApplContainer__or__ApplErrContainer__NACC::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, RAN__Information__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = application__Container().RAW_decode(RAN__Information__Application__Container__NACC_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, Application__Error__Container__NACC_descr_.raw->forceomit);
      decoded_length = application__Error__Container().RAW_decode(Application__Error__Container__NACC_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, RAN__Information__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = application__Container().RAW_decode(RAN__Information__Application__Container__NACC_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, Application__Error__Container__NACC_descr_.raw->forceomit);
      decoded_length = application__Error__Container().RAW_decode(Application__Error__Container__NACC_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 ApplContainer__or__ApplErrContainer__NACC::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_application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Application__Container__NACC_descr_.raw);
    encoded_length = field_application__Container->RAW_encode(RAN__Information__Application__Container__NACC_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Application__Container__NACC_descr_;
    break;
  case ALT_application__Error__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, Application__Error__Container__NACC_descr_.raw);
    encoded_length = field_application__Error__Container->RAW_encode(Application__Error__Container__NACC_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &Application__Error__Container__NACC_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void ApplContainer__or__ApplErrContainer__NACC_template::copy_value(const ApplContainer__or__ApplErrContainer__NACC& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__NACC_template(other_value.application__Container());
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__NACC_template(other_value.application__Error__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
}
set_selection(SPECIFIC_VALUE);
}

void ApplContainer__or__ApplErrContainer__NACC_template::copy_template(const ApplContainer__or__ApplErrContainer__NACC_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 ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__NACC_template(*other_value.single_value.field_application__Container);
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__NACC_template(*other_value.single_value.field_application__Error__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
}
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 ApplContainer__or__ApplErrContainer__NACC_template[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 ApplContainer__or__ApplErrContainer__NACC_template(*other_value.implication_.precondition);
implication_.implied_template = new ApplContainer__or__ApplErrContainer__NACC_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.ApplContainer_or_ApplErrContainer_NACC.");
}
set_selection(other_value);
}

ApplContainer__or__ApplErrContainer__NACC_template::ApplContainer__or__ApplErrContainer__NACC_template()
{
}

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

ApplContainer__or__ApplErrContainer__NACC_template::ApplContainer__or__ApplErrContainer__NACC_template(const ApplContainer__or__ApplErrContainer__NACC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ApplContainer__or__ApplErrContainer__NACC_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
delete single_value.field_application__Container;
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
delete single_value.field_application__Error__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;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer__NACC_template::match(const ApplContainer__or__ApplErrContainer__NACC& 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:
{
ApplContainer__or__ApplErrContainer__NACC::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ApplContainer__or__ApplErrContainer__NACC::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
return single_value.field_application__Container->match(other_value.application__Container(), legacy);
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
return single_value.field_application__Error__Container->match(other_value.application__Error__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
}
}
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.ApplContainer_or_ApplErrContainer_NACC.");
}
return FALSE;
}

boolean ApplContainer__or__ApplErrContainer__NACC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
return single_value.field_application__Container->is_value();
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
return single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_NACC.");
}
}

ApplContainer__or__ApplErrContainer__NACC ApplContainer__or__ApplErrContainer__NACC_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.ApplContainer_or_ApplErrContainer_NACC.");
ApplContainer__or__ApplErrContainer__NACC ret_val;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
ret_val.application__Container() = single_value.field_application__Container->valueof();
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
ret_val.application__Error__Container() = single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_NACC.");
}
return ret_val;
}

ApplContainer__or__ApplErrContainer__NACC_template& ApplContainer__or__ApplErrContainer__NACC_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.ApplContainer_or_ApplErrContainer_NACC.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
return value_list.list_value[list_index];
}
void ApplContainer__or__ApplErrContainer__NACC_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.ApplContainer_or_ApplErrContainer_NACC.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ApplContainer__or__ApplErrContainer__NACC_template[list_length];
}

RAN__Information__Application__Container__NACC_template& ApplContainer__or__ApplErrContainer__NACC_template::application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_application__Container = new RAN__Information__Application__Container__NACC_template(ANY_VALUE);
else single_value.field_application__Container = new RAN__Information__Application__Container__NACC_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_application__Container;
}

const RAN__Information__Application__Container__NACC_template& ApplContainer__or__ApplErrContainer__NACC_template::application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field application_Container in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container) TTCN_error("Accessing non-selected field application_Container in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
return *single_value.field_application__Container;
}

Application__Error__Container__NACC_template& ApplContainer__or__ApplErrContainer__NACC_template::application__Error__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_application__Error__Container = new Application__Error__Container__NACC_template(ANY_VALUE);
else single_value.field_application__Error__Container = new Application__Error__Container__NACC_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_application__Error__Container;
}

const Application__Error__Container__NACC_template& ApplContainer__or__ApplErrContainer__NACC_template::application__Error__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field application_Error_Container in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container) TTCN_error("Accessing non-selected field application_Error_Container in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
return *single_value.field_application__Error__Container;
}

boolean ApplContainer__or__ApplErrContainer__NACC_template::ischosen(ApplContainer__or__ApplErrContainer__NACC::union_selection_type checked_selection) const
{
if (checked_selection == ApplContainer__or__ApplErrContainer__NACC::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ApplContainer__or__ApplErrContainer__NACC::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
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.ApplContainer_or_ApplErrContainer_NACC 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 ApplContainer__or__ApplErrContainer__NACC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
TTCN_Logger::log_event_str("{ application_Container := ");
single_value.field_application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
TTCN_Logger::log_event_str("{ application_Error_Container := ");
single_value.field_application__Error__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 ApplContainer__or__ApplErrContainer__NACC_template::log_match(const ApplContainer__or__ApplErrContainer__NACC& 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 ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".application_Container");
single_value.field_application__Container->log_match(match_value.application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ application_Container := ");
single_value.field_application__Container->log_match(match_value.application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".application_Error_Container");
single_value.field_application__Error__Container->log_match(match_value.application__Error__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ application_Error_Container := ");
single_value.field_application__Error__Container->log_match(match_value.application__Error__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 ApplContainer__or__ApplErrContainer__NACC_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 ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
single_value.field_application__Container->encode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_NACC.");
}
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.ApplContainer_or_ApplErrContainer_NACC.");
}
}

void ApplContainer__or__ApplErrContainer__NACC_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ApplContainer__or__ApplErrContainer__NACC::UNBOUND_VALUE;
ApplContainer__or__ApplErrContainer__NACC::union_selection_type new_selection = (ApplContainer__or__ApplErrContainer__NACC::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__NACC_template;
single_value.field_application__Container->decode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__NACC_template;
single_value.field_application__Error__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.");
}
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 ApplContainer__or__ApplErrContainer__NACC_template[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.ApplContainer_or_ApplErrContainer_NACC.");
}
}

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

boolean ApplContainer__or__ApplErrContainer__NACC_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 ApplContainer__or__ApplErrContainer__NACC_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.ApplContainer_or_ApplErrContainer_NACC'");
    }
    if (strcmp("application_Container", param_field) == 0) {
      application__Container().set_param(param);
      return;
    } else if (strcmp("application_Error_Container", param_field) == 0) {
      application__Error__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC'", 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: {
    ApplContainer__or__ApplErrContainer__NACC_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.ApplContainer_or_ApplErrContainer_NACC");
    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, "application_Container")) {
      application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "application_Error_Container")) {
      application__Error__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    ApplContainer__or__ApplErrContainer__NACC_template* precondition = new ApplContainer__or__ApplErrContainer__NACC_template;
    precondition->set_param(*m_p->get_elem(0));
    ApplContainer__or__ApplErrContainer__NACC_template* implied_template = new ApplContainer__or__ApplErrContainer__NACC_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = ApplContainer__or__ApplErrContainer__NACC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC");
  }
  is_ifpresent = param.get_ifpresent();
}

void ApplContainer__or__ApplErrContainer__NACC_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 ApplContainer__or__ApplErrContainer__NACC::ALT_application__Container:
single_value.field_application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC");
return;
case ApplContainer__or__ApplErrContainer__NACC::ALT_application__Error__Container:
single_value.field_application__Error__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer_NACC");
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.ApplContainer_or_ApplErrContainer_NACC.");
}
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.ApplContainer_or_ApplErrContainer_NACC");
}

RAN__Information__Application__Container__NACC::RAN__Information__Application__Container__NACC()
{
}

RAN__Information__Application__Container__NACC::RAN__Information__Application__Container__NACC(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier,
    const BITSTRING& par_typeBit,
    const BITSTRING& par_number__of__SI__PSI,
    const OCTETSTRING& par_sI__PSI)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier),
  field_typeBit(par_typeBit),
  field_number__of__SI__PSI(par_number__of__SI__PSI),
  field_sI__PSI(par_sI__PSI)
{
}

RAN__Information__Application__Container__NACC::RAN__Information__Application__Container__NACC(const RAN__Information__Application__Container__NACC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_NACC.");
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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
else field_reporting__Cell__Identifier.clean_up();
if (other_value.typeBit().is_bound()) field_typeBit = other_value.typeBit();
else field_typeBit.clean_up();
if (other_value.number__of__SI__PSI().is_bound()) field_number__of__SI__PSI = other_value.number__of__SI__PSI();
else field_number__of__SI__PSI.clean_up();
if (other_value.sI__PSI().is_bound()) field_sI__PSI = other_value.sI__PSI();
else field_sI__PSI.clean_up();
}

void RAN__Information__Application__Container__NACC::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
field_typeBit.clean_up();
field_number__of__SI__PSI.clean_up();
field_sI__PSI.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Application__Container__NACC::get_descriptor() const { return &RAN__Information__Application__Container__NACC_descr_; }
RAN__Information__Application__Container__NACC& RAN__Information__Application__Container__NACC::operator=(const RAN__Information__Application__Container__NACC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_NACC.");
  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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
  else field_reporting__Cell__Identifier.clean_up();
  if (other_value.typeBit().is_bound()) field_typeBit = other_value.typeBit();
  else field_typeBit.clean_up();
  if (other_value.number__of__SI__PSI().is_bound()) field_number__of__SI__PSI = other_value.number__of__SI__PSI();
  else field_number__of__SI__PSI.clean_up();
  if (other_value.sI__PSI().is_bound()) field_sI__PSI = other_value.sI__PSI();
  else field_sI__PSI.clean_up();
}
return *this;
}

boolean RAN__Information__Application__Container__NACC::operator==(const RAN__Information__Application__Container__NACC& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reporting__Cell__Identifier==other_value.field_reporting__Cell__Identifier
  && field_typeBit==other_value.field_typeBit
  && field_number__of__SI__PSI==other_value.field_number__of__SI__PSI
  && field_sI__PSI==other_value.field_sI__PSI;
}

boolean RAN__Information__Application__Container__NACC::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reporting__Cell__Identifier.is_bound())
  || (field_typeBit.is_bound())
  || (field_number__of__SI__PSI.is_bound())
  || (field_sI__PSI.is_bound());
}
boolean RAN__Information__Application__Container__NACC::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reporting__Cell__Identifier.is_value()
  && field_typeBit.is_value()
  && field_number__of__SI__PSI.is_value()
  && field_sI__PSI.is_value();
}
void RAN__Information__Application__Container__NACC::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(", reporting_Cell_Identifier := ");
field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", typeBit := ");
field_typeBit.log();
TTCN_Logger::log_event_str(", number_of_SI_PSI := ");
field_number__of__SI__PSI.log();
TTCN_Logger::log_event_str(", sI_PSI := ");
field_sI__PSI.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Application__Container__NACC::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 (reporting__Cell__Identifier().is_bound()) reporting__Cell__Identifier().set_implicit_omit();
if (typeBit().is_bound()) typeBit().set_implicit_omit();
if (number__of__SI__PSI().is_bound()) number__of__SI__PSI().set_implicit_omit();
if (sI__PSI().is_bound()) sI__PSI().set_implicit_omit();
}

void RAN__Information__Application__Container__NACC::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.RAN_Information_Application_Container_NACC has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) reporting__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) typeBit().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) number__of__SI__PSI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sI__PSI().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reporting_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reporting__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "typeBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_PSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__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(), "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++) 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.RAN_Information_Application_Container_NACC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RAN_Information_Application_Container_NACC");
  }
}

void RAN__Information__Application__Container__NACC::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_reporting__Cell__Identifier.encode_text(text_buf);
field_typeBit.encode_text(text_buf);
field_number__of__SI__PSI.encode_text(text_buf);
field_sI__PSI.encode_text(text_buf);
}

void RAN__Information__Application__Container__NACC::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_reporting__Cell__Identifier.decode_text(text_buf);
field_typeBit.decode_text(text_buf);
field_number__of__SI__PSI.decode_text(text_buf);
field_sI__PSI.decode_text(text_buf);
}

void RAN__Information__Application__Container__NACC::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 RAN__Information__Application__Container__NACC::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 RAN__Information__Application__Container__NACC::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, RAN__Information__Application__Container__NACC_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Application__Container__NACC_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, RAN__Information__Application__Container__NACC_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Application__Container__NACC_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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_typeBit.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_number__of__SI__PSI.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_sI__PSI.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_136) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Application__Container__NACC::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RAN__Information__Application__Container__NACC_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Application__Container__NACC_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, OCTETSTRING_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Application__Container__NACC_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Application__Container__NACC_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_typeBit.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_number__of__SI__PSI.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_sI__PSI.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[6]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 4;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(4);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(RAN__Information__Application__Container__NACC_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(RAN__Information__Application__Container__NACC_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_136) {
  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_136.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 RAN__Information__Application__Container__NACC_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
BITSTRING_template field_typeBit;
BITSTRING_template field_number__of__SI__PSI;
OCTETSTRING_template field_sI__PSI;
};

void RAN__Information__Application__Container__NACC_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_reporting__Cell__Identifier = ANY_VALUE;
single_value->field_typeBit = ANY_VALUE;
single_value->field_number__of__SI__PSI = ANY_VALUE;
single_value->field_sI__PSI = ANY_VALUE;
}
}
}

void RAN__Information__Application__Container__NACC_template::copy_value(const RAN__Information__Application__Container__NACC& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
if (other_value.typeBit().is_bound()) {
  single_value->field_typeBit = other_value.typeBit();
} else {
  single_value->field_typeBit.clean_up();
}
if (other_value.number__of__SI__PSI().is_bound()) {
  single_value->field_number__of__SI__PSI = other_value.number__of__SI__PSI();
} else {
  single_value->field_number__of__SI__PSI.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();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Application__Container__NACC_template::copy_template(const RAN__Information__Application__Container__NACC_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.typeBit().get_selection()) {
single_value->field_typeBit = other_value.typeBit();
} else {
single_value->field_typeBit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.number__of__SI__PSI().get_selection()) {
single_value->field_number__of__SI__PSI = other_value.number__of__SI__PSI();
} else {
single_value->field_number__of__SI__PSI.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();
}
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 RAN__Information__Application__Container__NACC_template[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 RAN__Information__Application__Container__NACC_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Application__Container__NACC_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.RAN_Information_Application_Container_NACC.");
break;
}
set_selection(other_value);
}

RAN__Information__Application__Container__NACC_template::RAN__Information__Application__Container__NACC_template()
{
}

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

RAN__Information__Application__Container__NACC_template::RAN__Information__Application__Container__NACC_template(const RAN__Information__Application__Container__NACC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Application__Container__NACC_template::match(const RAN__Information__Application__Container__NACC& 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), legacy))return FALSE;
if(!other_value.typeBit().is_bound()) return FALSE;
if(!single_value->field_typeBit.match(other_value.typeBit(), legacy))return FALSE;
if(!other_value.number__of__SI__PSI().is_bound()) return FALSE;
if(!single_value->field_number__of__SI__PSI.match(other_value.number__of__SI__PSI(), 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;
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.RAN_Information_Application_Container_NACC.");
}
return FALSE;
}

boolean RAN__Information__Application__Container__NACC_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_reporting__Cell__Identifier.is_bound()
 || single_value->field_typeBit.is_bound()
 || single_value->field_number__of__SI__PSI.is_bound()
 || single_value->field_sI__PSI.is_bound();
}

boolean RAN__Information__Application__Container__NACC_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_reporting__Cell__Identifier.is_value()
 && single_value->field_typeBit.is_value()
 && single_value->field_number__of__SI__PSI.is_value()
 && single_value->field_sI__PSI.is_value();
}

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

RAN__Information__Application__Container__NACC RAN__Information__Application__Container__NACC_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.RAN_Information_Application_Container_NACC.");
RAN__Information__Application__Container__NACC 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
if (single_value->field_typeBit.is_bound()) {
ret_val.typeBit() = single_value->field_typeBit.valueof();
}
if (single_value->field_number__of__SI__PSI.is_bound()) {
ret_val.number__of__SI__PSI() = single_value->field_number__of__SI__PSI.valueof();
}
if (single_value->field_sI__PSI.is_bound()) {
ret_val.sI__PSI() = single_value->field_sI__PSI.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Application__Container__NACC_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Application__Container__NACC_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_NACC.");
return single_value->field_reporting__Cell__Identifier;
}

BITSTRING_template& RAN__Information__Application__Container__NACC_template::typeBit()
{
set_specific();
return single_value->field_typeBit;
}

const BITSTRING_template& RAN__Information__Application__Container__NACC_template::typeBit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field typeBit of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_NACC.");
return single_value->field_typeBit;
}

BITSTRING_template& RAN__Information__Application__Container__NACC_template::number__of__SI__PSI()
{
set_specific();
return single_value->field_number__of__SI__PSI;
}

const BITSTRING_template& RAN__Information__Application__Container__NACC_template::number__of__SI__PSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_SI_PSI of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_NACC.");
return single_value->field_number__of__SI__PSI;
}

OCTETSTRING_template& RAN__Information__Application__Container__NACC_template::sI__PSI()
{
set_specific();
return single_value->field_sI__PSI;
}

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

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

void RAN__Information__Application__Container__NACC_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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", typeBit := ");
single_value->field_typeBit.log();
TTCN_Logger::log_event_str(", number_of_SI_PSI := ");
single_value->field_number__of__SI__PSI.log();
TTCN_Logger::log_event_str(", sI_PSI := ");
single_value->field_sI__PSI.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 RAN__Information__Application__Container__NACC_template::log_match(const RAN__Information__Application__Container__NACC& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_typeBit.match(match_value.typeBit(), legacy)){
TTCN_Logger::log_logmatch_info(".typeBit");
single_value->field_typeBit.log_match(match_value.typeBit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_number__of__SI__PSI.match(match_value.number__of__SI__PSI(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_SI_PSI");
single_value->field_number__of__SI__PSI.log_match(match_value.number__of__SI__PSI(), 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);
}
}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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", typeBit := ");
single_value->field_typeBit.log_match(match_value.typeBit(), legacy);
TTCN_Logger::log_event_str(", number_of_SI_PSI := ");
single_value->field_number__of__SI__PSI.log_match(match_value.number__of__SI__PSI(), 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(" }");
} 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 RAN__Information__Application__Container__NACC_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_reporting__Cell__Identifier.encode_text(text_buf);
single_value->field_typeBit.encode_text(text_buf);
single_value->field_number__of__SI__PSI.encode_text(text_buf);
single_value->field_sI__PSI.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.RAN_Information_Application_Container_NACC.");
}
}

void RAN__Information__Application__Container__NACC_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_reporting__Cell__Identifier.decode_text(text_buf);
single_value->field_typeBit.decode_text(text_buf);
single_value->field_number__of__SI__PSI.decode_text(text_buf);
single_value->field_sI__PSI.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 RAN__Information__Application__Container__NACC_template[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.RAN_Information_Application_Container_NACC.");
}
}

void RAN__Information__Application__Container__NACC_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: {
    RAN__Information__Application__Container__NACC_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.RAN_Information_Application_Container_NACC has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) reporting__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) typeBit().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) number__of__SI__PSI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sI__PSI().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reporting_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reporting__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "typeBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_PSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__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(), "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++) 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.RAN_Information_Application_Container_NACC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Application__Container__NACC_template* precondition = new RAN__Information__Application__Container__NACC_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__Application__Container__NACC_template* implied_template = new RAN__Information__Application__Container__NACC_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__Application__Container__NACC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_Application_Container_NACC");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Application__Container__NACC_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.RAN_Information_Application_Container_NACC");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_NACC");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_NACC");
single_value->field_reporting__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_NACC");
single_value->field_typeBit.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_NACC");
single_value->field_number__of__SI__PSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_NACC");
single_value->field_sI__PSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_NACC");
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.RAN_Information_Application_Container_NACC");
}

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

boolean RAN__Information__Application__Container__NACC_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 Application__Container__IE__NACC::copy_value(const Application__Container__IE__NACC& other_value)
{
switch (other_value.union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__NACC(*other_value.field_rAN__Information__Request__Application__Container);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__NACC(*other_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Application_Container_IE_NACC.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Application__Container__IE__NACC::operator==(const Application__Container__IE__NACC& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_NACC.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_NACC.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
return *field_rAN__Information__Request__Application__Container == *other_value.field_rAN__Information__Request__Application__Container;
case ALT_rAN__Information__Application__Container:
return *field_rAN__Information__Application__Container == *other_value.field_rAN__Information__Application__Container;
default:
return FALSE;
}
}

RAN__Information__Request__Application__Container__NACC& Application__Container__IE__NACC::rAN__Information__Request__Application__Container()
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) {
clean_up();
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__NACC;
union_selection = ALT_rAN__Information__Request__Application__Container;
}
return *field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__NACC& Application__Container__IE__NACC::rAN__Information__Request__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) TTCN_error("Using non-selected field rAN_Information_Request_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_NACC.");
return *field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__NACC& Application__Container__IE__NACC::rAN__Information__Application__Container()
{
if (union_selection != ALT_rAN__Information__Application__Container) {
clean_up();
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__NACC;
union_selection = ALT_rAN__Information__Application__Container;
}
return *field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__NACC& Application__Container__IE__NACC::rAN__Information__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Application__Container) TTCN_error("Using non-selected field rAN_Information_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_NACC.");
return *field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__NACC::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.Application_Container_IE_NACC.");
return union_selection == checked_selection;
}

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

boolean Application__Container__IE__NACC::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rAN__Information__Request__Application__Container: return field_rAN__Information__Request__Application__Container->is_value();
case ALT_rAN__Information__Application__Container: return field_rAN__Information__Application__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Application__Container__IE__NACC::clean_up()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
  delete field_rAN__Information__Request__Application__Container;
  break;
case ALT_rAN__Information__Application__Container:
  delete field_rAN__Information__Application__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Application__Container__IE__NACC::log() const
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
field_rAN__Information__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Application__Container__IE__NACC::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, "rAN_Information_Request_Application_Container")) {
    rAN__Information__Request__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Request__Application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rAN_Information_Application_Container")) {
    rAN__Information__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Application__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_NACC.", last_name);
}

void Application__Container__IE__NACC::set_implicit_omit()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->set_implicit_omit(); break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->set_implicit_omit(); break;
default: break;
}
}

void Application__Container__IE__NACC::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Application_Container_IE_NACC.");
}
}

void Application__Container__IE__NACC::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rAN__Information__Request__Application__Container:
rAN__Information__Request__Application__Container().decode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
rAN__Information__Application__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Application_Container_IE_NACC.");
}
}

void Application__Container__IE__NACC::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 Application__Container__IE__NACC::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 Application__Container__IE__NACC::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, RAN__Information__Request__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__NACC_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, RAN__Information__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__NACC_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, RAN__Information__Request__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__NACC_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, RAN__Information__Application__Container__NACC_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__NACC_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 Application__Container__IE__NACC::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_rAN__Information__Request__Application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Request__Application__Container__NACC_descr_.raw);
    encoded_length = field_rAN__Information__Request__Application__Container->RAW_encode(RAN__Information__Request__Application__Container__NACC_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Request__Application__Container__NACC_descr_;
    break;
  case ALT_rAN__Information__Application__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RAN__Information__Application__Container__NACC_descr_.raw);
    encoded_length = field_rAN__Information__Application__Container->RAW_encode(RAN__Information__Application__Container__NACC_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RAN__Information__Application__Container__NACC_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Application__Container__IE__NACC_template::copy_value(const Application__Container__IE__NACC& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__NACC_template(other_value.rAN__Information__Request__Application__Container());
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__NACC_template(other_value.rAN__Information__Application__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Application_Container_IE_NACC.");
}
set_selection(SPECIFIC_VALUE);
}

void Application__Container__IE__NACC_template::copy_template(const Application__Container__IE__NACC_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 Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__NACC_template(*other_value.single_value.field_rAN__Information__Request__Application__Container);
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__NACC_template(*other_value.single_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Application_Container_IE_NACC.");
}
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 Application__Container__IE__NACC_template[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 Application__Container__IE__NACC_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Container__IE__NACC_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.Application_Container_IE_NACC.");
}
set_selection(other_value);
}

Application__Container__IE__NACC_template::Application__Container__IE__NACC_template()
{
}

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

Application__Container__IE__NACC_template::Application__Container__IE__NACC_template(const Application__Container__IE__NACC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Application__Container__IE__NACC_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
delete single_value.field_rAN__Information__Request__Application__Container;
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
delete single_value.field_rAN__Information__Application__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;
}

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

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

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

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

boolean Application__Container__IE__NACC_template::match(const Application__Container__IE__NACC& 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:
{
Application__Container__IE__NACC::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Application__Container__IE__NACC::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->match(other_value.rAN__Information__Request__Application__Container(), legacy);
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__Container->match(other_value.rAN__Information__Application__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Application_Container_IE_NACC.");
}
}
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.Application_Container_IE_NACC.");
}
return FALSE;
}

boolean Application__Container__IE__NACC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->is_value();
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__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.Application_Container_IE_NACC.");
}
}

Application__Container__IE__NACC Application__Container__IE__NACC_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.Application_Container_IE_NACC.");
Application__Container__IE__NACC ret_val;
switch (single_value.union_selection) {
case Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
ret_val.rAN__Information__Request__Application__Container() = single_value.field_rAN__Information__Request__Application__Container->valueof();
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
ret_val.rAN__Information__Application__Container() = single_value.field_rAN__Information__Application__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.Application_Container_IE_NACC.");
}
return ret_val;
}

Application__Container__IE__NACC_template& Application__Container__IE__NACC_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.Application_Container_IE_NACC.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Application_Container_IE_NACC.");
return value_list.list_value[list_index];
}
void Application__Container__IE__NACC_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.Application_Container_IE_NACC.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Application__Container__IE__NACC_template[list_length];
}

RAN__Information__Request__Application__Container__NACC_template& Application__Container__IE__NACC_template::rAN__Information__Request__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__NACC_template(ANY_VALUE);
else single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__NACC_template;
single_value.union_selection = Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__NACC_template& Application__Container__IE__NACC_template::rAN__Information__Request__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Request_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_NACC.");
if (single_value.union_selection != Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Request_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_NACC.");
return *single_value.field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__NACC_template& Application__Container__IE__NACC_template::rAN__Information__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__NACC::ALT_rAN__Information__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__NACC_template(ANY_VALUE);
else single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__NACC_template;
single_value.union_selection = Application__Container__IE__NACC::ALT_rAN__Information__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__NACC_template& Application__Container__IE__NACC_template::rAN__Information__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_NACC.");
if (single_value.union_selection != Application__Container__IE__NACC::ALT_rAN__Information__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_NACC.");
return *single_value.field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__NACC_template::ischosen(Application__Container__IE__NACC::union_selection_type checked_selection) const
{
if (checked_selection == Application__Container__IE__NACC::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Application_Container_IE_NACC.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Application__Container__IE__NACC::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Application_Container_IE_NACC.");
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.Application_Container_IE_NACC 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 Application__Container__IE__NACC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__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 Application__Container__IE__NACC_template::log_match(const Application__Container__IE__NACC& 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 Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Request_Application_Container");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Application_Container");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__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 Application__Container__IE__NACC_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 Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__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.Application_Container_IE_NACC.");
}
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.Application_Container_IE_NACC.");
}
}

void Application__Container__IE__NACC_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Application__Container__IE__NACC::UNBOUND_VALUE;
Application__Container__IE__NACC::union_selection_type new_selection = (Application__Container__IE__NACC::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__NACC_template;
single_value.field_rAN__Information__Request__Application__Container->decode_text(text_buf);
break;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__NACC_template;
single_value.field_rAN__Information__Application__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Application_Container_IE_NACC.");
}
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 Application__Container__IE__NACC_template[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.Application_Container_IE_NACC.");
}
}

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

boolean Application__Container__IE__NACC_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 Application__Container__IE__NACC_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.Application_Container_IE_NACC'");
    }
    if (strcmp("rAN_Information_Request_Application_Container", param_field) == 0) {
      rAN__Information__Request__Application__Container().set_param(param);
      return;
    } else if (strcmp("rAN_Information_Application_Container", param_field) == 0) {
      rAN__Information__Application__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Application_Container_IE_NACC'", 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: {
    Application__Container__IE__NACC_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.Application_Container_IE_NACC");
    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, "rAN_Information_Request_Application_Container")) {
      rAN__Information__Request__Application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rAN_Information_Application_Container")) {
      rAN__Information__Application__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_NACC.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Container__IE__NACC_template* precondition = new Application__Container__IE__NACC_template;
    precondition->set_param(*m_p->get_elem(0));
    Application__Container__IE__NACC_template* implied_template = new Application__Container__IE__NACC_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Application__Container__IE__NACC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Application_Container_IE_NACC");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Container__IE__NACC_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 Application__Container__IE__NACC::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_NACC");
return;
case Application__Container__IE__NACC::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_NACC");
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.Application_Container_IE_NACC.");
}
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.Application_Container_IE_NACC");
}

Application__Error__Container__NACC::Application__Error__Container__NACC()
{
}

Application__Error__Container__NACC::Application__Error__Container__NACC(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_nACC__cause,
    const Application__Container__IE__NACC& par_erroneousApplicationContainer)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_nACC__cause(par_nACC__cause),
  field_erroneousApplicationContainer(par_erroneousApplicationContainer)
{
}

Application__Error__Container__NACC::Application__Error__Container__NACC(const Application__Error__Container__NACC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Application_Error_Container_NACC.");
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.nACC__cause().is_bound()) field_nACC__cause = other_value.nACC__cause();
else field_nACC__cause.clean_up();
if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
else field_erroneousApplicationContainer.clean_up();
}

void Application__Error__Container__NACC::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_nACC__cause.clean_up();
field_erroneousApplicationContainer.clean_up();
}

const TTCN_Typedescriptor_t* Application__Error__Container__NACC::get_descriptor() const { return &Application__Error__Container__NACC_descr_; }
Application__Error__Container__NACC& Application__Error__Container__NACC::operator=(const Application__Error__Container__NACC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Application_Error_Container_NACC.");
  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.nACC__cause().is_bound()) field_nACC__cause = other_value.nACC__cause();
  else field_nACC__cause.clean_up();
  if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
  else field_erroneousApplicationContainer.clean_up();
}
return *this;
}

boolean Application__Error__Container__NACC::operator==(const Application__Error__Container__NACC& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_nACC__cause==other_value.field_nACC__cause
  && field_erroneousApplicationContainer==other_value.field_erroneousApplicationContainer;
}

boolean Application__Error__Container__NACC::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_nACC__cause.is_bound())
  || (field_erroneousApplicationContainer.is_bound());
}
boolean Application__Error__Container__NACC::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_nACC__cause.is_value()
  && field_erroneousApplicationContainer.is_value();
}
void Application__Error__Container__NACC::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(", nACC_cause := ");
field_nACC__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
field_erroneousApplicationContainer.log();
TTCN_Logger::log_event_str(" }");
}

void Application__Error__Container__NACC::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 (nACC__cause().is_bound()) nACC__cause().set_implicit_omit();
if (erroneousApplicationContainer().is_bound()) erroneousApplicationContainer().set_implicit_omit();
}

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

void Application__Error__Container__NACC::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_nACC__cause.encode_text(text_buf);
field_erroneousApplicationContainer.encode_text(text_buf);
}

void Application__Error__Container__NACC::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_nACC__cause.decode_text(text_buf);
field_erroneousApplicationContainer.decode_text(text_buf);
}

void Application__Error__Container__NACC::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 Application__Error__Container__NACC::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 Application__Error__Container__NACC::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, Application__Error__Container__NACC_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Application__Error__Container__NACC_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, Application__Error__Container__NACC_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Application__Error__Container__NACC_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_nACC__cause.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;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Application__Container__IE__NACC_descr_.raw->forceomit);
  decoded_field_length = field_erroneousApplicationContainer.RAW_decode(Application__Container__IE__NACC_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_81) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Application__Error__Container__NACC::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, Application__Error__Container__NACC_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Application__Error__Container__NACC_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Application__Container__IE__NACC_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Application__Error__Container__NACC_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Application__Error__Container__NACC_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_nACC__cause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_erroneousApplicationContainer.RAW_encode(Application__Container__IE__NACC_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(Application__Error__Container__NACC_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(Application__Error__Container__NACC_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_81) {
  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_81.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 Application__Error__Container__NACC_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_nACC__cause;
Application__Container__IE__NACC_template field_erroneousApplicationContainer;
};

void Application__Error__Container__NACC_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_nACC__cause = ANY_VALUE;
single_value->field_erroneousApplicationContainer = ANY_VALUE;
}
}
}

void Application__Error__Container__NACC_template::copy_value(const Application__Error__Container__NACC& 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.nACC__cause().is_bound()) {
  single_value->field_nACC__cause = other_value.nACC__cause();
} else {
  single_value->field_nACC__cause.clean_up();
}
if (other_value.erroneousApplicationContainer().is_bound()) {
  single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
  single_value->field_erroneousApplicationContainer.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Application__Error__Container__NACC_template::copy_template(const Application__Error__Container__NACC_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.nACC__cause().get_selection()) {
single_value->field_nACC__cause = other_value.nACC__cause();
} else {
single_value->field_nACC__cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.erroneousApplicationContainer().get_selection()) {
single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__NACC_template[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 Application__Error__Container__NACC_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Error__Container__NACC_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.Application_Error_Container_NACC.");
break;
}
set_selection(other_value);
}

Application__Error__Container__NACC_template::Application__Error__Container__NACC_template()
{
}

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

Application__Error__Container__NACC_template::Application__Error__Container__NACC_template(const Application__Error__Container__NACC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Application__Error__Container__NACC_template::match(const Application__Error__Container__NACC& 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.nACC__cause().is_bound()) return FALSE;
if(!single_value->field_nACC__cause.match(other_value.nACC__cause(), legacy))return FALSE;
if(!other_value.erroneousApplicationContainer().is_bound()) return FALSE;
if(!single_value->field_erroneousApplicationContainer.match(other_value.erroneousApplicationContainer(), 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.Application_Error_Container_NACC.");
}
return FALSE;
}

boolean Application__Error__Container__NACC_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_nACC__cause.is_bound()
 || single_value->field_erroneousApplicationContainer.is_bound();
}

boolean Application__Error__Container__NACC_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_nACC__cause.is_value()
 && single_value->field_erroneousApplicationContainer.is_value();
}

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

Application__Error__Container__NACC Application__Error__Container__NACC_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.Application_Error_Container_NACC.");
Application__Error__Container__NACC 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_nACC__cause.is_bound()) {
ret_val.nACC__cause() = single_value->field_nACC__cause.valueof();
}
if (single_value->field_erroneousApplicationContainer.is_bound()) {
ret_val.erroneousApplicationContainer() = single_value->field_erroneousApplicationContainer.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& Application__Error__Container__NACC_template::nACC__cause()
{
set_specific();
return single_value->field_nACC__cause;
}

const OCTETSTRING_template& Application__Error__Container__NACC_template::nACC__cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nACC_cause of a non-specific template of type @BSSGP_Types.Application_Error_Container_NACC.");
return single_value->field_nACC__cause;
}

Application__Container__IE__NACC_template& Application__Error__Container__NACC_template::erroneousApplicationContainer()
{
set_specific();
return single_value->field_erroneousApplicationContainer;
}

const Application__Container__IE__NACC_template& Application__Error__Container__NACC_template::erroneousApplicationContainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field erroneousApplicationContainer of a non-specific template of type @BSSGP_Types.Application_Error_Container_NACC.");
return single_value->field_erroneousApplicationContainer;
}

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

void Application__Error__Container__NACC_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(", nACC_cause := ");
single_value->field_nACC__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__NACC_template::log_match(const Application__Error__Container__NACC& 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_nACC__cause.match(match_value.nACC__cause(), legacy)){
TTCN_Logger::log_logmatch_info(".nACC_cause");
single_value->field_nACC__cause.log_match(match_value.nACC__cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_erroneousApplicationContainer.match(match_value.erroneousApplicationContainer(), legacy)){
TTCN_Logger::log_logmatch_info(".erroneousApplicationContainer");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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(", nACC_cause := ");
single_value->field_nACC__cause.log_match(match_value.nACC__cause(), legacy);
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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 Application__Error__Container__NACC_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_nACC__cause.encode_text(text_buf);
single_value->field_erroneousApplicationContainer.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.Application_Error_Container_NACC.");
}
}

void Application__Error__Container__NACC_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_nACC__cause.decode_text(text_buf);
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__NACC_template[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.Application_Error_Container_NACC.");
}
}

void Application__Error__Container__NACC_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: {
    Application__Error__Container__NACC_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.Application_Error_Container_NACC 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) nACC__cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) erroneousApplicationContainer().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(), "nACC_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nACC__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "erroneousApplicationContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          erroneousApplicationContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Application_Error_Container_NACC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Error__Container__NACC_template* precondition = new Application__Error__Container__NACC_template;
    precondition->set_param(*param.get_elem(0));
    Application__Error__Container__NACC_template* implied_template = new Application__Error__Container__NACC_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Application__Error__Container__NACC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Application_Error_Container_NACC");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Error__Container__NACC_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.Application_Error_Container_NACC");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_NACC");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_NACC");
single_value->field_nACC__cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_NACC");
single_value->field_erroneousApplicationContainer.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_NACC");
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.Application_Error_Container_NACC");
}

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

boolean Application__Error__Container__NACC_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 ApplContainer__or__ApplErrContainer__SI3::copy_value(const ApplContainer__or__ApplErrContainer__SI3& other_value)
{
switch (other_value.union_selection) {
case ALT_application__Container:
field_application__Container = new RAN__Information__Application__Container__SI3(*other_value.field_application__Container);
break;
case ALT_application__Error__Container:
field_application__Error__Container = new Application__Error__Container__SI3(*other_value.field_application__Error__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer__SI3::operator==(const ApplContainer__or__ApplErrContainer__SI3& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_application__Container:
return *field_application__Container == *other_value.field_application__Container;
case ALT_application__Error__Container:
return *field_application__Error__Container == *other_value.field_application__Error__Container;
default:
return FALSE;
}
}

RAN__Information__Application__Container__SI3& ApplContainer__or__ApplErrContainer__SI3::application__Container()
{
if (union_selection != ALT_application__Container) {
clean_up();
field_application__Container = new RAN__Information__Application__Container__SI3;
union_selection = ALT_application__Container;
}
return *field_application__Container;
}

const RAN__Information__Application__Container__SI3& ApplContainer__or__ApplErrContainer__SI3::application__Container() const
{
if (union_selection != ALT_application__Container) TTCN_error("Using non-selected field application_Container in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
return *field_application__Container;
}

Application__Error__Container__SI3& ApplContainer__or__ApplErrContainer__SI3::application__Error__Container()
{
if (union_selection != ALT_application__Error__Container) {
clean_up();
field_application__Error__Container = new Application__Error__Container__SI3;
union_selection = ALT_application__Error__Container;
}
return *field_application__Error__Container;
}

const Application__Error__Container__SI3& ApplContainer__or__ApplErrContainer__SI3::application__Error__Container() const
{
if (union_selection != ALT_application__Error__Container) TTCN_error("Using non-selected field application_Error_Container in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
return *field_application__Error__Container;
}

boolean ApplContainer__or__ApplErrContainer__SI3::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.ApplContainer_or_ApplErrContainer_SI3.");
return union_selection == checked_selection;
}

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

boolean ApplContainer__or__ApplErrContainer__SI3::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_application__Container: return field_application__Container->is_value();
case ALT_application__Error__Container: return field_application__Error__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ApplContainer__or__ApplErrContainer__SI3::clean_up()
{
switch (union_selection) {
case ALT_application__Container:
  delete field_application__Container;
  break;
case ALT_application__Error__Container:
  delete field_application__Error__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ApplContainer__or__ApplErrContainer__SI3::log() const
{
switch (union_selection) {
case ALT_application__Container:
TTCN_Logger::log_event_str("{ application_Container := ");
field_application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_application__Error__Container:
TTCN_Logger::log_event_str("{ application_Error_Container := ");
field_application__Error__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ApplContainer__or__ApplErrContainer__SI3::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, "application_Container")) {
    application__Container().set_param(*mp_last);
    if (!application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "application_Error_Container")) {
    application__Error__Container().set_param(*mp_last);
    if (!application__Error__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.", last_name);
}

void ApplContainer__or__ApplErrContainer__SI3::set_implicit_omit()
{
switch (union_selection) {
case ALT_application__Container:
field_application__Container->set_implicit_omit(); break;
case ALT_application__Error__Container:
field_application__Error__Container->set_implicit_omit(); break;
default: break;
}
}

void ApplContainer__or__ApplErrContainer__SI3::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_application__Container:
field_application__Container->encode_text(text_buf);
break;
case ALT_application__Error__Container:
field_application__Error__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
}
}

void ApplContainer__or__ApplErrContainer__SI3::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_application__Container:
application__Container().decode_text(text_buf);
break;
case ALT_application__Error__Container:
application__Error__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
}
}

void ApplContainer__or__ApplErrContainer__SI3::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 ApplContainer__or__ApplErrContainer__SI3::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 ApplContainer__or__ApplErrContainer__SI3::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, RAN__Information__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = application__Container().RAW_decode(RAN__Information__Application__Container__SI3_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, Application__Error__Container__SI3_descr_.raw->forceomit);
      decoded_length = application__Error__Container().RAW_decode(Application__Error__Container__SI3_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, RAN__Information__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = application__Container().RAW_decode(RAN__Information__Application__Container__SI3_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, Application__Error__Container__SI3_descr_.raw->forceomit);
      decoded_length = application__Error__Container().RAW_decode(Application__Error__Container__SI3_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 ApplContainer__or__ApplErrContainer__SI3::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_application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Application__Container__SI3_descr_.raw);
    encoded_length = field_application__Container->RAW_encode(RAN__Information__Application__Container__SI3_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Application__Container__SI3_descr_;
    break;
  case ALT_application__Error__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, Application__Error__Container__SI3_descr_.raw);
    encoded_length = field_application__Error__Container->RAW_encode(Application__Error__Container__SI3_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &Application__Error__Container__SI3_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void ApplContainer__or__ApplErrContainer__SI3_template::copy_value(const ApplContainer__or__ApplErrContainer__SI3& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__SI3_template(other_value.application__Container());
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__SI3_template(other_value.application__Error__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
}
set_selection(SPECIFIC_VALUE);
}

void ApplContainer__or__ApplErrContainer__SI3_template::copy_template(const ApplContainer__or__ApplErrContainer__SI3_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 ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__SI3_template(*other_value.single_value.field_application__Container);
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__SI3_template(*other_value.single_value.field_application__Error__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
}
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 ApplContainer__or__ApplErrContainer__SI3_template[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 ApplContainer__or__ApplErrContainer__SI3_template(*other_value.implication_.precondition);
implication_.implied_template = new ApplContainer__or__ApplErrContainer__SI3_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.ApplContainer_or_ApplErrContainer_SI3.");
}
set_selection(other_value);
}

ApplContainer__or__ApplErrContainer__SI3_template::ApplContainer__or__ApplErrContainer__SI3_template()
{
}

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

ApplContainer__or__ApplErrContainer__SI3_template::ApplContainer__or__ApplErrContainer__SI3_template(const ApplContainer__or__ApplErrContainer__SI3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ApplContainer__or__ApplErrContainer__SI3_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
delete single_value.field_application__Container;
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
delete single_value.field_application__Error__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;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer__SI3_template::match(const ApplContainer__or__ApplErrContainer__SI3& 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:
{
ApplContainer__or__ApplErrContainer__SI3::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ApplContainer__or__ApplErrContainer__SI3::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
return single_value.field_application__Container->match(other_value.application__Container(), legacy);
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
return single_value.field_application__Error__Container->match(other_value.application__Error__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
}
}
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.ApplContainer_or_ApplErrContainer_SI3.");
}
return FALSE;
}

boolean ApplContainer__or__ApplErrContainer__SI3_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
return single_value.field_application__Container->is_value();
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
return single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_SI3.");
}
}

ApplContainer__or__ApplErrContainer__SI3 ApplContainer__or__ApplErrContainer__SI3_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.ApplContainer_or_ApplErrContainer_SI3.");
ApplContainer__or__ApplErrContainer__SI3 ret_val;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
ret_val.application__Container() = single_value.field_application__Container->valueof();
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
ret_val.application__Error__Container() = single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_SI3.");
}
return ret_val;
}

ApplContainer__or__ApplErrContainer__SI3_template& ApplContainer__or__ApplErrContainer__SI3_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.ApplContainer_or_ApplErrContainer_SI3.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
return value_list.list_value[list_index];
}
void ApplContainer__or__ApplErrContainer__SI3_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.ApplContainer_or_ApplErrContainer_SI3.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ApplContainer__or__ApplErrContainer__SI3_template[list_length];
}

RAN__Information__Application__Container__SI3_template& ApplContainer__or__ApplErrContainer__SI3_template::application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_application__Container = new RAN__Information__Application__Container__SI3_template(ANY_VALUE);
else single_value.field_application__Container = new RAN__Information__Application__Container__SI3_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_application__Container;
}

const RAN__Information__Application__Container__SI3_template& ApplContainer__or__ApplErrContainer__SI3_template::application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field application_Container in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container) TTCN_error("Accessing non-selected field application_Container in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
return *single_value.field_application__Container;
}

Application__Error__Container__SI3_template& ApplContainer__or__ApplErrContainer__SI3_template::application__Error__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_application__Error__Container = new Application__Error__Container__SI3_template(ANY_VALUE);
else single_value.field_application__Error__Container = new Application__Error__Container__SI3_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_application__Error__Container;
}

const Application__Error__Container__SI3_template& ApplContainer__or__ApplErrContainer__SI3_template::application__Error__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field application_Error_Container in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container) TTCN_error("Accessing non-selected field application_Error_Container in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
return *single_value.field_application__Error__Container;
}

boolean ApplContainer__or__ApplErrContainer__SI3_template::ischosen(ApplContainer__or__ApplErrContainer__SI3::union_selection_type checked_selection) const
{
if (checked_selection == ApplContainer__or__ApplErrContainer__SI3::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ApplContainer__or__ApplErrContainer__SI3::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
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.ApplContainer_or_ApplErrContainer_SI3 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 ApplContainer__or__ApplErrContainer__SI3_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
TTCN_Logger::log_event_str("{ application_Container := ");
single_value.field_application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
TTCN_Logger::log_event_str("{ application_Error_Container := ");
single_value.field_application__Error__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 ApplContainer__or__ApplErrContainer__SI3_template::log_match(const ApplContainer__or__ApplErrContainer__SI3& 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 ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".application_Container");
single_value.field_application__Container->log_match(match_value.application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ application_Container := ");
single_value.field_application__Container->log_match(match_value.application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".application_Error_Container");
single_value.field_application__Error__Container->log_match(match_value.application__Error__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ application_Error_Container := ");
single_value.field_application__Error__Container->log_match(match_value.application__Error__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 ApplContainer__or__ApplErrContainer__SI3_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 ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
single_value.field_application__Container->encode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_SI3.");
}
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.ApplContainer_or_ApplErrContainer_SI3.");
}
}

void ApplContainer__or__ApplErrContainer__SI3_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ApplContainer__or__ApplErrContainer__SI3::UNBOUND_VALUE;
ApplContainer__or__ApplErrContainer__SI3::union_selection_type new_selection = (ApplContainer__or__ApplErrContainer__SI3::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__SI3_template;
single_value.field_application__Container->decode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__SI3_template;
single_value.field_application__Error__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.");
}
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 ApplContainer__or__ApplErrContainer__SI3_template[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.ApplContainer_or_ApplErrContainer_SI3.");
}
}

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

boolean ApplContainer__or__ApplErrContainer__SI3_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 ApplContainer__or__ApplErrContainer__SI3_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.ApplContainer_or_ApplErrContainer_SI3'");
    }
    if (strcmp("application_Container", param_field) == 0) {
      application__Container().set_param(param);
      return;
    } else if (strcmp("application_Error_Container", param_field) == 0) {
      application__Error__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3'", 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: {
    ApplContainer__or__ApplErrContainer__SI3_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.ApplContainer_or_ApplErrContainer_SI3");
    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, "application_Container")) {
      application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "application_Error_Container")) {
      application__Error__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    ApplContainer__or__ApplErrContainer__SI3_template* precondition = new ApplContainer__or__ApplErrContainer__SI3_template;
    precondition->set_param(*m_p->get_elem(0));
    ApplContainer__or__ApplErrContainer__SI3_template* implied_template = new ApplContainer__or__ApplErrContainer__SI3_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = ApplContainer__or__ApplErrContainer__SI3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3");
  }
  is_ifpresent = param.get_ifpresent();
}

void ApplContainer__or__ApplErrContainer__SI3_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 ApplContainer__or__ApplErrContainer__SI3::ALT_application__Container:
single_value.field_application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3");
return;
case ApplContainer__or__ApplErrContainer__SI3::ALT_application__Error__Container:
single_value.field_application__Error__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer_SI3");
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.ApplContainer_or_ApplErrContainer_SI3.");
}
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.ApplContainer_or_ApplErrContainer_SI3");
}

LocationAreaIdentification::LocationAreaIdentification()
{
}

LocationAreaIdentification::LocationAreaIdentification(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)
  :   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)
{
}

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

void LocationAreaIdentification::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();
}

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

boolean LocationAreaIdentification::operator==(const LocationAreaIdentification& 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_lac==other_value.field_lac;
}

boolean LocationAreaIdentification::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_lac.is_bound());
}
boolean LocationAreaIdentification::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_lac.is_value();
}
void LocationAreaIdentification::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(", lac := ");
field_lac.log();
TTCN_Logger::log_event_str(" }");
}

void LocationAreaIdentification::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();
}

void LocationAreaIdentification::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.LocationAreaIdentification 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) lac().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(), "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++) 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.LocationAreaIdentification: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.LocationAreaIdentification");
  }
}

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

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

void LocationAreaIdentification::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 LocationAreaIdentification::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 LocationAreaIdentification::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_lac.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 LocationAreaIdentification::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_lac.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct LocationAreaIdentification_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_lac;
};

void LocationAreaIdentification_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_lac = ANY_VALUE;
}
}
}

void LocationAreaIdentification_template::copy_value(const LocationAreaIdentification& 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.lac().is_bound()) {
  single_value->field_lac = other_value.lac();
} else {
  single_value->field_lac.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LocationAreaIdentification_template::copy_template(const LocationAreaIdentification_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.lac().get_selection()) {
single_value->field_lac = other_value.lac();
} else {
single_value->field_lac.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 LocationAreaIdentification_template[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 LocationAreaIdentification_template(*other_value.implication_.precondition);
implication_.implied_template = new LocationAreaIdentification_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.LocationAreaIdentification.");
break;
}
set_selection(other_value);
}

LocationAreaIdentification_template::LocationAreaIdentification_template()
{
}

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

LocationAreaIdentification_template::LocationAreaIdentification_template(const LocationAreaIdentification& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LocationAreaIdentification_template::match(const LocationAreaIdentification& 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.lac().is_bound()) return FALSE;
if(!single_value->field_lac.match(other_value.lac(), 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.LocationAreaIdentification.");
}
return FALSE;
}

boolean LocationAreaIdentification_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_lac.is_bound();
}

boolean LocationAreaIdentification_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_lac.is_value();
}

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

LocationAreaIdentification LocationAreaIdentification_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.LocationAreaIdentification.");
LocationAreaIdentification 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_lac.is_bound()) {
ret_val.lac() = single_value->field_lac.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

OCTETSTRING_template& LocationAreaIdentification_template::lac()
{
set_specific();
return single_value->field_lac;
}

const OCTETSTRING_template& LocationAreaIdentification_template::lac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lac of a non-specific template of type @BSSGP_Types.LocationAreaIdentification.");
return single_value->field_lac;
}

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

void LocationAreaIdentification_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(", lac := ");
single_value->field_lac.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 LocationAreaIdentification_template::log_match(const LocationAreaIdentification& 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_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);
}
}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(", lac := ");
single_value->field_lac.log_match(match_value.lac(), 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 LocationAreaIdentification_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_lac.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.LocationAreaIdentification.");
}
}

void LocationAreaIdentification_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_lac.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 LocationAreaIdentification_template[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.LocationAreaIdentification.");
}
}

void LocationAreaIdentification_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: {
    LocationAreaIdentification_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.LocationAreaIdentification 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) lac().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(), "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++) 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.LocationAreaIdentification: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LocationAreaIdentification_template* precondition = new LocationAreaIdentification_template;
    precondition->set_param(*param.get_elem(0));
    LocationAreaIdentification_template* implied_template = new LocationAreaIdentification_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LocationAreaIdentification_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.LocationAreaIdentification");
  }
  is_ifpresent = param.get_ifpresent();
}

void LocationAreaIdentification_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.LocationAreaIdentification");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.LocationAreaIdentification");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.LocationAreaIdentification");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.LocationAreaIdentification");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.LocationAreaIdentification");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.LocationAreaIdentification");
single_value->field_lac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.LocationAreaIdentification");
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.LocationAreaIdentification");
}

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

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

ControlChannelDescription::ControlChannelDescription()
{
}

ControlChannelDescription::ControlChannelDescription(const BITSTRING& par_cCCH__Conf,
    const BITSTRING& par_bS__AG__BLKS__RES,
    const BITSTRING& par_aTT,
    const BITSTRING& par_mSCR,
    const BITSTRING& par_bS__PA__MFRMS,
    const BITSTRING& par_spare1,
    const BITSTRING& par_cBQ3,
    const BITSTRING& par_spare2,
    const OCTETSTRING& par_t3212)
  :   field_cCCH__Conf(par_cCCH__Conf),
  field_bS__AG__BLKS__RES(par_bS__AG__BLKS__RES),
  field_aTT(par_aTT),
  field_mSCR(par_mSCR),
  field_bS__PA__MFRMS(par_bS__PA__MFRMS),
  field_spare1(par_spare1),
  field_cBQ3(par_cBQ3),
  field_spare2(par_spare2),
  field_t3212(par_t3212)
{
}

ControlChannelDescription::ControlChannelDescription(const ControlChannelDescription& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.ControlChannelDescription.");
if (other_value.cCCH__Conf().is_bound()) field_cCCH__Conf = other_value.cCCH__Conf();
else field_cCCH__Conf.clean_up();
if (other_value.bS__AG__BLKS__RES().is_bound()) field_bS__AG__BLKS__RES = other_value.bS__AG__BLKS__RES();
else field_bS__AG__BLKS__RES.clean_up();
if (other_value.aTT().is_bound()) field_aTT = other_value.aTT();
else field_aTT.clean_up();
if (other_value.mSCR().is_bound()) field_mSCR = other_value.mSCR();
else field_mSCR.clean_up();
if (other_value.bS__PA__MFRMS().is_bound()) field_bS__PA__MFRMS = other_value.bS__PA__MFRMS();
else field_bS__PA__MFRMS.clean_up();
if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
else field_spare1.clean_up();
if (other_value.cBQ3().is_bound()) field_cBQ3 = other_value.cBQ3();
else field_cBQ3.clean_up();
if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
else field_spare2.clean_up();
if (other_value.t3212().is_bound()) field_t3212 = other_value.t3212();
else field_t3212.clean_up();
}

void ControlChannelDescription::clean_up()
{
field_cCCH__Conf.clean_up();
field_bS__AG__BLKS__RES.clean_up();
field_aTT.clean_up();
field_mSCR.clean_up();
field_bS__PA__MFRMS.clean_up();
field_spare1.clean_up();
field_cBQ3.clean_up();
field_spare2.clean_up();
field_t3212.clean_up();
}

const TTCN_Typedescriptor_t* ControlChannelDescription::get_descriptor() const { return &ControlChannelDescription_descr_; }
ControlChannelDescription& ControlChannelDescription::operator=(const ControlChannelDescription& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.ControlChannelDescription.");
  if (other_value.cCCH__Conf().is_bound()) field_cCCH__Conf = other_value.cCCH__Conf();
  else field_cCCH__Conf.clean_up();
  if (other_value.bS__AG__BLKS__RES().is_bound()) field_bS__AG__BLKS__RES = other_value.bS__AG__BLKS__RES();
  else field_bS__AG__BLKS__RES.clean_up();
  if (other_value.aTT().is_bound()) field_aTT = other_value.aTT();
  else field_aTT.clean_up();
  if (other_value.mSCR().is_bound()) field_mSCR = other_value.mSCR();
  else field_mSCR.clean_up();
  if (other_value.bS__PA__MFRMS().is_bound()) field_bS__PA__MFRMS = other_value.bS__PA__MFRMS();
  else field_bS__PA__MFRMS.clean_up();
  if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
  else field_spare1.clean_up();
  if (other_value.cBQ3().is_bound()) field_cBQ3 = other_value.cBQ3();
  else field_cBQ3.clean_up();
  if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
  else field_spare2.clean_up();
  if (other_value.t3212().is_bound()) field_t3212 = other_value.t3212();
  else field_t3212.clean_up();
}
return *this;
}

boolean ControlChannelDescription::operator==(const ControlChannelDescription& other_value) const
{
return field_cCCH__Conf==other_value.field_cCCH__Conf
  && field_bS__AG__BLKS__RES==other_value.field_bS__AG__BLKS__RES
  && field_aTT==other_value.field_aTT
  && field_mSCR==other_value.field_mSCR
  && field_bS__PA__MFRMS==other_value.field_bS__PA__MFRMS
  && field_spare1==other_value.field_spare1
  && field_cBQ3==other_value.field_cBQ3
  && field_spare2==other_value.field_spare2
  && field_t3212==other_value.field_t3212;
}

boolean ControlChannelDescription::is_bound() const
{
return (field_cCCH__Conf.is_bound())
  || (field_bS__AG__BLKS__RES.is_bound())
  || (field_aTT.is_bound())
  || (field_mSCR.is_bound())
  || (field_bS__PA__MFRMS.is_bound())
  || (field_spare1.is_bound())
  || (field_cBQ3.is_bound())
  || (field_spare2.is_bound())
  || (field_t3212.is_bound());
}
boolean ControlChannelDescription::is_value() const
{
return field_cCCH__Conf.is_value()
  && field_bS__AG__BLKS__RES.is_value()
  && field_aTT.is_value()
  && field_mSCR.is_value()
  && field_bS__PA__MFRMS.is_value()
  && field_spare1.is_value()
  && field_cBQ3.is_value()
  && field_spare2.is_value()
  && field_t3212.is_value();
}
void ControlChannelDescription::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cCCH_Conf := ");
field_cCCH__Conf.log();
TTCN_Logger::log_event_str(", bS_AG_BLKS_RES := ");
field_bS__AG__BLKS__RES.log();
TTCN_Logger::log_event_str(", aTT := ");
field_aTT.log();
TTCN_Logger::log_event_str(", mSCR := ");
field_mSCR.log();
TTCN_Logger::log_event_str(", bS_PA_MFRMS := ");
field_bS__PA__MFRMS.log();
TTCN_Logger::log_event_str(", spare1 := ");
field_spare1.log();
TTCN_Logger::log_event_str(", cBQ3 := ");
field_cBQ3.log();
TTCN_Logger::log_event_str(", spare2 := ");
field_spare2.log();
TTCN_Logger::log_event_str(", t3212 := ");
field_t3212.log();
TTCN_Logger::log_event_str(" }");
}

void ControlChannelDescription::set_implicit_omit()
{
if (cCCH__Conf().is_bound()) cCCH__Conf().set_implicit_omit();
if (bS__AG__BLKS__RES().is_bound()) bS__AG__BLKS__RES().set_implicit_omit();
if (aTT().is_bound()) aTT().set_implicit_omit();
if (mSCR().is_bound()) mSCR().set_implicit_omit();
if (bS__PA__MFRMS().is_bound()) bS__PA__MFRMS().set_implicit_omit();
if (spare1().is_bound()) spare1().set_implicit_omit();
if (cBQ3().is_bound()) cBQ3().set_implicit_omit();
if (spare2().is_bound()) spare2().set_implicit_omit();
if (t3212().is_bound()) t3212().set_implicit_omit();
}

void ControlChannelDescription::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @BSSGP_Types.ControlChannelDescription has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cCCH__Conf().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bS__AG__BLKS__RES().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) aTT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mSCR().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bS__PA__MFRMS().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cBQ3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) t3212().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cCCH_Conf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cCCH__Conf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bS_AG_BLKS_RES")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bS__AG__BLKS__RES().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aTT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aTT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mSCR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSCR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bS_PA_MFRMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bS__PA__MFRMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "cBQ3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cBQ3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "t3212")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3212().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.ControlChannelDescription: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.ControlChannelDescription");
  }
}

void ControlChannelDescription::encode_text(Text_Buf& text_buf) const
{
field_cCCH__Conf.encode_text(text_buf);
field_bS__AG__BLKS__RES.encode_text(text_buf);
field_aTT.encode_text(text_buf);
field_mSCR.encode_text(text_buf);
field_bS__PA__MFRMS.encode_text(text_buf);
field_spare1.encode_text(text_buf);
field_cBQ3.encode_text(text_buf);
field_spare2.encode_text(text_buf);
field_t3212.encode_text(text_buf);
}

void ControlChannelDescription::decode_text(Text_Buf& text_buf)
{
field_cCCH__Conf.decode_text(text_buf);
field_bS__AG__BLKS__RES.decode_text(text_buf);
field_aTT.decode_text(text_buf);
field_mSCR.decode_text(text_buf);
field_bS__PA__MFRMS.decode_text(text_buf);
field_spare1.decode_text(text_buf);
field_cBQ3.decode_text(text_buf);
field_spare2.decode_text(text_buf);
field_t3212.decode_text(text_buf);
}

void ControlChannelDescription::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 ControlChannelDescription::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 ControlChannelDescription::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_cCCH__Conf.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_bS__AG__BLKS__RES.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_aTT.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_mSCR.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_bS__PA__MFRMS.RAW_decode(General__Types::BIT3_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare1.RAW_decode(General__Types::BIT2_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_cBQ3.RAW_decode(General__Types::BIT2_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, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_t3212.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ControlChannelDescription::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::OCT1_descr_.raw);
  encoded_length += field_cCCH__Conf.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_bS__AG__BLKS__RES.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_aTT.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mSCR.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_bS__PA__MFRMS.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare1.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_cBQ3.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_spare2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_t3212.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[8]);
  return myleaf.length = encoded_length;
}

struct ControlChannelDescription_template::single_value_struct {
BITSTRING_template field_cCCH__Conf;
BITSTRING_template field_bS__AG__BLKS__RES;
BITSTRING_template field_aTT;
BITSTRING_template field_mSCR;
BITSTRING_template field_bS__PA__MFRMS;
BITSTRING_template field_spare1;
BITSTRING_template field_cBQ3;
BITSTRING_template field_spare2;
OCTETSTRING_template field_t3212;
};

void ControlChannelDescription_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_cCCH__Conf = ANY_VALUE;
single_value->field_bS__AG__BLKS__RES = ANY_VALUE;
single_value->field_aTT = ANY_VALUE;
single_value->field_mSCR = ANY_VALUE;
single_value->field_bS__PA__MFRMS = ANY_VALUE;
single_value->field_spare1 = ANY_VALUE;
single_value->field_cBQ3 = ANY_VALUE;
single_value->field_spare2 = ANY_VALUE;
single_value->field_t3212 = ANY_VALUE;
}
}
}

void ControlChannelDescription_template::copy_value(const ControlChannelDescription& other_value)
{
single_value = new single_value_struct;
if (other_value.cCCH__Conf().is_bound()) {
  single_value->field_cCCH__Conf = other_value.cCCH__Conf();
} else {
  single_value->field_cCCH__Conf.clean_up();
}
if (other_value.bS__AG__BLKS__RES().is_bound()) {
  single_value->field_bS__AG__BLKS__RES = other_value.bS__AG__BLKS__RES();
} else {
  single_value->field_bS__AG__BLKS__RES.clean_up();
}
if (other_value.aTT().is_bound()) {
  single_value->field_aTT = other_value.aTT();
} else {
  single_value->field_aTT.clean_up();
}
if (other_value.mSCR().is_bound()) {
  single_value->field_mSCR = other_value.mSCR();
} else {
  single_value->field_mSCR.clean_up();
}
if (other_value.bS__PA__MFRMS().is_bound()) {
  single_value->field_bS__PA__MFRMS = other_value.bS__PA__MFRMS();
} else {
  single_value->field_bS__PA__MFRMS.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.cBQ3().is_bound()) {
  single_value->field_cBQ3 = other_value.cBQ3();
} else {
  single_value->field_cBQ3.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.t3212().is_bound()) {
  single_value->field_t3212 = other_value.t3212();
} else {
  single_value->field_t3212.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ControlChannelDescription_template::copy_template(const ControlChannelDescription_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cCCH__Conf().get_selection()) {
single_value->field_cCCH__Conf = other_value.cCCH__Conf();
} else {
single_value->field_cCCH__Conf.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bS__AG__BLKS__RES().get_selection()) {
single_value->field_bS__AG__BLKS__RES = other_value.bS__AG__BLKS__RES();
} else {
single_value->field_bS__AG__BLKS__RES.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aTT().get_selection()) {
single_value->field_aTT = other_value.aTT();
} else {
single_value->field_aTT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mSCR().get_selection()) {
single_value->field_mSCR = other_value.mSCR();
} else {
single_value->field_mSCR.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bS__PA__MFRMS().get_selection()) {
single_value->field_bS__PA__MFRMS = other_value.bS__PA__MFRMS();
} else {
single_value->field_bS__PA__MFRMS.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.cBQ3().get_selection()) {
single_value->field_cBQ3 = other_value.cBQ3();
} else {
single_value->field_cBQ3.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.t3212().get_selection()) {
single_value->field_t3212 = other_value.t3212();
} else {
single_value->field_t3212.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 ControlChannelDescription_template[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 ControlChannelDescription_template(*other_value.implication_.precondition);
implication_.implied_template = new ControlChannelDescription_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.ControlChannelDescription.");
break;
}
set_selection(other_value);
}

ControlChannelDescription_template::ControlChannelDescription_template()
{
}

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

ControlChannelDescription_template::ControlChannelDescription_template(const ControlChannelDescription& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ControlChannelDescription_template::match(const ControlChannelDescription& 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.cCCH__Conf().is_bound()) return FALSE;
if(!single_value->field_cCCH__Conf.match(other_value.cCCH__Conf(), legacy))return FALSE;
if(!other_value.bS__AG__BLKS__RES().is_bound()) return FALSE;
if(!single_value->field_bS__AG__BLKS__RES.match(other_value.bS__AG__BLKS__RES(), legacy))return FALSE;
if(!other_value.aTT().is_bound()) return FALSE;
if(!single_value->field_aTT.match(other_value.aTT(), legacy))return FALSE;
if(!other_value.mSCR().is_bound()) return FALSE;
if(!single_value->field_mSCR.match(other_value.mSCR(), legacy))return FALSE;
if(!other_value.bS__PA__MFRMS().is_bound()) return FALSE;
if(!single_value->field_bS__PA__MFRMS.match(other_value.bS__PA__MFRMS(), 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.cBQ3().is_bound()) return FALSE;
if(!single_value->field_cBQ3.match(other_value.cBQ3(), 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.t3212().is_bound()) return FALSE;
if(!single_value->field_t3212.match(other_value.t3212(), 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.ControlChannelDescription.");
}
return FALSE;
}

boolean ControlChannelDescription_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cCCH__Conf.is_bound()
 || single_value->field_bS__AG__BLKS__RES.is_bound()
 || single_value->field_aTT.is_bound()
 || single_value->field_mSCR.is_bound()
 || single_value->field_bS__PA__MFRMS.is_bound()
 || single_value->field_spare1.is_bound()
 || single_value->field_cBQ3.is_bound()
 || single_value->field_spare2.is_bound()
 || single_value->field_t3212.is_bound();
}

boolean ControlChannelDescription_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cCCH__Conf.is_value()
 && single_value->field_bS__AG__BLKS__RES.is_value()
 && single_value->field_aTT.is_value()
 && single_value->field_mSCR.is_value()
 && single_value->field_bS__PA__MFRMS.is_value()
 && single_value->field_spare1.is_value()
 && single_value->field_cBQ3.is_value()
 && single_value->field_spare2.is_value()
 && single_value->field_t3212.is_value();
}

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

ControlChannelDescription ControlChannelDescription_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.ControlChannelDescription.");
ControlChannelDescription ret_val;
if (single_value->field_cCCH__Conf.is_bound()) {
ret_val.cCCH__Conf() = single_value->field_cCCH__Conf.valueof();
}
if (single_value->field_bS__AG__BLKS__RES.is_bound()) {
ret_val.bS__AG__BLKS__RES() = single_value->field_bS__AG__BLKS__RES.valueof();
}
if (single_value->field_aTT.is_bound()) {
ret_val.aTT() = single_value->field_aTT.valueof();
}
if (single_value->field_mSCR.is_bound()) {
ret_val.mSCR() = single_value->field_mSCR.valueof();
}
if (single_value->field_bS__PA__MFRMS.is_bound()) {
ret_val.bS__PA__MFRMS() = single_value->field_bS__PA__MFRMS.valueof();
}
if (single_value->field_spare1.is_bound()) {
ret_val.spare1() = single_value->field_spare1.valueof();
}
if (single_value->field_cBQ3.is_bound()) {
ret_val.cBQ3() = single_value->field_cBQ3.valueof();
}
if (single_value->field_spare2.is_bound()) {
ret_val.spare2() = single_value->field_spare2.valueof();
}
if (single_value->field_t3212.is_bound()) {
ret_val.t3212() = single_value->field_t3212.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& ControlChannelDescription_template::cCCH__Conf()
{
set_specific();
return single_value->field_cCCH__Conf;
}

const BITSTRING_template& ControlChannelDescription_template::cCCH__Conf() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cCCH_Conf of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_cCCH__Conf;
}

BITSTRING_template& ControlChannelDescription_template::bS__AG__BLKS__RES()
{
set_specific();
return single_value->field_bS__AG__BLKS__RES;
}

const BITSTRING_template& ControlChannelDescription_template::bS__AG__BLKS__RES() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bS_AG_BLKS_RES of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_bS__AG__BLKS__RES;
}

BITSTRING_template& ControlChannelDescription_template::aTT()
{
set_specific();
return single_value->field_aTT;
}

const BITSTRING_template& ControlChannelDescription_template::aTT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aTT of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_aTT;
}

BITSTRING_template& ControlChannelDescription_template::mSCR()
{
set_specific();
return single_value->field_mSCR;
}

const BITSTRING_template& ControlChannelDescription_template::mSCR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mSCR of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_mSCR;
}

BITSTRING_template& ControlChannelDescription_template::bS__PA__MFRMS()
{
set_specific();
return single_value->field_bS__PA__MFRMS;
}

const BITSTRING_template& ControlChannelDescription_template::bS__PA__MFRMS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bS_PA_MFRMS of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_bS__PA__MFRMS;
}

BITSTRING_template& ControlChannelDescription_template::spare1()
{
set_specific();
return single_value->field_spare1;
}

const BITSTRING_template& ControlChannelDescription_template::spare1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare1 of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_spare1;
}

BITSTRING_template& ControlChannelDescription_template::cBQ3()
{
set_specific();
return single_value->field_cBQ3;
}

const BITSTRING_template& ControlChannelDescription_template::cBQ3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cBQ3 of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_cBQ3;
}

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

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

OCTETSTRING_template& ControlChannelDescription_template::t3212()
{
set_specific();
return single_value->field_t3212;
}

const OCTETSTRING_template& ControlChannelDescription_template::t3212() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3212 of a non-specific template of type @BSSGP_Types.ControlChannelDescription.");
return single_value->field_t3212;
}

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

void ControlChannelDescription_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cCCH_Conf := ");
single_value->field_cCCH__Conf.log();
TTCN_Logger::log_event_str(", bS_AG_BLKS_RES := ");
single_value->field_bS__AG__BLKS__RES.log();
TTCN_Logger::log_event_str(", aTT := ");
single_value->field_aTT.log();
TTCN_Logger::log_event_str(", mSCR := ");
single_value->field_mSCR.log();
TTCN_Logger::log_event_str(", bS_PA_MFRMS := ");
single_value->field_bS__PA__MFRMS.log();
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log();
TTCN_Logger::log_event_str(", cBQ3 := ");
single_value->field_cBQ3.log();
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log();
TTCN_Logger::log_event_str(", t3212 := ");
single_value->field_t3212.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 ControlChannelDescription_template::log_match(const ControlChannelDescription& 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_cCCH__Conf.match(match_value.cCCH__Conf(), legacy)){
TTCN_Logger::log_logmatch_info(".cCCH_Conf");
single_value->field_cCCH__Conf.log_match(match_value.cCCH__Conf(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bS__AG__BLKS__RES.match(match_value.bS__AG__BLKS__RES(), legacy)){
TTCN_Logger::log_logmatch_info(".bS_AG_BLKS_RES");
single_value->field_bS__AG__BLKS__RES.log_match(match_value.bS__AG__BLKS__RES(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aTT.match(match_value.aTT(), legacy)){
TTCN_Logger::log_logmatch_info(".aTT");
single_value->field_aTT.log_match(match_value.aTT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mSCR.match(match_value.mSCR(), legacy)){
TTCN_Logger::log_logmatch_info(".mSCR");
single_value->field_mSCR.log_match(match_value.mSCR(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bS__PA__MFRMS.match(match_value.bS__PA__MFRMS(), legacy)){
TTCN_Logger::log_logmatch_info(".bS_PA_MFRMS");
single_value->field_bS__PA__MFRMS.log_match(match_value.bS__PA__MFRMS(), 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_cBQ3.match(match_value.cBQ3(), legacy)){
TTCN_Logger::log_logmatch_info(".cBQ3");
single_value->field_cBQ3.log_match(match_value.cBQ3(), 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_t3212.match(match_value.t3212(), legacy)){
TTCN_Logger::log_logmatch_info(".t3212");
single_value->field_t3212.log_match(match_value.t3212(), 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("{ cCCH_Conf := ");
single_value->field_cCCH__Conf.log_match(match_value.cCCH__Conf(), legacy);
TTCN_Logger::log_event_str(", bS_AG_BLKS_RES := ");
single_value->field_bS__AG__BLKS__RES.log_match(match_value.bS__AG__BLKS__RES(), legacy);
TTCN_Logger::log_event_str(", aTT := ");
single_value->field_aTT.log_match(match_value.aTT(), legacy);
TTCN_Logger::log_event_str(", mSCR := ");
single_value->field_mSCR.log_match(match_value.mSCR(), legacy);
TTCN_Logger::log_event_str(", bS_PA_MFRMS := ");
single_value->field_bS__PA__MFRMS.log_match(match_value.bS__PA__MFRMS(), legacy);
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log_match(match_value.spare1(), legacy);
TTCN_Logger::log_event_str(", cBQ3 := ");
single_value->field_cBQ3.log_match(match_value.cBQ3(), legacy);
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::log_event_str(", t3212 := ");
single_value->field_t3212.log_match(match_value.t3212(), 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 ControlChannelDescription_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cCCH__Conf.encode_text(text_buf);
single_value->field_bS__AG__BLKS__RES.encode_text(text_buf);
single_value->field_aTT.encode_text(text_buf);
single_value->field_mSCR.encode_text(text_buf);
single_value->field_bS__PA__MFRMS.encode_text(text_buf);
single_value->field_spare1.encode_text(text_buf);
single_value->field_cBQ3.encode_text(text_buf);
single_value->field_spare2.encode_text(text_buf);
single_value->field_t3212.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.ControlChannelDescription.");
}
}

void ControlChannelDescription_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_cCCH__Conf.decode_text(text_buf);
single_value->field_bS__AG__BLKS__RES.decode_text(text_buf);
single_value->field_aTT.decode_text(text_buf);
single_value->field_mSCR.decode_text(text_buf);
single_value->field_bS__PA__MFRMS.decode_text(text_buf);
single_value->field_spare1.decode_text(text_buf);
single_value->field_cBQ3.decode_text(text_buf);
single_value->field_spare2.decode_text(text_buf);
single_value->field_t3212.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 ControlChannelDescription_template[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.ControlChannelDescription.");
}
}

void ControlChannelDescription_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: {
    ControlChannelDescription_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @BSSGP_Types.ControlChannelDescription has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cCCH__Conf().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bS__AG__BLKS__RES().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) aTT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mSCR().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bS__PA__MFRMS().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cBQ3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) t3212().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cCCH_Conf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cCCH__Conf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bS_AG_BLKS_RES")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bS__AG__BLKS__RES().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aTT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aTT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mSCR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSCR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bS_PA_MFRMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bS__PA__MFRMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "cBQ3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cBQ3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "t3212")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3212().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.ControlChannelDescription: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ControlChannelDescription_template* precondition = new ControlChannelDescription_template;
    precondition->set_param(*param.get_elem(0));
    ControlChannelDescription_template* implied_template = new ControlChannelDescription_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ControlChannelDescription_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.ControlChannelDescription");
  }
  is_ifpresent = param.get_ifpresent();
}

void ControlChannelDescription_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_cCCH__Conf.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_bS__AG__BLKS__RES.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_aTT.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_mSCR.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_bS__PA__MFRMS.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_spare1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_cBQ3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_spare2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
single_value->field_t3212.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ControlChannelDescription");
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.ControlChannelDescription");
}

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

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

CellOptions::CellOptions()
{
}

CellOptions::CellOptions(const BITSTRING& par_radioLinkTimeout,
    const BITSTRING& par_dTX1,
    const BITSTRING& par_pWRC,
    const BITSTRING& par_dtx2)
  :   field_radioLinkTimeout(par_radioLinkTimeout),
  field_dTX1(par_dTX1),
  field_pWRC(par_pWRC),
  field_dtx2(par_dtx2)
{
}

CellOptions::CellOptions(const CellOptions& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.CellOptions.");
if (other_value.radioLinkTimeout().is_bound()) field_radioLinkTimeout = other_value.radioLinkTimeout();
else field_radioLinkTimeout.clean_up();
if (other_value.dTX1().is_bound()) field_dTX1 = other_value.dTX1();
else field_dTX1.clean_up();
if (other_value.pWRC().is_bound()) field_pWRC = other_value.pWRC();
else field_pWRC.clean_up();
if (other_value.dtx2().is_bound()) field_dtx2 = other_value.dtx2();
else field_dtx2.clean_up();
}

void CellOptions::clean_up()
{
field_radioLinkTimeout.clean_up();
field_dTX1.clean_up();
field_pWRC.clean_up();
field_dtx2.clean_up();
}

const TTCN_Typedescriptor_t* CellOptions::get_descriptor() const { return &CellOptions_descr_; }
CellOptions& CellOptions::operator=(const CellOptions& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.CellOptions.");
  if (other_value.radioLinkTimeout().is_bound()) field_radioLinkTimeout = other_value.radioLinkTimeout();
  else field_radioLinkTimeout.clean_up();
  if (other_value.dTX1().is_bound()) field_dTX1 = other_value.dTX1();
  else field_dTX1.clean_up();
  if (other_value.pWRC().is_bound()) field_pWRC = other_value.pWRC();
  else field_pWRC.clean_up();
  if (other_value.dtx2().is_bound()) field_dtx2 = other_value.dtx2();
  else field_dtx2.clean_up();
}
return *this;
}

boolean CellOptions::operator==(const CellOptions& other_value) const
{
return field_radioLinkTimeout==other_value.field_radioLinkTimeout
  && field_dTX1==other_value.field_dTX1
  && field_pWRC==other_value.field_pWRC
  && field_dtx2==other_value.field_dtx2;
}

boolean CellOptions::is_bound() const
{
return (field_radioLinkTimeout.is_bound())
  || (field_dTX1.is_bound())
  || (field_pWRC.is_bound())
  || (field_dtx2.is_bound());
}
boolean CellOptions::is_value() const
{
return field_radioLinkTimeout.is_value()
  && field_dTX1.is_value()
  && field_pWRC.is_value()
  && field_dtx2.is_value();
}
void CellOptions::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ radioLinkTimeout := ");
field_radioLinkTimeout.log();
TTCN_Logger::log_event_str(", dTX1 := ");
field_dTX1.log();
TTCN_Logger::log_event_str(", pWRC := ");
field_pWRC.log();
TTCN_Logger::log_event_str(", dtx2 := ");
field_dtx2.log();
TTCN_Logger::log_event_str(" }");
}

void CellOptions::set_implicit_omit()
{
if (radioLinkTimeout().is_bound()) radioLinkTimeout().set_implicit_omit();
if (dTX1().is_bound()) dTX1().set_implicit_omit();
if (pWRC().is_bound()) pWRC().set_implicit_omit();
if (dtx2().is_bound()) dtx2().set_implicit_omit();
}

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

void CellOptions::encode_text(Text_Buf& text_buf) const
{
field_radioLinkTimeout.encode_text(text_buf);
field_dTX1.encode_text(text_buf);
field_pWRC.encode_text(text_buf);
field_dtx2.encode_text(text_buf);
}

void CellOptions::decode_text(Text_Buf& text_buf)
{
field_radioLinkTimeout.decode_text(text_buf);
field_dTX1.decode_text(text_buf);
field_pWRC.decode_text(text_buf);
field_dtx2.decode_text(text_buf);
}

void CellOptions::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 CellOptions::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 CellOptions::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_radioLinkTimeout.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_dTX1.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_pWRC.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_dtx2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct CellOptions_template::single_value_struct {
BITSTRING_template field_radioLinkTimeout;
BITSTRING_template field_dTX1;
BITSTRING_template field_pWRC;
BITSTRING_template field_dtx2;
};

void CellOptions_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_radioLinkTimeout = ANY_VALUE;
single_value->field_dTX1 = ANY_VALUE;
single_value->field_pWRC = ANY_VALUE;
single_value->field_dtx2 = ANY_VALUE;
}
}
}

void CellOptions_template::copy_value(const CellOptions& other_value)
{
single_value = new single_value_struct;
if (other_value.radioLinkTimeout().is_bound()) {
  single_value->field_radioLinkTimeout = other_value.radioLinkTimeout();
} else {
  single_value->field_radioLinkTimeout.clean_up();
}
if (other_value.dTX1().is_bound()) {
  single_value->field_dTX1 = other_value.dTX1();
} else {
  single_value->field_dTX1.clean_up();
}
if (other_value.pWRC().is_bound()) {
  single_value->field_pWRC = other_value.pWRC();
} else {
  single_value->field_pWRC.clean_up();
}
if (other_value.dtx2().is_bound()) {
  single_value->field_dtx2 = other_value.dtx2();
} else {
  single_value->field_dtx2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CellOptions_template::copy_template(const CellOptions_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.radioLinkTimeout().get_selection()) {
single_value->field_radioLinkTimeout = other_value.radioLinkTimeout();
} else {
single_value->field_radioLinkTimeout.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTX1().get_selection()) {
single_value->field_dTX1 = other_value.dTX1();
} else {
single_value->field_dTX1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pWRC().get_selection()) {
single_value->field_pWRC = other_value.pWRC();
} else {
single_value->field_pWRC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dtx2().get_selection()) {
single_value->field_dtx2 = other_value.dtx2();
} else {
single_value->field_dtx2.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 CellOptions_template[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 CellOptions_template(*other_value.implication_.precondition);
implication_.implied_template = new CellOptions_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.CellOptions.");
break;
}
set_selection(other_value);
}

CellOptions_template::CellOptions_template()
{
}

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

CellOptions_template::CellOptions_template(const CellOptions& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CellOptions_template::match(const CellOptions& 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.radioLinkTimeout().is_bound()) return FALSE;
if(!single_value->field_radioLinkTimeout.match(other_value.radioLinkTimeout(), legacy))return FALSE;
if(!other_value.dTX1().is_bound()) return FALSE;
if(!single_value->field_dTX1.match(other_value.dTX1(), legacy))return FALSE;
if(!other_value.pWRC().is_bound()) return FALSE;
if(!single_value->field_pWRC.match(other_value.pWRC(), legacy))return FALSE;
if(!other_value.dtx2().is_bound()) return FALSE;
if(!single_value->field_dtx2.match(other_value.dtx2(), 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.CellOptions.");
}
return FALSE;
}

boolean CellOptions_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_radioLinkTimeout.is_bound()
 || single_value->field_dTX1.is_bound()
 || single_value->field_pWRC.is_bound()
 || single_value->field_dtx2.is_bound();
}

boolean CellOptions_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_radioLinkTimeout.is_value()
 && single_value->field_dTX1.is_value()
 && single_value->field_pWRC.is_value()
 && single_value->field_dtx2.is_value();
}

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

CellOptions CellOptions_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.CellOptions.");
CellOptions ret_val;
if (single_value->field_radioLinkTimeout.is_bound()) {
ret_val.radioLinkTimeout() = single_value->field_radioLinkTimeout.valueof();
}
if (single_value->field_dTX1.is_bound()) {
ret_val.dTX1() = single_value->field_dTX1.valueof();
}
if (single_value->field_pWRC.is_bound()) {
ret_val.pWRC() = single_value->field_pWRC.valueof();
}
if (single_value->field_dtx2.is_bound()) {
ret_val.dtx2() = single_value->field_dtx2.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& CellOptions_template::radioLinkTimeout()
{
set_specific();
return single_value->field_radioLinkTimeout;
}

const BITSTRING_template& CellOptions_template::radioLinkTimeout() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioLinkTimeout of a non-specific template of type @BSSGP_Types.CellOptions.");
return single_value->field_radioLinkTimeout;
}

BITSTRING_template& CellOptions_template::dTX1()
{
set_specific();
return single_value->field_dTX1;
}

const BITSTRING_template& CellOptions_template::dTX1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTX1 of a non-specific template of type @BSSGP_Types.CellOptions.");
return single_value->field_dTX1;
}

BITSTRING_template& CellOptions_template::pWRC()
{
set_specific();
return single_value->field_pWRC;
}

const BITSTRING_template& CellOptions_template::pWRC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pWRC of a non-specific template of type @BSSGP_Types.CellOptions.");
return single_value->field_pWRC;
}

BITSTRING_template& CellOptions_template::dtx2()
{
set_specific();
return single_value->field_dtx2;
}

const BITSTRING_template& CellOptions_template::dtx2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx2 of a non-specific template of type @BSSGP_Types.CellOptions.");
return single_value->field_dtx2;
}

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

void CellOptions_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ radioLinkTimeout := ");
single_value->field_radioLinkTimeout.log();
TTCN_Logger::log_event_str(", dTX1 := ");
single_value->field_dTX1.log();
TTCN_Logger::log_event_str(", pWRC := ");
single_value->field_pWRC.log();
TTCN_Logger::log_event_str(", dtx2 := ");
single_value->field_dtx2.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 CellOptions_template::log_match(const CellOptions& 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_radioLinkTimeout.match(match_value.radioLinkTimeout(), legacy)){
TTCN_Logger::log_logmatch_info(".radioLinkTimeout");
single_value->field_radioLinkTimeout.log_match(match_value.radioLinkTimeout(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dTX1.match(match_value.dTX1(), legacy)){
TTCN_Logger::log_logmatch_info(".dTX1");
single_value->field_dTX1.log_match(match_value.dTX1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pWRC.match(match_value.pWRC(), legacy)){
TTCN_Logger::log_logmatch_info(".pWRC");
single_value->field_pWRC.log_match(match_value.pWRC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dtx2.match(match_value.dtx2(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx2");
single_value->field_dtx2.log_match(match_value.dtx2(), 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("{ radioLinkTimeout := ");
single_value->field_radioLinkTimeout.log_match(match_value.radioLinkTimeout(), legacy);
TTCN_Logger::log_event_str(", dTX1 := ");
single_value->field_dTX1.log_match(match_value.dTX1(), legacy);
TTCN_Logger::log_event_str(", pWRC := ");
single_value->field_pWRC.log_match(match_value.pWRC(), legacy);
TTCN_Logger::log_event_str(", dtx2 := ");
single_value->field_dtx2.log_match(match_value.dtx2(), 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 CellOptions_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_radioLinkTimeout.encode_text(text_buf);
single_value->field_dTX1.encode_text(text_buf);
single_value->field_pWRC.encode_text(text_buf);
single_value->field_dtx2.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.CellOptions.");
}
}

void CellOptions_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_radioLinkTimeout.decode_text(text_buf);
single_value->field_dTX1.decode_text(text_buf);
single_value->field_pWRC.decode_text(text_buf);
single_value->field_dtx2.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 CellOptions_template[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.CellOptions.");
}
}

void CellOptions_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: {
    CellOptions_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.CellOptions 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) radioLinkTimeout().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dTX1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pWRC().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dtx2().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(), "radioLinkTimeout")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioLinkTimeout().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTX1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTX1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pWRC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pWRC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dtx2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.CellOptions: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CellOptions_template* precondition = new CellOptions_template;
    precondition->set_param(*param.get_elem(0));
    CellOptions_template* implied_template = new CellOptions_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CellOptions_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.CellOptions");
  }
  is_ifpresent = param.get_ifpresent();
}

void CellOptions_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_radioLinkTimeout.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellOptions");
single_value->field_dTX1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellOptions");
single_value->field_pWRC.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellOptions");
single_value->field_dtx2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellOptions");
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.CellOptions");
}

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

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

CellSelectionParameters::CellSelectionParameters()
{
}

CellSelectionParameters::CellSelectionParameters(const BITSTRING& par_mS__TXPWR__MAX__CCH,
    const BITSTRING& par_cellReselectHysterisis,
    const BITSTRING& par_rXLEV__Access__Min,
    const BITSTRING& par_nECI,
    const BITSTRING& par_aCS)
  :   field_mS__TXPWR__MAX__CCH(par_mS__TXPWR__MAX__CCH),
  field_cellReselectHysterisis(par_cellReselectHysterisis),
  field_rXLEV__Access__Min(par_rXLEV__Access__Min),
  field_nECI(par_nECI),
  field_aCS(par_aCS)
{
}

CellSelectionParameters::CellSelectionParameters(const CellSelectionParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.CellSelectionParameters.");
if (other_value.mS__TXPWR__MAX__CCH().is_bound()) field_mS__TXPWR__MAX__CCH = other_value.mS__TXPWR__MAX__CCH();
else field_mS__TXPWR__MAX__CCH.clean_up();
if (other_value.cellReselectHysterisis().is_bound()) field_cellReselectHysterisis = other_value.cellReselectHysterisis();
else field_cellReselectHysterisis.clean_up();
if (other_value.rXLEV__Access__Min().is_bound()) field_rXLEV__Access__Min = other_value.rXLEV__Access__Min();
else field_rXLEV__Access__Min.clean_up();
if (other_value.nECI().is_bound()) field_nECI = other_value.nECI();
else field_nECI.clean_up();
if (other_value.aCS().is_bound()) field_aCS = other_value.aCS();
else field_aCS.clean_up();
}

void CellSelectionParameters::clean_up()
{
field_mS__TXPWR__MAX__CCH.clean_up();
field_cellReselectHysterisis.clean_up();
field_rXLEV__Access__Min.clean_up();
field_nECI.clean_up();
field_aCS.clean_up();
}

const TTCN_Typedescriptor_t* CellSelectionParameters::get_descriptor() const { return &CellSelectionParameters_descr_; }
CellSelectionParameters& CellSelectionParameters::operator=(const CellSelectionParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.CellSelectionParameters.");
  if (other_value.mS__TXPWR__MAX__CCH().is_bound()) field_mS__TXPWR__MAX__CCH = other_value.mS__TXPWR__MAX__CCH();
  else field_mS__TXPWR__MAX__CCH.clean_up();
  if (other_value.cellReselectHysterisis().is_bound()) field_cellReselectHysterisis = other_value.cellReselectHysterisis();
  else field_cellReselectHysterisis.clean_up();
  if (other_value.rXLEV__Access__Min().is_bound()) field_rXLEV__Access__Min = other_value.rXLEV__Access__Min();
  else field_rXLEV__Access__Min.clean_up();
  if (other_value.nECI().is_bound()) field_nECI = other_value.nECI();
  else field_nECI.clean_up();
  if (other_value.aCS().is_bound()) field_aCS = other_value.aCS();
  else field_aCS.clean_up();
}
return *this;
}

boolean CellSelectionParameters::operator==(const CellSelectionParameters& other_value) const
{
return field_mS__TXPWR__MAX__CCH==other_value.field_mS__TXPWR__MAX__CCH
  && field_cellReselectHysterisis==other_value.field_cellReselectHysterisis
  && field_rXLEV__Access__Min==other_value.field_rXLEV__Access__Min
  && field_nECI==other_value.field_nECI
  && field_aCS==other_value.field_aCS;
}

boolean CellSelectionParameters::is_bound() const
{
return (field_mS__TXPWR__MAX__CCH.is_bound())
  || (field_cellReselectHysterisis.is_bound())
  || (field_rXLEV__Access__Min.is_bound())
  || (field_nECI.is_bound())
  || (field_aCS.is_bound());
}
boolean CellSelectionParameters::is_value() const
{
return field_mS__TXPWR__MAX__CCH.is_value()
  && field_cellReselectHysterisis.is_value()
  && field_rXLEV__Access__Min.is_value()
  && field_nECI.is_value()
  && field_aCS.is_value();
}
void CellSelectionParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ mS_TXPWR_MAX_CCH := ");
field_mS__TXPWR__MAX__CCH.log();
TTCN_Logger::log_event_str(", cellReselectHysterisis := ");
field_cellReselectHysterisis.log();
TTCN_Logger::log_event_str(", rXLEV_Access_Min := ");
field_rXLEV__Access__Min.log();
TTCN_Logger::log_event_str(", nECI := ");
field_nECI.log();
TTCN_Logger::log_event_str(", aCS := ");
field_aCS.log();
TTCN_Logger::log_event_str(" }");
}

void CellSelectionParameters::set_implicit_omit()
{
if (mS__TXPWR__MAX__CCH().is_bound()) mS__TXPWR__MAX__CCH().set_implicit_omit();
if (cellReselectHysterisis().is_bound()) cellReselectHysterisis().set_implicit_omit();
if (rXLEV__Access__Min().is_bound()) rXLEV__Access__Min().set_implicit_omit();
if (nECI().is_bound()) nECI().set_implicit_omit();
if (aCS().is_bound()) aCS().set_implicit_omit();
}

void CellSelectionParameters::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.CellSelectionParameters 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) mS__TXPWR__MAX__CCH().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellReselectHysterisis().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rXLEV__Access__Min().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) nECI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) aCS().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(), "mS_TXPWR_MAX_CCH")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__TXPWR__MAX__CCH().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellReselectHysterisis")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellReselectHysterisis().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rXLEV_Access_Min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rXLEV__Access__Min().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nECI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nECI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.CellSelectionParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.CellSelectionParameters");
  }
}

void CellSelectionParameters::encode_text(Text_Buf& text_buf) const
{
field_mS__TXPWR__MAX__CCH.encode_text(text_buf);
field_cellReselectHysterisis.encode_text(text_buf);
field_rXLEV__Access__Min.encode_text(text_buf);
field_nECI.encode_text(text_buf);
field_aCS.encode_text(text_buf);
}

void CellSelectionParameters::decode_text(Text_Buf& text_buf)
{
field_mS__TXPWR__MAX__CCH.decode_text(text_buf);
field_cellReselectHysterisis.decode_text(text_buf);
field_rXLEV__Access__Min.decode_text(text_buf);
field_nECI.decode_text(text_buf);
field_aCS.decode_text(text_buf);
}

void CellSelectionParameters::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 CellSelectionParameters::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 CellSelectionParameters::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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_mS__TXPWR__MAX__CCH.RAW_decode(General__Types::BIT5_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_cellReselectHysterisis.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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_rXLEV__Access__Min.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_nECI.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_aCS.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CellSelectionParameters::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::BIT5_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::BIT6_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);
  encoded_length += field_mS__TXPWR__MAX__CCH.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cellReselectHysterisis.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rXLEV__Access__Min.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_nECI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_aCS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct CellSelectionParameters_template::single_value_struct {
BITSTRING_template field_mS__TXPWR__MAX__CCH;
BITSTRING_template field_cellReselectHysterisis;
BITSTRING_template field_rXLEV__Access__Min;
BITSTRING_template field_nECI;
BITSTRING_template field_aCS;
};

void CellSelectionParameters_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__TXPWR__MAX__CCH = ANY_VALUE;
single_value->field_cellReselectHysterisis = ANY_VALUE;
single_value->field_rXLEV__Access__Min = ANY_VALUE;
single_value->field_nECI = ANY_VALUE;
single_value->field_aCS = ANY_VALUE;
}
}
}

void CellSelectionParameters_template::copy_value(const CellSelectionParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.mS__TXPWR__MAX__CCH().is_bound()) {
  single_value->field_mS__TXPWR__MAX__CCH = other_value.mS__TXPWR__MAX__CCH();
} else {
  single_value->field_mS__TXPWR__MAX__CCH.clean_up();
}
if (other_value.cellReselectHysterisis().is_bound()) {
  single_value->field_cellReselectHysterisis = other_value.cellReselectHysterisis();
} else {
  single_value->field_cellReselectHysterisis.clean_up();
}
if (other_value.rXLEV__Access__Min().is_bound()) {
  single_value->field_rXLEV__Access__Min = other_value.rXLEV__Access__Min();
} else {
  single_value->field_rXLEV__Access__Min.clean_up();
}
if (other_value.nECI().is_bound()) {
  single_value->field_nECI = other_value.nECI();
} else {
  single_value->field_nECI.clean_up();
}
if (other_value.aCS().is_bound()) {
  single_value->field_aCS = other_value.aCS();
} else {
  single_value->field_aCS.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CellSelectionParameters_template::copy_template(const CellSelectionParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.mS__TXPWR__MAX__CCH().get_selection()) {
single_value->field_mS__TXPWR__MAX__CCH = other_value.mS__TXPWR__MAX__CCH();
} else {
single_value->field_mS__TXPWR__MAX__CCH.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellReselectHysterisis().get_selection()) {
single_value->field_cellReselectHysterisis = other_value.cellReselectHysterisis();
} else {
single_value->field_cellReselectHysterisis.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rXLEV__Access__Min().get_selection()) {
single_value->field_rXLEV__Access__Min = other_value.rXLEV__Access__Min();
} else {
single_value->field_rXLEV__Access__Min.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nECI().get_selection()) {
single_value->field_nECI = other_value.nECI();
} else {
single_value->field_nECI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aCS().get_selection()) {
single_value->field_aCS = other_value.aCS();
} else {
single_value->field_aCS.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 CellSelectionParameters_template[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 CellSelectionParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new CellSelectionParameters_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.CellSelectionParameters.");
break;
}
set_selection(other_value);
}

CellSelectionParameters_template::CellSelectionParameters_template()
{
}

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

CellSelectionParameters_template::CellSelectionParameters_template(const CellSelectionParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CellSelectionParameters_template::match(const CellSelectionParameters& 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__TXPWR__MAX__CCH().is_bound()) return FALSE;
if(!single_value->field_mS__TXPWR__MAX__CCH.match(other_value.mS__TXPWR__MAX__CCH(), legacy))return FALSE;
if(!other_value.cellReselectHysterisis().is_bound()) return FALSE;
if(!single_value->field_cellReselectHysterisis.match(other_value.cellReselectHysterisis(), legacy))return FALSE;
if(!other_value.rXLEV__Access__Min().is_bound()) return FALSE;
if(!single_value->field_rXLEV__Access__Min.match(other_value.rXLEV__Access__Min(), legacy))return FALSE;
if(!other_value.nECI().is_bound()) return FALSE;
if(!single_value->field_nECI.match(other_value.nECI(), legacy))return FALSE;
if(!other_value.aCS().is_bound()) return FALSE;
if(!single_value->field_aCS.match(other_value.aCS(), 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.CellSelectionParameters.");
}
return FALSE;
}

boolean CellSelectionParameters_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__TXPWR__MAX__CCH.is_bound()
 || single_value->field_cellReselectHysterisis.is_bound()
 || single_value->field_rXLEV__Access__Min.is_bound()
 || single_value->field_nECI.is_bound()
 || single_value->field_aCS.is_bound();
}

boolean CellSelectionParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_mS__TXPWR__MAX__CCH.is_value()
 && single_value->field_cellReselectHysterisis.is_value()
 && single_value->field_rXLEV__Access__Min.is_value()
 && single_value->field_nECI.is_value()
 && single_value->field_aCS.is_value();
}

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

CellSelectionParameters CellSelectionParameters_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.CellSelectionParameters.");
CellSelectionParameters ret_val;
if (single_value->field_mS__TXPWR__MAX__CCH.is_bound()) {
ret_val.mS__TXPWR__MAX__CCH() = single_value->field_mS__TXPWR__MAX__CCH.valueof();
}
if (single_value->field_cellReselectHysterisis.is_bound()) {
ret_val.cellReselectHysterisis() = single_value->field_cellReselectHysterisis.valueof();
}
if (single_value->field_rXLEV__Access__Min.is_bound()) {
ret_val.rXLEV__Access__Min() = single_value->field_rXLEV__Access__Min.valueof();
}
if (single_value->field_nECI.is_bound()) {
ret_val.nECI() = single_value->field_nECI.valueof();
}
if (single_value->field_aCS.is_bound()) {
ret_val.aCS() = single_value->field_aCS.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& CellSelectionParameters_template::mS__TXPWR__MAX__CCH()
{
set_specific();
return single_value->field_mS__TXPWR__MAX__CCH;
}

const BITSTRING_template& CellSelectionParameters_template::mS__TXPWR__MAX__CCH() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_TXPWR_MAX_CCH of a non-specific template of type @BSSGP_Types.CellSelectionParameters.");
return single_value->field_mS__TXPWR__MAX__CCH;
}

BITSTRING_template& CellSelectionParameters_template::cellReselectHysterisis()
{
set_specific();
return single_value->field_cellReselectHysterisis;
}

const BITSTRING_template& CellSelectionParameters_template::cellReselectHysterisis() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellReselectHysterisis of a non-specific template of type @BSSGP_Types.CellSelectionParameters.");
return single_value->field_cellReselectHysterisis;
}

BITSTRING_template& CellSelectionParameters_template::rXLEV__Access__Min()
{
set_specific();
return single_value->field_rXLEV__Access__Min;
}

const BITSTRING_template& CellSelectionParameters_template::rXLEV__Access__Min() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rXLEV_Access_Min of a non-specific template of type @BSSGP_Types.CellSelectionParameters.");
return single_value->field_rXLEV__Access__Min;
}

BITSTRING_template& CellSelectionParameters_template::nECI()
{
set_specific();
return single_value->field_nECI;
}

const BITSTRING_template& CellSelectionParameters_template::nECI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nECI of a non-specific template of type @BSSGP_Types.CellSelectionParameters.");
return single_value->field_nECI;
}

BITSTRING_template& CellSelectionParameters_template::aCS()
{
set_specific();
return single_value->field_aCS;
}

const BITSTRING_template& CellSelectionParameters_template::aCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aCS of a non-specific template of type @BSSGP_Types.CellSelectionParameters.");
return single_value->field_aCS;
}

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

void CellSelectionParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ mS_TXPWR_MAX_CCH := ");
single_value->field_mS__TXPWR__MAX__CCH.log();
TTCN_Logger::log_event_str(", cellReselectHysterisis := ");
single_value->field_cellReselectHysterisis.log();
TTCN_Logger::log_event_str(", rXLEV_Access_Min := ");
single_value->field_rXLEV__Access__Min.log();
TTCN_Logger::log_event_str(", nECI := ");
single_value->field_nECI.log();
TTCN_Logger::log_event_str(", aCS := ");
single_value->field_aCS.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 CellSelectionParameters_template::log_match(const CellSelectionParameters& 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__TXPWR__MAX__CCH.match(match_value.mS__TXPWR__MAX__CCH(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_TXPWR_MAX_CCH");
single_value->field_mS__TXPWR__MAX__CCH.log_match(match_value.mS__TXPWR__MAX__CCH(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cellReselectHysterisis.match(match_value.cellReselectHysterisis(), legacy)){
TTCN_Logger::log_logmatch_info(".cellReselectHysterisis");
single_value->field_cellReselectHysterisis.log_match(match_value.cellReselectHysterisis(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rXLEV__Access__Min.match(match_value.rXLEV__Access__Min(), legacy)){
TTCN_Logger::log_logmatch_info(".rXLEV_Access_Min");
single_value->field_rXLEV__Access__Min.log_match(match_value.rXLEV__Access__Min(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nECI.match(match_value.nECI(), legacy)){
TTCN_Logger::log_logmatch_info(".nECI");
single_value->field_nECI.log_match(match_value.nECI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aCS.match(match_value.aCS(), legacy)){
TTCN_Logger::log_logmatch_info(".aCS");
single_value->field_aCS.log_match(match_value.aCS(), 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("{ mS_TXPWR_MAX_CCH := ");
single_value->field_mS__TXPWR__MAX__CCH.log_match(match_value.mS__TXPWR__MAX__CCH(), legacy);
TTCN_Logger::log_event_str(", cellReselectHysterisis := ");
single_value->field_cellReselectHysterisis.log_match(match_value.cellReselectHysterisis(), legacy);
TTCN_Logger::log_event_str(", rXLEV_Access_Min := ");
single_value->field_rXLEV__Access__Min.log_match(match_value.rXLEV__Access__Min(), legacy);
TTCN_Logger::log_event_str(", nECI := ");
single_value->field_nECI.log_match(match_value.nECI(), legacy);
TTCN_Logger::log_event_str(", aCS := ");
single_value->field_aCS.log_match(match_value.aCS(), 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 CellSelectionParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_mS__TXPWR__MAX__CCH.encode_text(text_buf);
single_value->field_cellReselectHysterisis.encode_text(text_buf);
single_value->field_rXLEV__Access__Min.encode_text(text_buf);
single_value->field_nECI.encode_text(text_buf);
single_value->field_aCS.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.CellSelectionParameters.");
}
}

void CellSelectionParameters_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__TXPWR__MAX__CCH.decode_text(text_buf);
single_value->field_cellReselectHysterisis.decode_text(text_buf);
single_value->field_rXLEV__Access__Min.decode_text(text_buf);
single_value->field_nECI.decode_text(text_buf);
single_value->field_aCS.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 CellSelectionParameters_template[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.CellSelectionParameters.");
}
}

void CellSelectionParameters_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: {
    CellSelectionParameters_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.CellSelectionParameters 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) mS__TXPWR__MAX__CCH().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellReselectHysterisis().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rXLEV__Access__Min().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) nECI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) aCS().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(), "mS_TXPWR_MAX_CCH")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__TXPWR__MAX__CCH().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellReselectHysterisis")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellReselectHysterisis().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rXLEV_Access_Min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rXLEV__Access__Min().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nECI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nECI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.CellSelectionParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CellSelectionParameters_template* precondition = new CellSelectionParameters_template;
    precondition->set_param(*param.get_elem(0));
    CellSelectionParameters_template* implied_template = new CellSelectionParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CellSelectionParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.CellSelectionParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void CellSelectionParameters_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__TXPWR__MAX__CCH.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellSelectionParameters");
single_value->field_cellReselectHysterisis.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellSelectionParameters");
single_value->field_rXLEV__Access__Min.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellSelectionParameters");
single_value->field_nECI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellSelectionParameters");
single_value->field_aCS.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CellSelectionParameters");
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.CellSelectionParameters");
}

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

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

RACHControlParameters::RACHControlParameters()
{
}

RACHControlParameters::RACHControlParameters(const BITSTRING& par_rE,
    const BITSTRING& par_cellBarrAccess,
    const BITSTRING& par_tX__Integer,
    const BITSTRING& par_maxRetrans,
    const OCTETSTRING& par_aC__15__to__8,
    const OCTETSTRING& par_aC__7__to__0)
  :   field_rE(par_rE),
  field_cellBarrAccess(par_cellBarrAccess),
  field_tX__Integer(par_tX__Integer),
  field_maxRetrans(par_maxRetrans),
  field_aC__15__to__8(par_aC__15__to__8),
  field_aC__7__to__0(par_aC__7__to__0)
{
}

RACHControlParameters::RACHControlParameters(const RACHControlParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RACHControlParameters.");
if (other_value.rE().is_bound()) field_rE = other_value.rE();
else field_rE.clean_up();
if (other_value.cellBarrAccess().is_bound()) field_cellBarrAccess = other_value.cellBarrAccess();
else field_cellBarrAccess.clean_up();
if (other_value.tX__Integer().is_bound()) field_tX__Integer = other_value.tX__Integer();
else field_tX__Integer.clean_up();
if (other_value.maxRetrans().is_bound()) field_maxRetrans = other_value.maxRetrans();
else field_maxRetrans.clean_up();
if (other_value.aC__15__to__8().is_bound()) field_aC__15__to__8 = other_value.aC__15__to__8();
else field_aC__15__to__8.clean_up();
if (other_value.aC__7__to__0().is_bound()) field_aC__7__to__0 = other_value.aC__7__to__0();
else field_aC__7__to__0.clean_up();
}

void RACHControlParameters::clean_up()
{
field_rE.clean_up();
field_cellBarrAccess.clean_up();
field_tX__Integer.clean_up();
field_maxRetrans.clean_up();
field_aC__15__to__8.clean_up();
field_aC__7__to__0.clean_up();
}

const TTCN_Typedescriptor_t* RACHControlParameters::get_descriptor() const { return &RACHControlParameters_descr_; }
RACHControlParameters& RACHControlParameters::operator=(const RACHControlParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RACHControlParameters.");
  if (other_value.rE().is_bound()) field_rE = other_value.rE();
  else field_rE.clean_up();
  if (other_value.cellBarrAccess().is_bound()) field_cellBarrAccess = other_value.cellBarrAccess();
  else field_cellBarrAccess.clean_up();
  if (other_value.tX__Integer().is_bound()) field_tX__Integer = other_value.tX__Integer();
  else field_tX__Integer.clean_up();
  if (other_value.maxRetrans().is_bound()) field_maxRetrans = other_value.maxRetrans();
  else field_maxRetrans.clean_up();
  if (other_value.aC__15__to__8().is_bound()) field_aC__15__to__8 = other_value.aC__15__to__8();
  else field_aC__15__to__8.clean_up();
  if (other_value.aC__7__to__0().is_bound()) field_aC__7__to__0 = other_value.aC__7__to__0();
  else field_aC__7__to__0.clean_up();
}
return *this;
}

boolean RACHControlParameters::operator==(const RACHControlParameters& other_value) const
{
return field_rE==other_value.field_rE
  && field_cellBarrAccess==other_value.field_cellBarrAccess
  && field_tX__Integer==other_value.field_tX__Integer
  && field_maxRetrans==other_value.field_maxRetrans
  && field_aC__15__to__8==other_value.field_aC__15__to__8
  && field_aC__7__to__0==other_value.field_aC__7__to__0;
}

boolean RACHControlParameters::is_bound() const
{
return (field_rE.is_bound())
  || (field_cellBarrAccess.is_bound())
  || (field_tX__Integer.is_bound())
  || (field_maxRetrans.is_bound())
  || (field_aC__15__to__8.is_bound())
  || (field_aC__7__to__0.is_bound());
}
boolean RACHControlParameters::is_value() const
{
return field_rE.is_value()
  && field_cellBarrAccess.is_value()
  && field_tX__Integer.is_value()
  && field_maxRetrans.is_value()
  && field_aC__15__to__8.is_value()
  && field_aC__7__to__0.is_value();
}
void RACHControlParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rE := ");
field_rE.log();
TTCN_Logger::log_event_str(", cellBarrAccess := ");
field_cellBarrAccess.log();
TTCN_Logger::log_event_str(", tX_Integer := ");
field_tX__Integer.log();
TTCN_Logger::log_event_str(", maxRetrans := ");
field_maxRetrans.log();
TTCN_Logger::log_event_str(", aC_15_to_8 := ");
field_aC__15__to__8.log();
TTCN_Logger::log_event_str(", aC_7_to_0 := ");
field_aC__7__to__0.log();
TTCN_Logger::log_event_str(" }");
}

void RACHControlParameters::set_implicit_omit()
{
if (rE().is_bound()) rE().set_implicit_omit();
if (cellBarrAccess().is_bound()) cellBarrAccess().set_implicit_omit();
if (tX__Integer().is_bound()) tX__Integer().set_implicit_omit();
if (maxRetrans().is_bound()) maxRetrans().set_implicit_omit();
if (aC__15__to__8().is_bound()) aC__15__to__8().set_implicit_omit();
if (aC__7__to__0().is_bound()) aC__7__to__0().set_implicit_omit();
}

void RACHControlParameters::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.RACHControlParameters 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) rE().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellBarrAccess().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tX__Integer().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) maxRetrans().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) aC__15__to__8().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aC__7__to__0().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(), "rE")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rE().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellBarrAccess")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellBarrAccess().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tX_Integer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tX__Integer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxRetrans")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxRetrans().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aC_15_to_8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aC__15__to__8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aC_7_to_0")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aC__7__to__0().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RACHControlParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RACHControlParameters");
  }
}

void RACHControlParameters::encode_text(Text_Buf& text_buf) const
{
field_rE.encode_text(text_buf);
field_cellBarrAccess.encode_text(text_buf);
field_tX__Integer.encode_text(text_buf);
field_maxRetrans.encode_text(text_buf);
field_aC__15__to__8.encode_text(text_buf);
field_aC__7__to__0.encode_text(text_buf);
}

void RACHControlParameters::decode_text(Text_Buf& text_buf)
{
field_rE.decode_text(text_buf);
field_cellBarrAccess.decode_text(text_buf);
field_tX__Integer.decode_text(text_buf);
field_maxRetrans.decode_text(text_buf);
field_aC__15__to__8.decode_text(text_buf);
field_aC__7__to__0.decode_text(text_buf);
}

void RACHControlParameters::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 RACHControlParameters::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 RACHControlParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_rE.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cellBarrAccess.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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_tX__Integer.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_maxRetrans.RAW_decode(General__Types::BIT2_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_aC__15__to__8.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_aC__7__to__0.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RACHControlParameters::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_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::OCT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::OCT1_descr_.raw);
  encoded_length += field_rE.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cellBarrAccess.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tX__Integer.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_maxRetrans.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_aC__15__to__8.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_aC__7__to__0.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
  return myleaf.length = encoded_length;
}

struct RACHControlParameters_template::single_value_struct {
BITSTRING_template field_rE;
BITSTRING_template field_cellBarrAccess;
BITSTRING_template field_tX__Integer;
BITSTRING_template field_maxRetrans;
OCTETSTRING_template field_aC__15__to__8;
OCTETSTRING_template field_aC__7__to__0;
};

void RACHControlParameters_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_rE = ANY_VALUE;
single_value->field_cellBarrAccess = ANY_VALUE;
single_value->field_tX__Integer = ANY_VALUE;
single_value->field_maxRetrans = ANY_VALUE;
single_value->field_aC__15__to__8 = ANY_VALUE;
single_value->field_aC__7__to__0 = ANY_VALUE;
}
}
}

void RACHControlParameters_template::copy_value(const RACHControlParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.rE().is_bound()) {
  single_value->field_rE = other_value.rE();
} else {
  single_value->field_rE.clean_up();
}
if (other_value.cellBarrAccess().is_bound()) {
  single_value->field_cellBarrAccess = other_value.cellBarrAccess();
} else {
  single_value->field_cellBarrAccess.clean_up();
}
if (other_value.tX__Integer().is_bound()) {
  single_value->field_tX__Integer = other_value.tX__Integer();
} else {
  single_value->field_tX__Integer.clean_up();
}
if (other_value.maxRetrans().is_bound()) {
  single_value->field_maxRetrans = other_value.maxRetrans();
} else {
  single_value->field_maxRetrans.clean_up();
}
if (other_value.aC__15__to__8().is_bound()) {
  single_value->field_aC__15__to__8 = other_value.aC__15__to__8();
} else {
  single_value->field_aC__15__to__8.clean_up();
}
if (other_value.aC__7__to__0().is_bound()) {
  single_value->field_aC__7__to__0 = other_value.aC__7__to__0();
} else {
  single_value->field_aC__7__to__0.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RACHControlParameters_template::copy_template(const RACHControlParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rE().get_selection()) {
single_value->field_rE = other_value.rE();
} else {
single_value->field_rE.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellBarrAccess().get_selection()) {
single_value->field_cellBarrAccess = other_value.cellBarrAccess();
} else {
single_value->field_cellBarrAccess.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tX__Integer().get_selection()) {
single_value->field_tX__Integer = other_value.tX__Integer();
} else {
single_value->field_tX__Integer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxRetrans().get_selection()) {
single_value->field_maxRetrans = other_value.maxRetrans();
} else {
single_value->field_maxRetrans.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aC__15__to__8().get_selection()) {
single_value->field_aC__15__to__8 = other_value.aC__15__to__8();
} else {
single_value->field_aC__15__to__8.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aC__7__to__0().get_selection()) {
single_value->field_aC__7__to__0 = other_value.aC__7__to__0();
} else {
single_value->field_aC__7__to__0.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 RACHControlParameters_template[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 RACHControlParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new RACHControlParameters_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.RACHControlParameters.");
break;
}
set_selection(other_value);
}

RACHControlParameters_template::RACHControlParameters_template()
{
}

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

RACHControlParameters_template::RACHControlParameters_template(const RACHControlParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RACHControlParameters_template::match(const RACHControlParameters& 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.rE().is_bound()) return FALSE;
if(!single_value->field_rE.match(other_value.rE(), legacy))return FALSE;
if(!other_value.cellBarrAccess().is_bound()) return FALSE;
if(!single_value->field_cellBarrAccess.match(other_value.cellBarrAccess(), legacy))return FALSE;
if(!other_value.tX__Integer().is_bound()) return FALSE;
if(!single_value->field_tX__Integer.match(other_value.tX__Integer(), legacy))return FALSE;
if(!other_value.maxRetrans().is_bound()) return FALSE;
if(!single_value->field_maxRetrans.match(other_value.maxRetrans(), legacy))return FALSE;
if(!other_value.aC__15__to__8().is_bound()) return FALSE;
if(!single_value->field_aC__15__to__8.match(other_value.aC__15__to__8(), legacy))return FALSE;
if(!other_value.aC__7__to__0().is_bound()) return FALSE;
if(!single_value->field_aC__7__to__0.match(other_value.aC__7__to__0(), 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.RACHControlParameters.");
}
return FALSE;
}

boolean RACHControlParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rE.is_bound()
 || single_value->field_cellBarrAccess.is_bound()
 || single_value->field_tX__Integer.is_bound()
 || single_value->field_maxRetrans.is_bound()
 || single_value->field_aC__15__to__8.is_bound()
 || single_value->field_aC__7__to__0.is_bound();
}

boolean RACHControlParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rE.is_value()
 && single_value->field_cellBarrAccess.is_value()
 && single_value->field_tX__Integer.is_value()
 && single_value->field_maxRetrans.is_value()
 && single_value->field_aC__15__to__8.is_value()
 && single_value->field_aC__7__to__0.is_value();
}

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

RACHControlParameters RACHControlParameters_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.RACHControlParameters.");
RACHControlParameters ret_val;
if (single_value->field_rE.is_bound()) {
ret_val.rE() = single_value->field_rE.valueof();
}
if (single_value->field_cellBarrAccess.is_bound()) {
ret_val.cellBarrAccess() = single_value->field_cellBarrAccess.valueof();
}
if (single_value->field_tX__Integer.is_bound()) {
ret_val.tX__Integer() = single_value->field_tX__Integer.valueof();
}
if (single_value->field_maxRetrans.is_bound()) {
ret_val.maxRetrans() = single_value->field_maxRetrans.valueof();
}
if (single_value->field_aC__15__to__8.is_bound()) {
ret_val.aC__15__to__8() = single_value->field_aC__15__to__8.valueof();
}
if (single_value->field_aC__7__to__0.is_bound()) {
ret_val.aC__7__to__0() = single_value->field_aC__7__to__0.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RACHControlParameters_template::rE()
{
set_specific();
return single_value->field_rE;
}

const BITSTRING_template& RACHControlParameters_template::rE() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rE of a non-specific template of type @BSSGP_Types.RACHControlParameters.");
return single_value->field_rE;
}

BITSTRING_template& RACHControlParameters_template::cellBarrAccess()
{
set_specific();
return single_value->field_cellBarrAccess;
}

const BITSTRING_template& RACHControlParameters_template::cellBarrAccess() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellBarrAccess of a non-specific template of type @BSSGP_Types.RACHControlParameters.");
return single_value->field_cellBarrAccess;
}

BITSTRING_template& RACHControlParameters_template::tX__Integer()
{
set_specific();
return single_value->field_tX__Integer;
}

const BITSTRING_template& RACHControlParameters_template::tX__Integer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tX_Integer of a non-specific template of type @BSSGP_Types.RACHControlParameters.");
return single_value->field_tX__Integer;
}

BITSTRING_template& RACHControlParameters_template::maxRetrans()
{
set_specific();
return single_value->field_maxRetrans;
}

const BITSTRING_template& RACHControlParameters_template::maxRetrans() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxRetrans of a non-specific template of type @BSSGP_Types.RACHControlParameters.");
return single_value->field_maxRetrans;
}

OCTETSTRING_template& RACHControlParameters_template::aC__15__to__8()
{
set_specific();
return single_value->field_aC__15__to__8;
}

const OCTETSTRING_template& RACHControlParameters_template::aC__15__to__8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aC_15_to_8 of a non-specific template of type @BSSGP_Types.RACHControlParameters.");
return single_value->field_aC__15__to__8;
}

OCTETSTRING_template& RACHControlParameters_template::aC__7__to__0()
{
set_specific();
return single_value->field_aC__7__to__0;
}

const OCTETSTRING_template& RACHControlParameters_template::aC__7__to__0() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aC_7_to_0 of a non-specific template of type @BSSGP_Types.RACHControlParameters.");
return single_value->field_aC__7__to__0;
}

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

void RACHControlParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rE := ");
single_value->field_rE.log();
TTCN_Logger::log_event_str(", cellBarrAccess := ");
single_value->field_cellBarrAccess.log();
TTCN_Logger::log_event_str(", tX_Integer := ");
single_value->field_tX__Integer.log();
TTCN_Logger::log_event_str(", maxRetrans := ");
single_value->field_maxRetrans.log();
TTCN_Logger::log_event_str(", aC_15_to_8 := ");
single_value->field_aC__15__to__8.log();
TTCN_Logger::log_event_str(", aC_7_to_0 := ");
single_value->field_aC__7__to__0.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 RACHControlParameters_template::log_match(const RACHControlParameters& 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_rE.match(match_value.rE(), legacy)){
TTCN_Logger::log_logmatch_info(".rE");
single_value->field_rE.log_match(match_value.rE(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cellBarrAccess.match(match_value.cellBarrAccess(), legacy)){
TTCN_Logger::log_logmatch_info(".cellBarrAccess");
single_value->field_cellBarrAccess.log_match(match_value.cellBarrAccess(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tX__Integer.match(match_value.tX__Integer(), legacy)){
TTCN_Logger::log_logmatch_info(".tX_Integer");
single_value->field_tX__Integer.log_match(match_value.tX__Integer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_maxRetrans.match(match_value.maxRetrans(), legacy)){
TTCN_Logger::log_logmatch_info(".maxRetrans");
single_value->field_maxRetrans.log_match(match_value.maxRetrans(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aC__15__to__8.match(match_value.aC__15__to__8(), legacy)){
TTCN_Logger::log_logmatch_info(".aC_15_to_8");
single_value->field_aC__15__to__8.log_match(match_value.aC__15__to__8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aC__7__to__0.match(match_value.aC__7__to__0(), legacy)){
TTCN_Logger::log_logmatch_info(".aC_7_to_0");
single_value->field_aC__7__to__0.log_match(match_value.aC__7__to__0(), 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("{ rE := ");
single_value->field_rE.log_match(match_value.rE(), legacy);
TTCN_Logger::log_event_str(", cellBarrAccess := ");
single_value->field_cellBarrAccess.log_match(match_value.cellBarrAccess(), legacy);
TTCN_Logger::log_event_str(", tX_Integer := ");
single_value->field_tX__Integer.log_match(match_value.tX__Integer(), legacy);
TTCN_Logger::log_event_str(", maxRetrans := ");
single_value->field_maxRetrans.log_match(match_value.maxRetrans(), legacy);
TTCN_Logger::log_event_str(", aC_15_to_8 := ");
single_value->field_aC__15__to__8.log_match(match_value.aC__15__to__8(), legacy);
TTCN_Logger::log_event_str(", aC_7_to_0 := ");
single_value->field_aC__7__to__0.log_match(match_value.aC__7__to__0(), 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 RACHControlParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rE.encode_text(text_buf);
single_value->field_cellBarrAccess.encode_text(text_buf);
single_value->field_tX__Integer.encode_text(text_buf);
single_value->field_maxRetrans.encode_text(text_buf);
single_value->field_aC__15__to__8.encode_text(text_buf);
single_value->field_aC__7__to__0.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.RACHControlParameters.");
}
}

void RACHControlParameters_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_rE.decode_text(text_buf);
single_value->field_cellBarrAccess.decode_text(text_buf);
single_value->field_tX__Integer.decode_text(text_buf);
single_value->field_maxRetrans.decode_text(text_buf);
single_value->field_aC__15__to__8.decode_text(text_buf);
single_value->field_aC__7__to__0.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 RACHControlParameters_template[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.RACHControlParameters.");
}
}

void RACHControlParameters_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: {
    RACHControlParameters_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.RACHControlParameters 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) rE().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellBarrAccess().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tX__Integer().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) maxRetrans().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) aC__15__to__8().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aC__7__to__0().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(), "rE")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rE().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellBarrAccess")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellBarrAccess().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tX_Integer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tX__Integer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxRetrans")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxRetrans().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aC_15_to_8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aC__15__to__8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aC_7_to_0")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aC__7__to__0().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RACHControlParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RACHControlParameters_template* precondition = new RACHControlParameters_template;
    precondition->set_param(*param.get_elem(0));
    RACHControlParameters_template* implied_template = new RACHControlParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RACHControlParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RACHControlParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void RACHControlParameters_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_rE.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RACHControlParameters");
single_value->field_cellBarrAccess.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RACHControlParameters");
single_value->field_tX__Integer.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RACHControlParameters");
single_value->field_maxRetrans.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RACHControlParameters");
single_value->field_aC__15__to__8.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RACHControlParameters");
single_value->field_aC__7__to__0.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RACHControlParameters");
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.RACHControlParameters");
}

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

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

SI3::SI3()
{
}

SI3::SI3(const OCTETSTRING& par_sI3MessageType,
    const OCTETSTRING& par_cellIdentity,
    const LocationAreaIdentification& par_locationAreaIdentification,
    const ControlChannelDescription& par_controlChannelDescription,
    const CellOptions& par_cellOptions,
    const CellSelectionParameters& par_cellSelectionParameters,
    const RACHControlParameters& par_rACHControlParameters,
    const OCTETSTRING& par_sI3RestOctets)
  :   field_sI3MessageType(par_sI3MessageType),
  field_cellIdentity(par_cellIdentity),
  field_locationAreaIdentification(par_locationAreaIdentification),
  field_controlChannelDescription(par_controlChannelDescription),
  field_cellOptions(par_cellOptions),
  field_cellSelectionParameters(par_cellSelectionParameters),
  field_rACHControlParameters(par_rACHControlParameters),
  field_sI3RestOctets(par_sI3RestOctets)
{
}

SI3::SI3(const SI3& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.SI3.");
if (other_value.sI3MessageType().is_bound()) field_sI3MessageType = other_value.sI3MessageType();
else field_sI3MessageType.clean_up();
if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity();
else field_cellIdentity.clean_up();
if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
else field_locationAreaIdentification.clean_up();
if (other_value.controlChannelDescription().is_bound()) field_controlChannelDescription = other_value.controlChannelDescription();
else field_controlChannelDescription.clean_up();
if (other_value.cellOptions().is_bound()) field_cellOptions = other_value.cellOptions();
else field_cellOptions.clean_up();
if (other_value.cellSelectionParameters().is_bound()) field_cellSelectionParameters = other_value.cellSelectionParameters();
else field_cellSelectionParameters.clean_up();
if (other_value.rACHControlParameters().is_bound()) field_rACHControlParameters = other_value.rACHControlParameters();
else field_rACHControlParameters.clean_up();
if (other_value.sI3RestOctets().is_bound()) field_sI3RestOctets = other_value.sI3RestOctets();
else field_sI3RestOctets.clean_up();
}

void SI3::clean_up()
{
field_sI3MessageType.clean_up();
field_cellIdentity.clean_up();
field_locationAreaIdentification.clean_up();
field_controlChannelDescription.clean_up();
field_cellOptions.clean_up();
field_cellSelectionParameters.clean_up();
field_rACHControlParameters.clean_up();
field_sI3RestOctets.clean_up();
}

const TTCN_Typedescriptor_t* SI3::get_descriptor() const { return &SI3_descr_; }
SI3& SI3::operator=(const SI3& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.SI3.");
  if (other_value.sI3MessageType().is_bound()) field_sI3MessageType = other_value.sI3MessageType();
  else field_sI3MessageType.clean_up();
  if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity();
  else field_cellIdentity.clean_up();
  if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
  else field_locationAreaIdentification.clean_up();
  if (other_value.controlChannelDescription().is_bound()) field_controlChannelDescription = other_value.controlChannelDescription();
  else field_controlChannelDescription.clean_up();
  if (other_value.cellOptions().is_bound()) field_cellOptions = other_value.cellOptions();
  else field_cellOptions.clean_up();
  if (other_value.cellSelectionParameters().is_bound()) field_cellSelectionParameters = other_value.cellSelectionParameters();
  else field_cellSelectionParameters.clean_up();
  if (other_value.rACHControlParameters().is_bound()) field_rACHControlParameters = other_value.rACHControlParameters();
  else field_rACHControlParameters.clean_up();
  if (other_value.sI3RestOctets().is_bound()) field_sI3RestOctets = other_value.sI3RestOctets();
  else field_sI3RestOctets.clean_up();
}
return *this;
}

boolean SI3::operator==(const SI3& other_value) const
{
return field_sI3MessageType==other_value.field_sI3MessageType
  && field_cellIdentity==other_value.field_cellIdentity
  && field_locationAreaIdentification==other_value.field_locationAreaIdentification
  && field_controlChannelDescription==other_value.field_controlChannelDescription
  && field_cellOptions==other_value.field_cellOptions
  && field_cellSelectionParameters==other_value.field_cellSelectionParameters
  && field_rACHControlParameters==other_value.field_rACHControlParameters
  && field_sI3RestOctets==other_value.field_sI3RestOctets;
}

boolean SI3::is_bound() const
{
return (field_sI3MessageType.is_bound())
  || (field_cellIdentity.is_bound())
  || (field_locationAreaIdentification.is_bound())
  || (field_controlChannelDescription.is_bound())
  || (field_cellOptions.is_bound())
  || (field_cellSelectionParameters.is_bound())
  || (field_rACHControlParameters.is_bound())
  || (field_sI3RestOctets.is_bound());
}
boolean SI3::is_value() const
{
return field_sI3MessageType.is_value()
  && field_cellIdentity.is_value()
  && field_locationAreaIdentification.is_value()
  && field_controlChannelDescription.is_value()
  && field_cellOptions.is_value()
  && field_cellSelectionParameters.is_value()
  && field_rACHControlParameters.is_value()
  && field_sI3RestOctets.is_value();
}
void SI3::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sI3MessageType := ");
field_sI3MessageType.log();
TTCN_Logger::log_event_str(", cellIdentity := ");
field_cellIdentity.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", controlChannelDescription := ");
field_controlChannelDescription.log();
TTCN_Logger::log_event_str(", cellOptions := ");
field_cellOptions.log();
TTCN_Logger::log_event_str(", cellSelectionParameters := ");
field_cellSelectionParameters.log();
TTCN_Logger::log_event_str(", rACHControlParameters := ");
field_rACHControlParameters.log();
TTCN_Logger::log_event_str(", sI3RestOctets := ");
field_sI3RestOctets.log();
TTCN_Logger::log_event_str(" }");
}

void SI3::set_implicit_omit()
{
if (sI3MessageType().is_bound()) sI3MessageType().set_implicit_omit();
if (cellIdentity().is_bound()) cellIdentity().set_implicit_omit();
if (locationAreaIdentification().is_bound()) locationAreaIdentification().set_implicit_omit();
if (controlChannelDescription().is_bound()) controlChannelDescription().set_implicit_omit();
if (cellOptions().is_bound()) cellOptions().set_implicit_omit();
if (cellSelectionParameters().is_bound()) cellSelectionParameters().set_implicit_omit();
if (rACHControlParameters().is_bound()) rACHControlParameters().set_implicit_omit();
if (sI3RestOctets().is_bound()) sI3RestOctets().set_implicit_omit();
}

void SI3::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.SI3 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) sI3MessageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellIdentity().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) controlChannelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellOptions().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cellSelectionParameters().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rACHControlParameters().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sI3RestOctets().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(), "sI3MessageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI3MessageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "controlChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          controlChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellOptions")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellOptions().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellSelectionParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellSelectionParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rACHControlParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rACHControlParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI3RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI3RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.SI3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.SI3");
  }
}

void SI3::encode_text(Text_Buf& text_buf) const
{
field_sI3MessageType.encode_text(text_buf);
field_cellIdentity.encode_text(text_buf);
field_locationAreaIdentification.encode_text(text_buf);
field_controlChannelDescription.encode_text(text_buf);
field_cellOptions.encode_text(text_buf);
field_cellSelectionParameters.encode_text(text_buf);
field_rACHControlParameters.encode_text(text_buf);
field_sI3RestOctets.encode_text(text_buf);
}

void SI3::decode_text(Text_Buf& text_buf)
{
field_sI3MessageType.decode_text(text_buf);
field_cellIdentity.decode_text(text_buf);
field_locationAreaIdentification.decode_text(text_buf);
field_controlChannelDescription.decode_text(text_buf);
field_cellOptions.decode_text(text_buf);
field_cellSelectionParameters.decode_text(text_buf);
field_rACHControlParameters.decode_text(text_buf);
field_sI3RestOctets.decode_text(text_buf);
}

void SI3::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 SI3::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 SI3::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_sI3MessageType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_cellIdentity.RAW_decode(General__Types::OCT2_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, LocationAreaIdentification_descr_.raw->forceomit);
  decoded_field_length = field_locationAreaIdentification.RAW_decode(LocationAreaIdentification_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, ControlChannelDescription_descr_.raw->forceomit);
  decoded_field_length = field_controlChannelDescription.RAW_decode(ControlChannelDescription_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, CellOptions_descr_.raw->forceomit);
  decoded_field_length = field_cellOptions.RAW_decode(CellOptions_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, CellSelectionParameters_descr_.raw->forceomit);
  decoded_field_length = field_cellSelectionParameters.RAW_decode(CellSelectionParameters_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, RACHControlParameters_descr_.raw->forceomit);
  decoded_field_length = field_rACHControlParameters.RAW_decode(RACHControlParameters_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, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_sI3RestOctets.RAW_decode(General__Types::OCT4_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 SI3::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, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, LocationAreaIdentification_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ControlChannelDescription_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, CellOptions_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, CellSelectionParameters_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RACHControlParameters_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::OCT4_descr_.raw);
  encoded_length += field_sI3MessageType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cellIdentity.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_locationAreaIdentification.RAW_encode(LocationAreaIdentification_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_controlChannelDescription.RAW_encode(ControlChannelDescription_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_cellOptions.RAW_encode(CellOptions_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_cellSelectionParameters.RAW_encode(CellSelectionParameters_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_rACHControlParameters.RAW_encode(RACHControlParameters_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_sI3RestOctets.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct SI3_template::single_value_struct {
OCTETSTRING_template field_sI3MessageType;
OCTETSTRING_template field_cellIdentity;
LocationAreaIdentification_template field_locationAreaIdentification;
ControlChannelDescription_template field_controlChannelDescription;
CellOptions_template field_cellOptions;
CellSelectionParameters_template field_cellSelectionParameters;
RACHControlParameters_template field_rACHControlParameters;
OCTETSTRING_template field_sI3RestOctets;
};

void SI3_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_sI3MessageType = ANY_VALUE;
single_value->field_cellIdentity = ANY_VALUE;
single_value->field_locationAreaIdentification = ANY_VALUE;
single_value->field_controlChannelDescription = ANY_VALUE;
single_value->field_cellOptions = ANY_VALUE;
single_value->field_cellSelectionParameters = ANY_VALUE;
single_value->field_rACHControlParameters = ANY_VALUE;
single_value->field_sI3RestOctets = ANY_VALUE;
}
}
}

void SI3_template::copy_value(const SI3& other_value)
{
single_value = new single_value_struct;
if (other_value.sI3MessageType().is_bound()) {
  single_value->field_sI3MessageType = other_value.sI3MessageType();
} else {
  single_value->field_sI3MessageType.clean_up();
}
if (other_value.cellIdentity().is_bound()) {
  single_value->field_cellIdentity = other_value.cellIdentity();
} else {
  single_value->field_cellIdentity.clean_up();
}
if (other_value.locationAreaIdentification().is_bound()) {
  single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
  single_value->field_locationAreaIdentification.clean_up();
}
if (other_value.controlChannelDescription().is_bound()) {
  single_value->field_controlChannelDescription = other_value.controlChannelDescription();
} else {
  single_value->field_controlChannelDescription.clean_up();
}
if (other_value.cellOptions().is_bound()) {
  single_value->field_cellOptions = other_value.cellOptions();
} else {
  single_value->field_cellOptions.clean_up();
}
if (other_value.cellSelectionParameters().is_bound()) {
  single_value->field_cellSelectionParameters = other_value.cellSelectionParameters();
} else {
  single_value->field_cellSelectionParameters.clean_up();
}
if (other_value.rACHControlParameters().is_bound()) {
  single_value->field_rACHControlParameters = other_value.rACHControlParameters();
} else {
  single_value->field_rACHControlParameters.clean_up();
}
if (other_value.sI3RestOctets().is_bound()) {
  single_value->field_sI3RestOctets = other_value.sI3RestOctets();
} else {
  single_value->field_sI3RestOctets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SI3_template::copy_template(const SI3_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sI3MessageType().get_selection()) {
single_value->field_sI3MessageType = other_value.sI3MessageType();
} else {
single_value->field_sI3MessageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellIdentity().get_selection()) {
single_value->field_cellIdentity = other_value.cellIdentity();
} else {
single_value->field_cellIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.locationAreaIdentification().get_selection()) {
single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
single_value->field_locationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.controlChannelDescription().get_selection()) {
single_value->field_controlChannelDescription = other_value.controlChannelDescription();
} else {
single_value->field_controlChannelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellOptions().get_selection()) {
single_value->field_cellOptions = other_value.cellOptions();
} else {
single_value->field_cellOptions.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellSelectionParameters().get_selection()) {
single_value->field_cellSelectionParameters = other_value.cellSelectionParameters();
} else {
single_value->field_cellSelectionParameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rACHControlParameters().get_selection()) {
single_value->field_rACHControlParameters = other_value.rACHControlParameters();
} else {
single_value->field_rACHControlParameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sI3RestOctets().get_selection()) {
single_value->field_sI3RestOctets = other_value.sI3RestOctets();
} else {
single_value->field_sI3RestOctets.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 SI3_template[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 SI3_template(*other_value.implication_.precondition);
implication_.implied_template = new SI3_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.SI3.");
break;
}
set_selection(other_value);
}

SI3_template::SI3_template()
{
}

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

SI3_template::SI3_template(const SI3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SI3_template::match(const SI3& 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.sI3MessageType().is_bound()) return FALSE;
if(!single_value->field_sI3MessageType.match(other_value.sI3MessageType(), legacy))return FALSE;
if(!other_value.cellIdentity().is_bound()) return FALSE;
if(!single_value->field_cellIdentity.match(other_value.cellIdentity(), legacy))return FALSE;
if(!other_value.locationAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_locationAreaIdentification.match(other_value.locationAreaIdentification(), legacy))return FALSE;
if(!other_value.controlChannelDescription().is_bound()) return FALSE;
if(!single_value->field_controlChannelDescription.match(other_value.controlChannelDescription(), legacy))return FALSE;
if(!other_value.cellOptions().is_bound()) return FALSE;
if(!single_value->field_cellOptions.match(other_value.cellOptions(), legacy))return FALSE;
if(!other_value.cellSelectionParameters().is_bound()) return FALSE;
if(!single_value->field_cellSelectionParameters.match(other_value.cellSelectionParameters(), legacy))return FALSE;
if(!other_value.rACHControlParameters().is_bound()) return FALSE;
if(!single_value->field_rACHControlParameters.match(other_value.rACHControlParameters(), legacy))return FALSE;
if(!other_value.sI3RestOctets().is_bound()) return FALSE;
if(!single_value->field_sI3RestOctets.match(other_value.sI3RestOctets(), 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.SI3.");
}
return FALSE;
}

boolean SI3_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_sI3MessageType.is_bound()
 || single_value->field_cellIdentity.is_bound()
 || single_value->field_locationAreaIdentification.is_bound()
 || single_value->field_controlChannelDescription.is_bound()
 || single_value->field_cellOptions.is_bound()
 || single_value->field_cellSelectionParameters.is_bound()
 || single_value->field_rACHControlParameters.is_bound()
 || single_value->field_sI3RestOctets.is_bound();
}

boolean SI3_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sI3MessageType.is_value()
 && single_value->field_cellIdentity.is_value()
 && single_value->field_locationAreaIdentification.is_value()
 && single_value->field_controlChannelDescription.is_value()
 && single_value->field_cellOptions.is_value()
 && single_value->field_cellSelectionParameters.is_value()
 && single_value->field_rACHControlParameters.is_value()
 && single_value->field_sI3RestOctets.is_value();
}

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

SI3 SI3_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.SI3.");
SI3 ret_val;
if (single_value->field_sI3MessageType.is_bound()) {
ret_val.sI3MessageType() = single_value->field_sI3MessageType.valueof();
}
if (single_value->field_cellIdentity.is_bound()) {
ret_val.cellIdentity() = single_value->field_cellIdentity.valueof();
}
if (single_value->field_locationAreaIdentification.is_bound()) {
ret_val.locationAreaIdentification() = single_value->field_locationAreaIdentification.valueof();
}
if (single_value->field_controlChannelDescription.is_bound()) {
ret_val.controlChannelDescription() = single_value->field_controlChannelDescription.valueof();
}
if (single_value->field_cellOptions.is_bound()) {
ret_val.cellOptions() = single_value->field_cellOptions.valueof();
}
if (single_value->field_cellSelectionParameters.is_bound()) {
ret_val.cellSelectionParameters() = single_value->field_cellSelectionParameters.valueof();
}
if (single_value->field_rACHControlParameters.is_bound()) {
ret_val.rACHControlParameters() = single_value->field_rACHControlParameters.valueof();
}
if (single_value->field_sI3RestOctets.is_bound()) {
ret_val.sI3RestOctets() = single_value->field_sI3RestOctets.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& SI3_template::sI3MessageType()
{
set_specific();
return single_value->field_sI3MessageType;
}

const OCTETSTRING_template& SI3_template::sI3MessageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI3MessageType of a non-specific template of type @BSSGP_Types.SI3.");
return single_value->field_sI3MessageType;
}

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

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

LocationAreaIdentification_template& SI3_template::locationAreaIdentification()
{
set_specific();
return single_value->field_locationAreaIdentification;
}

const LocationAreaIdentification_template& SI3_template::locationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field locationAreaIdentification of a non-specific template of type @BSSGP_Types.SI3.");
return single_value->field_locationAreaIdentification;
}

ControlChannelDescription_template& SI3_template::controlChannelDescription()
{
set_specific();
return single_value->field_controlChannelDescription;
}

const ControlChannelDescription_template& SI3_template::controlChannelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field controlChannelDescription of a non-specific template of type @BSSGP_Types.SI3.");
return single_value->field_controlChannelDescription;
}

CellOptions_template& SI3_template::cellOptions()
{
set_specific();
return single_value->field_cellOptions;
}

const CellOptions_template& SI3_template::cellOptions() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellOptions of a non-specific template of type @BSSGP_Types.SI3.");
return single_value->field_cellOptions;
}

CellSelectionParameters_template& SI3_template::cellSelectionParameters()
{
set_specific();
return single_value->field_cellSelectionParameters;
}

const CellSelectionParameters_template& SI3_template::cellSelectionParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellSelectionParameters of a non-specific template of type @BSSGP_Types.SI3.");
return single_value->field_cellSelectionParameters;
}

RACHControlParameters_template& SI3_template::rACHControlParameters()
{
set_specific();
return single_value->field_rACHControlParameters;
}

const RACHControlParameters_template& SI3_template::rACHControlParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rACHControlParameters of a non-specific template of type @BSSGP_Types.SI3.");
return single_value->field_rACHControlParameters;
}

OCTETSTRING_template& SI3_template::sI3RestOctets()
{
set_specific();
return single_value->field_sI3RestOctets;
}

const OCTETSTRING_template& SI3_template::sI3RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI3RestOctets of a non-specific template of type @BSSGP_Types.SI3.");
return single_value->field_sI3RestOctets;
}

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

void SI3_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sI3MessageType := ");
single_value->field_sI3MessageType.log();
TTCN_Logger::log_event_str(", cellIdentity := ");
single_value->field_cellIdentity.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", controlChannelDescription := ");
single_value->field_controlChannelDescription.log();
TTCN_Logger::log_event_str(", cellOptions := ");
single_value->field_cellOptions.log();
TTCN_Logger::log_event_str(", cellSelectionParameters := ");
single_value->field_cellSelectionParameters.log();
TTCN_Logger::log_event_str(", rACHControlParameters := ");
single_value->field_rACHControlParameters.log();
TTCN_Logger::log_event_str(", sI3RestOctets := ");
single_value->field_sI3RestOctets.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 SI3_template::log_match(const SI3& 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_sI3MessageType.match(match_value.sI3MessageType(), legacy)){
TTCN_Logger::log_logmatch_info(".sI3MessageType");
single_value->field_sI3MessageType.log_match(match_value.sI3MessageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cellIdentity.match(match_value.cellIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".cellIdentity");
single_value->field_cellIdentity.log_match(match_value.cellIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_locationAreaIdentification.match(match_value.locationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".locationAreaIdentification");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_controlChannelDescription.match(match_value.controlChannelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".controlChannelDescription");
single_value->field_controlChannelDescription.log_match(match_value.controlChannelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cellOptions.match(match_value.cellOptions(), legacy)){
TTCN_Logger::log_logmatch_info(".cellOptions");
single_value->field_cellOptions.log_match(match_value.cellOptions(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cellSelectionParameters.match(match_value.cellSelectionParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".cellSelectionParameters");
single_value->field_cellSelectionParameters.log_match(match_value.cellSelectionParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rACHControlParameters.match(match_value.rACHControlParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".rACHControlParameters");
single_value->field_rACHControlParameters.log_match(match_value.rACHControlParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sI3RestOctets.match(match_value.sI3RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".sI3RestOctets");
single_value->field_sI3RestOctets.log_match(match_value.sI3RestOctets(), 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("{ sI3MessageType := ");
single_value->field_sI3MessageType.log_match(match_value.sI3MessageType(), legacy);
TTCN_Logger::log_event_str(", cellIdentity := ");
single_value->field_cellIdentity.log_match(match_value.cellIdentity(), legacy);
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", controlChannelDescription := ");
single_value->field_controlChannelDescription.log_match(match_value.controlChannelDescription(), legacy);
TTCN_Logger::log_event_str(", cellOptions := ");
single_value->field_cellOptions.log_match(match_value.cellOptions(), legacy);
TTCN_Logger::log_event_str(", cellSelectionParameters := ");
single_value->field_cellSelectionParameters.log_match(match_value.cellSelectionParameters(), legacy);
TTCN_Logger::log_event_str(", rACHControlParameters := ");
single_value->field_rACHControlParameters.log_match(match_value.rACHControlParameters(), legacy);
TTCN_Logger::log_event_str(", sI3RestOctets := ");
single_value->field_sI3RestOctets.log_match(match_value.sI3RestOctets(), 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 SI3_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_sI3MessageType.encode_text(text_buf);
single_value->field_cellIdentity.encode_text(text_buf);
single_value->field_locationAreaIdentification.encode_text(text_buf);
single_value->field_controlChannelDescription.encode_text(text_buf);
single_value->field_cellOptions.encode_text(text_buf);
single_value->field_cellSelectionParameters.encode_text(text_buf);
single_value->field_rACHControlParameters.encode_text(text_buf);
single_value->field_sI3RestOctets.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.SI3.");
}
}

void SI3_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_sI3MessageType.decode_text(text_buf);
single_value->field_cellIdentity.decode_text(text_buf);
single_value->field_locationAreaIdentification.decode_text(text_buf);
single_value->field_controlChannelDescription.decode_text(text_buf);
single_value->field_cellOptions.decode_text(text_buf);
single_value->field_cellSelectionParameters.decode_text(text_buf);
single_value->field_rACHControlParameters.decode_text(text_buf);
single_value->field_sI3RestOctets.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 SI3_template[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.SI3.");
}
}

void SI3_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: {
    SI3_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.SI3 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) sI3MessageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellIdentity().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) controlChannelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellOptions().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cellSelectionParameters().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rACHControlParameters().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sI3RestOctets().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(), "sI3MessageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI3MessageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "controlChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          controlChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellOptions")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellOptions().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellSelectionParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellSelectionParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rACHControlParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rACHControlParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI3RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI3RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.SI3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SI3_template* precondition = new SI3_template;
    precondition->set_param(*param.get_elem(0));
    SI3_template* implied_template = new SI3_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SI3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.SI3");
  }
  is_ifpresent = param.get_ifpresent();
}

void SI3_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_sI3MessageType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
single_value->field_cellIdentity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
single_value->field_locationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
single_value->field_controlChannelDescription.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
single_value->field_cellOptions.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
single_value->field_cellSelectionParameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
single_value->field_rACHControlParameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
single_value->field_sI3RestOctets.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI3");
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.SI3");
}

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

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

RAN__Information__Application__Container__SI3::RAN__Information__Application__Container__SI3()
{
}

RAN__Information__Application__Container__SI3::RAN__Information__Application__Container__SI3(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier,
    const SI3& par_sI3)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier),
  field_sI3(par_sI3)
{
}

RAN__Information__Application__Container__SI3::RAN__Information__Application__Container__SI3(const RAN__Information__Application__Container__SI3& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_SI3.");
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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
else field_reporting__Cell__Identifier.clean_up();
if (other_value.sI3().is_bound()) field_sI3 = other_value.sI3();
else field_sI3.clean_up();
}

void RAN__Information__Application__Container__SI3::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
field_sI3.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Application__Container__SI3::get_descriptor() const { return &RAN__Information__Application__Container__SI3_descr_; }
RAN__Information__Application__Container__SI3& RAN__Information__Application__Container__SI3::operator=(const RAN__Information__Application__Container__SI3& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_SI3.");
  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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
  else field_reporting__Cell__Identifier.clean_up();
  if (other_value.sI3().is_bound()) field_sI3 = other_value.sI3();
  else field_sI3.clean_up();
}
return *this;
}

boolean RAN__Information__Application__Container__SI3::operator==(const RAN__Information__Application__Container__SI3& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reporting__Cell__Identifier==other_value.field_reporting__Cell__Identifier
  && field_sI3==other_value.field_sI3;
}

boolean RAN__Information__Application__Container__SI3::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reporting__Cell__Identifier.is_bound())
  || (field_sI3.is_bound());
}
boolean RAN__Information__Application__Container__SI3::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reporting__Cell__Identifier.is_value()
  && field_sI3.is_value();
}
void RAN__Information__Application__Container__SI3::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(", reporting_Cell_Identifier := ");
field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", sI3 := ");
field_sI3.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Application__Container__SI3::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 (reporting__Cell__Identifier().is_bound()) reporting__Cell__Identifier().set_implicit_omit();
if (sI3().is_bound()) sI3().set_implicit_omit();
}

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

void RAN__Information__Application__Container__SI3::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_reporting__Cell__Identifier.encode_text(text_buf);
field_sI3.encode_text(text_buf);
}

void RAN__Information__Application__Container__SI3::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_reporting__Cell__Identifier.decode_text(text_buf);
field_sI3.decode_text(text_buf);
}

void RAN__Information__Application__Container__SI3::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 RAN__Information__Application__Container__SI3::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 RAN__Information__Application__Container__SI3::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, RAN__Information__Application__Container__SI3_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Application__Container__SI3_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, RAN__Information__Application__Container__SI3_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Application__Container__SI3_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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, SI3_descr_.raw->forceomit);
  decoded_field_length = field_sI3.RAW_decode(SI3_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_136) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Application__Container__SI3::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, RAN__Information__Application__Container__SI3_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Application__Container__SI3_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SI3_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Application__Container__SI3_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Application__Container__SI3_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_sI3.RAW_encode(SI3_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(RAN__Information__Application__Container__SI3_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(RAN__Information__Application__Container__SI3_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_136) {
  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_136.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 RAN__Information__Application__Container__SI3_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
SI3_template field_sI3;
};

void RAN__Information__Application__Container__SI3_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_reporting__Cell__Identifier = ANY_VALUE;
single_value->field_sI3 = ANY_VALUE;
}
}
}

void RAN__Information__Application__Container__SI3_template::copy_value(const RAN__Information__Application__Container__SI3& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
if (other_value.sI3().is_bound()) {
  single_value->field_sI3 = other_value.sI3();
} else {
  single_value->field_sI3.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Application__Container__SI3_template::copy_template(const RAN__Information__Application__Container__SI3_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sI3().get_selection()) {
single_value->field_sI3 = other_value.sI3();
} else {
single_value->field_sI3.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 RAN__Information__Application__Container__SI3_template[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 RAN__Information__Application__Container__SI3_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Application__Container__SI3_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.RAN_Information_Application_Container_SI3.");
break;
}
set_selection(other_value);
}

RAN__Information__Application__Container__SI3_template::RAN__Information__Application__Container__SI3_template()
{
}

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

RAN__Information__Application__Container__SI3_template::RAN__Information__Application__Container__SI3_template(const RAN__Information__Application__Container__SI3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Application__Container__SI3_template::match(const RAN__Information__Application__Container__SI3& 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), legacy))return FALSE;
if(!other_value.sI3().is_bound()) return FALSE;
if(!single_value->field_sI3.match(other_value.sI3(), 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.RAN_Information_Application_Container_SI3.");
}
return FALSE;
}

boolean RAN__Information__Application__Container__SI3_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_reporting__Cell__Identifier.is_bound()
 || single_value->field_sI3.is_bound();
}

boolean RAN__Information__Application__Container__SI3_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_reporting__Cell__Identifier.is_value()
 && single_value->field_sI3.is_value();
}

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

RAN__Information__Application__Container__SI3 RAN__Information__Application__Container__SI3_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.RAN_Information_Application_Container_SI3.");
RAN__Information__Application__Container__SI3 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
if (single_value->field_sI3.is_bound()) {
ret_val.sI3() = single_value->field_sI3.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Application__Container__SI3_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Application__Container__SI3_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_SI3.");
return single_value->field_reporting__Cell__Identifier;
}

SI3_template& RAN__Information__Application__Container__SI3_template::sI3()
{
set_specific();
return single_value->field_sI3;
}

const SI3_template& RAN__Information__Application__Container__SI3_template::sI3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI3 of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_SI3.");
return single_value->field_sI3;
}

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

void RAN__Information__Application__Container__SI3_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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", sI3 := ");
single_value->field_sI3.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 RAN__Information__Application__Container__SI3_template::log_match(const RAN__Information__Application__Container__SI3& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sI3.match(match_value.sI3(), legacy)){
TTCN_Logger::log_logmatch_info(".sI3");
single_value->field_sI3.log_match(match_value.sI3(), 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", sI3 := ");
single_value->field_sI3.log_match(match_value.sI3(), 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 RAN__Information__Application__Container__SI3_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_reporting__Cell__Identifier.encode_text(text_buf);
single_value->field_sI3.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.RAN_Information_Application_Container_SI3.");
}
}

void RAN__Information__Application__Container__SI3_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_reporting__Cell__Identifier.decode_text(text_buf);
single_value->field_sI3.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 RAN__Information__Application__Container__SI3_template[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.RAN_Information_Application_Container_SI3.");
}
}

void RAN__Information__Application__Container__SI3_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: {
    RAN__Information__Application__Container__SI3_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.RAN_Information_Application_Container_SI3 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) reporting__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sI3().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(), "reporting_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reporting__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Application_Container_SI3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Application__Container__SI3_template* precondition = new RAN__Information__Application__Container__SI3_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__Application__Container__SI3_template* implied_template = new RAN__Information__Application__Container__SI3_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__Application__Container__SI3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_Application_Container_SI3");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Application__Container__SI3_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.RAN_Information_Application_Container_SI3");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SI3");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SI3");
single_value->field_reporting__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SI3");
single_value->field_sI3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SI3");
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.RAN_Information_Application_Container_SI3");
}

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

boolean RAN__Information__Application__Container__SI3_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 Application__Container__IE__SI3::copy_value(const Application__Container__IE__SI3& other_value)
{
switch (other_value.union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SI3(*other_value.field_rAN__Information__Request__Application__Container);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SI3(*other_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Application_Container_IE_SI3.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Application__Container__IE__SI3::operator==(const Application__Container__IE__SI3& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_SI3.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_SI3.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
return *field_rAN__Information__Request__Application__Container == *other_value.field_rAN__Information__Request__Application__Container;
case ALT_rAN__Information__Application__Container:
return *field_rAN__Information__Application__Container == *other_value.field_rAN__Information__Application__Container;
default:
return FALSE;
}
}

RAN__Information__Request__Application__Container__SI3& Application__Container__IE__SI3::rAN__Information__Request__Application__Container()
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) {
clean_up();
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SI3;
union_selection = ALT_rAN__Information__Request__Application__Container;
}
return *field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__SI3& Application__Container__IE__SI3::rAN__Information__Request__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) TTCN_error("Using non-selected field rAN_Information_Request_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_SI3.");
return *field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__SI3& Application__Container__IE__SI3::rAN__Information__Application__Container()
{
if (union_selection != ALT_rAN__Information__Application__Container) {
clean_up();
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SI3;
union_selection = ALT_rAN__Information__Application__Container;
}
return *field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__SI3& Application__Container__IE__SI3::rAN__Information__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Application__Container) TTCN_error("Using non-selected field rAN_Information_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_SI3.");
return *field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__SI3::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.Application_Container_IE_SI3.");
return union_selection == checked_selection;
}

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

boolean Application__Container__IE__SI3::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rAN__Information__Request__Application__Container: return field_rAN__Information__Request__Application__Container->is_value();
case ALT_rAN__Information__Application__Container: return field_rAN__Information__Application__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Application__Container__IE__SI3::clean_up()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
  delete field_rAN__Information__Request__Application__Container;
  break;
case ALT_rAN__Information__Application__Container:
  delete field_rAN__Information__Application__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Application__Container__IE__SI3::log() const
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
field_rAN__Information__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Application__Container__IE__SI3::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, "rAN_Information_Request_Application_Container")) {
    rAN__Information__Request__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Request__Application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rAN_Information_Application_Container")) {
    rAN__Information__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Application__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_SI3.", last_name);
}

void Application__Container__IE__SI3::set_implicit_omit()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->set_implicit_omit(); break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->set_implicit_omit(); break;
default: break;
}
}

void Application__Container__IE__SI3::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Application_Container_IE_SI3.");
}
}

void Application__Container__IE__SI3::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rAN__Information__Request__Application__Container:
rAN__Information__Request__Application__Container().decode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
rAN__Information__Application__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Application_Container_IE_SI3.");
}
}

void Application__Container__IE__SI3::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 Application__Container__IE__SI3::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 Application__Container__IE__SI3::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, RAN__Information__Request__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__SI3_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, RAN__Information__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__SI3_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, RAN__Information__Request__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__SI3_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, RAN__Information__Application__Container__SI3_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__SI3_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 Application__Container__IE__SI3::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_rAN__Information__Request__Application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Request__Application__Container__SI3_descr_.raw);
    encoded_length = field_rAN__Information__Request__Application__Container->RAW_encode(RAN__Information__Request__Application__Container__SI3_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Request__Application__Container__SI3_descr_;
    break;
  case ALT_rAN__Information__Application__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RAN__Information__Application__Container__SI3_descr_.raw);
    encoded_length = field_rAN__Information__Application__Container->RAW_encode(RAN__Information__Application__Container__SI3_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RAN__Information__Application__Container__SI3_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Application__Container__IE__SI3_template::copy_value(const Application__Container__IE__SI3& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SI3_template(other_value.rAN__Information__Request__Application__Container());
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SI3_template(other_value.rAN__Information__Application__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Application_Container_IE_SI3.");
}
set_selection(SPECIFIC_VALUE);
}

void Application__Container__IE__SI3_template::copy_template(const Application__Container__IE__SI3_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 Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SI3_template(*other_value.single_value.field_rAN__Information__Request__Application__Container);
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SI3_template(*other_value.single_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Application_Container_IE_SI3.");
}
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 Application__Container__IE__SI3_template[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 Application__Container__IE__SI3_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Container__IE__SI3_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.Application_Container_IE_SI3.");
}
set_selection(other_value);
}

Application__Container__IE__SI3_template::Application__Container__IE__SI3_template()
{
}

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

Application__Container__IE__SI3_template::Application__Container__IE__SI3_template(const Application__Container__IE__SI3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Application__Container__IE__SI3_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
delete single_value.field_rAN__Information__Request__Application__Container;
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
delete single_value.field_rAN__Information__Application__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;
}

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

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

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

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

boolean Application__Container__IE__SI3_template::match(const Application__Container__IE__SI3& 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:
{
Application__Container__IE__SI3::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Application__Container__IE__SI3::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->match(other_value.rAN__Information__Request__Application__Container(), legacy);
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__Container->match(other_value.rAN__Information__Application__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Application_Container_IE_SI3.");
}
}
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.Application_Container_IE_SI3.");
}
return FALSE;
}

boolean Application__Container__IE__SI3_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->is_value();
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__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.Application_Container_IE_SI3.");
}
}

Application__Container__IE__SI3 Application__Container__IE__SI3_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.Application_Container_IE_SI3.");
Application__Container__IE__SI3 ret_val;
switch (single_value.union_selection) {
case Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
ret_val.rAN__Information__Request__Application__Container() = single_value.field_rAN__Information__Request__Application__Container->valueof();
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
ret_val.rAN__Information__Application__Container() = single_value.field_rAN__Information__Application__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.Application_Container_IE_SI3.");
}
return ret_val;
}

Application__Container__IE__SI3_template& Application__Container__IE__SI3_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.Application_Container_IE_SI3.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Application_Container_IE_SI3.");
return value_list.list_value[list_index];
}
void Application__Container__IE__SI3_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.Application_Container_IE_SI3.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Application__Container__IE__SI3_template[list_length];
}

RAN__Information__Request__Application__Container__SI3_template& Application__Container__IE__SI3_template::rAN__Information__Request__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SI3_template(ANY_VALUE);
else single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SI3_template;
single_value.union_selection = Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__SI3_template& Application__Container__IE__SI3_template::rAN__Information__Request__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Request_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_SI3.");
if (single_value.union_selection != Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Request_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_SI3.");
return *single_value.field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__SI3_template& Application__Container__IE__SI3_template::rAN__Information__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__SI3::ALT_rAN__Information__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SI3_template(ANY_VALUE);
else single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SI3_template;
single_value.union_selection = Application__Container__IE__SI3::ALT_rAN__Information__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__SI3_template& Application__Container__IE__SI3_template::rAN__Information__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_SI3.");
if (single_value.union_selection != Application__Container__IE__SI3::ALT_rAN__Information__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_SI3.");
return *single_value.field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__SI3_template::ischosen(Application__Container__IE__SI3::union_selection_type checked_selection) const
{
if (checked_selection == Application__Container__IE__SI3::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Application_Container_IE_SI3.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Application__Container__IE__SI3::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Application_Container_IE_SI3.");
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.Application_Container_IE_SI3 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 Application__Container__IE__SI3_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__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 Application__Container__IE__SI3_template::log_match(const Application__Container__IE__SI3& 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 Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Request_Application_Container");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Application_Container");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__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 Application__Container__IE__SI3_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 Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__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.Application_Container_IE_SI3.");
}
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.Application_Container_IE_SI3.");
}
}

void Application__Container__IE__SI3_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Application__Container__IE__SI3::UNBOUND_VALUE;
Application__Container__IE__SI3::union_selection_type new_selection = (Application__Container__IE__SI3::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SI3_template;
single_value.field_rAN__Information__Request__Application__Container->decode_text(text_buf);
break;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SI3_template;
single_value.field_rAN__Information__Application__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Application_Container_IE_SI3.");
}
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 Application__Container__IE__SI3_template[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.Application_Container_IE_SI3.");
}
}

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

boolean Application__Container__IE__SI3_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 Application__Container__IE__SI3_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.Application_Container_IE_SI3'");
    }
    if (strcmp("rAN_Information_Request_Application_Container", param_field) == 0) {
      rAN__Information__Request__Application__Container().set_param(param);
      return;
    } else if (strcmp("rAN_Information_Application_Container", param_field) == 0) {
      rAN__Information__Application__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Application_Container_IE_SI3'", 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: {
    Application__Container__IE__SI3_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.Application_Container_IE_SI3");
    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, "rAN_Information_Request_Application_Container")) {
      rAN__Information__Request__Application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rAN_Information_Application_Container")) {
      rAN__Information__Application__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_SI3.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Container__IE__SI3_template* precondition = new Application__Container__IE__SI3_template;
    precondition->set_param(*m_p->get_elem(0));
    Application__Container__IE__SI3_template* implied_template = new Application__Container__IE__SI3_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Application__Container__IE__SI3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Application_Container_IE_SI3");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Container__IE__SI3_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 Application__Container__IE__SI3::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_SI3");
return;
case Application__Container__IE__SI3::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_SI3");
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.Application_Container_IE_SI3.");
}
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.Application_Container_IE_SI3");
}

Application__Error__Container__SI3::Application__Error__Container__SI3()
{
}

Application__Error__Container__SI3::Application__Error__Container__SI3(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_sI3__cause,
    const Application__Container__IE__SI3& par_erroneousApplicationContainer)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_sI3__cause(par_sI3__cause),
  field_erroneousApplicationContainer(par_erroneousApplicationContainer)
{
}

Application__Error__Container__SI3::Application__Error__Container__SI3(const Application__Error__Container__SI3& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Application_Error_Container_SI3.");
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.sI3__cause().is_bound()) field_sI3__cause = other_value.sI3__cause();
else field_sI3__cause.clean_up();
if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
else field_erroneousApplicationContainer.clean_up();
}

void Application__Error__Container__SI3::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_sI3__cause.clean_up();
field_erroneousApplicationContainer.clean_up();
}

const TTCN_Typedescriptor_t* Application__Error__Container__SI3::get_descriptor() const { return &Application__Error__Container__SI3_descr_; }
Application__Error__Container__SI3& Application__Error__Container__SI3::operator=(const Application__Error__Container__SI3& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Application_Error_Container_SI3.");
  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.sI3__cause().is_bound()) field_sI3__cause = other_value.sI3__cause();
  else field_sI3__cause.clean_up();
  if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
  else field_erroneousApplicationContainer.clean_up();
}
return *this;
}

boolean Application__Error__Container__SI3::operator==(const Application__Error__Container__SI3& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_sI3__cause==other_value.field_sI3__cause
  && field_erroneousApplicationContainer==other_value.field_erroneousApplicationContainer;
}

boolean Application__Error__Container__SI3::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_sI3__cause.is_bound())
  || (field_erroneousApplicationContainer.is_bound());
}
boolean Application__Error__Container__SI3::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_sI3__cause.is_value()
  && field_erroneousApplicationContainer.is_value();
}
void Application__Error__Container__SI3::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(", sI3_cause := ");
field_sI3__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
field_erroneousApplicationContainer.log();
TTCN_Logger::log_event_str(" }");
}

void Application__Error__Container__SI3::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 (sI3__cause().is_bound()) sI3__cause().set_implicit_omit();
if (erroneousApplicationContainer().is_bound()) erroneousApplicationContainer().set_implicit_omit();
}

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

void Application__Error__Container__SI3::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_sI3__cause.encode_text(text_buf);
field_erroneousApplicationContainer.encode_text(text_buf);
}

void Application__Error__Container__SI3::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_sI3__cause.decode_text(text_buf);
field_erroneousApplicationContainer.decode_text(text_buf);
}

void Application__Error__Container__SI3::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 Application__Error__Container__SI3::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 Application__Error__Container__SI3::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, Application__Error__Container__SI3_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Application__Error__Container__SI3_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, Application__Error__Container__SI3_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Application__Error__Container__SI3_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_sI3__cause.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;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Application__Container__IE__SI3_descr_.raw->forceomit);
  decoded_field_length = field_erroneousApplicationContainer.RAW_decode(Application__Container__IE__SI3_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_81) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Application__Error__Container__SI3::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, Application__Error__Container__SI3_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Application__Error__Container__SI3_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Application__Container__IE__SI3_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Application__Error__Container__SI3_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Application__Error__Container__SI3_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_sI3__cause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_erroneousApplicationContainer.RAW_encode(Application__Container__IE__SI3_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(Application__Error__Container__SI3_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(Application__Error__Container__SI3_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_81) {
  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_81.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 Application__Error__Container__SI3_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_sI3__cause;
Application__Container__IE__SI3_template field_erroneousApplicationContainer;
};

void Application__Error__Container__SI3_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_sI3__cause = ANY_VALUE;
single_value->field_erroneousApplicationContainer = ANY_VALUE;
}
}
}

void Application__Error__Container__SI3_template::copy_value(const Application__Error__Container__SI3& 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.sI3__cause().is_bound()) {
  single_value->field_sI3__cause = other_value.sI3__cause();
} else {
  single_value->field_sI3__cause.clean_up();
}
if (other_value.erroneousApplicationContainer().is_bound()) {
  single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
  single_value->field_erroneousApplicationContainer.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Application__Error__Container__SI3_template::copy_template(const Application__Error__Container__SI3_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.sI3__cause().get_selection()) {
single_value->field_sI3__cause = other_value.sI3__cause();
} else {
single_value->field_sI3__cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.erroneousApplicationContainer().get_selection()) {
single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__SI3_template[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 Application__Error__Container__SI3_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Error__Container__SI3_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.Application_Error_Container_SI3.");
break;
}
set_selection(other_value);
}

Application__Error__Container__SI3_template::Application__Error__Container__SI3_template()
{
}

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

Application__Error__Container__SI3_template::Application__Error__Container__SI3_template(const Application__Error__Container__SI3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Application__Error__Container__SI3_template::match(const Application__Error__Container__SI3& 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.sI3__cause().is_bound()) return FALSE;
if(!single_value->field_sI3__cause.match(other_value.sI3__cause(), legacy))return FALSE;
if(!other_value.erroneousApplicationContainer().is_bound()) return FALSE;
if(!single_value->field_erroneousApplicationContainer.match(other_value.erroneousApplicationContainer(), 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.Application_Error_Container_SI3.");
}
return FALSE;
}

boolean Application__Error__Container__SI3_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_sI3__cause.is_bound()
 || single_value->field_erroneousApplicationContainer.is_bound();
}

boolean Application__Error__Container__SI3_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_sI3__cause.is_value()
 && single_value->field_erroneousApplicationContainer.is_value();
}

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

Application__Error__Container__SI3 Application__Error__Container__SI3_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.Application_Error_Container_SI3.");
Application__Error__Container__SI3 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_sI3__cause.is_bound()) {
ret_val.sI3__cause() = single_value->field_sI3__cause.valueof();
}
if (single_value->field_erroneousApplicationContainer.is_bound()) {
ret_val.erroneousApplicationContainer() = single_value->field_erroneousApplicationContainer.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& Application__Error__Container__SI3_template::sI3__cause()
{
set_specific();
return single_value->field_sI3__cause;
}

const OCTETSTRING_template& Application__Error__Container__SI3_template::sI3__cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI3_cause of a non-specific template of type @BSSGP_Types.Application_Error_Container_SI3.");
return single_value->field_sI3__cause;
}

Application__Container__IE__SI3_template& Application__Error__Container__SI3_template::erroneousApplicationContainer()
{
set_specific();
return single_value->field_erroneousApplicationContainer;
}

const Application__Container__IE__SI3_template& Application__Error__Container__SI3_template::erroneousApplicationContainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field erroneousApplicationContainer of a non-specific template of type @BSSGP_Types.Application_Error_Container_SI3.");
return single_value->field_erroneousApplicationContainer;
}

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

void Application__Error__Container__SI3_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(", sI3_cause := ");
single_value->field_sI3__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__SI3_template::log_match(const Application__Error__Container__SI3& 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_sI3__cause.match(match_value.sI3__cause(), legacy)){
TTCN_Logger::log_logmatch_info(".sI3_cause");
single_value->field_sI3__cause.log_match(match_value.sI3__cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_erroneousApplicationContainer.match(match_value.erroneousApplicationContainer(), legacy)){
TTCN_Logger::log_logmatch_info(".erroneousApplicationContainer");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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(", sI3_cause := ");
single_value->field_sI3__cause.log_match(match_value.sI3__cause(), legacy);
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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 Application__Error__Container__SI3_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_sI3__cause.encode_text(text_buf);
single_value->field_erroneousApplicationContainer.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.Application_Error_Container_SI3.");
}
}

void Application__Error__Container__SI3_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_sI3__cause.decode_text(text_buf);
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__SI3_template[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.Application_Error_Container_SI3.");
}
}

void Application__Error__Container__SI3_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: {
    Application__Error__Container__SI3_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.Application_Error_Container_SI3 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) sI3__cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) erroneousApplicationContainer().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(), "sI3_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI3__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "erroneousApplicationContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          erroneousApplicationContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Application_Error_Container_SI3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Error__Container__SI3_template* precondition = new Application__Error__Container__SI3_template;
    precondition->set_param(*param.get_elem(0));
    Application__Error__Container__SI3_template* implied_template = new Application__Error__Container__SI3_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Application__Error__Container__SI3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Application_Error_Container_SI3");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Error__Container__SI3_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.Application_Error_Container_SI3");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SI3");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SI3");
single_value->field_sI3__cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SI3");
single_value->field_erroneousApplicationContainer.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SI3");
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.Application_Error_Container_SI3");
}

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

boolean Application__Error__Container__SI3_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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::copy_value(const ApplContainer__or__ApplErrContainer__MBMS__data__channel& other_value)
{
switch (other_value.union_selection) {
case ALT_application__Container:
field_application__Container = new RAN__Information__Application__Container__MBMS__data__channel(*other_value.field_application__Container);
break;
case ALT_application__Error__Container:
field_application__Error__Container = new Application__Error__Container__MBMS__data__channel(*other_value.field_application__Error__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer__MBMS__data__channel::operator==(const ApplContainer__or__ApplErrContainer__MBMS__data__channel& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_application__Container:
return *field_application__Container == *other_value.field_application__Container;
case ALT_application__Error__Container:
return *field_application__Error__Container == *other_value.field_application__Error__Container;
default:
return FALSE;
}
}

RAN__Information__Application__Container__MBMS__data__channel& ApplContainer__or__ApplErrContainer__MBMS__data__channel::application__Container()
{
if (union_selection != ALT_application__Container) {
clean_up();
field_application__Container = new RAN__Information__Application__Container__MBMS__data__channel;
union_selection = ALT_application__Container;
}
return *field_application__Container;
}

const RAN__Information__Application__Container__MBMS__data__channel& ApplContainer__or__ApplErrContainer__MBMS__data__channel::application__Container() const
{
if (union_selection != ALT_application__Container) TTCN_error("Using non-selected field application_Container in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
return *field_application__Container;
}

Application__Error__Container__MBMS__data__channel& ApplContainer__or__ApplErrContainer__MBMS__data__channel::application__Error__Container()
{
if (union_selection != ALT_application__Error__Container) {
clean_up();
field_application__Error__Container = new Application__Error__Container__MBMS__data__channel;
union_selection = ALT_application__Error__Container;
}
return *field_application__Error__Container;
}

const Application__Error__Container__MBMS__data__channel& ApplContainer__or__ApplErrContainer__MBMS__data__channel::application__Error__Container() const
{
if (union_selection != ALT_application__Error__Container) TTCN_error("Using non-selected field application_Error_Container in a value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
return *field_application__Error__Container;
}

boolean ApplContainer__or__ApplErrContainer__MBMS__data__channel::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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
return union_selection == checked_selection;
}

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

boolean ApplContainer__or__ApplErrContainer__MBMS__data__channel::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_application__Container: return field_application__Container->is_value();
case ALT_application__Error__Container: return field_application__Error__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel::clean_up()
{
switch (union_selection) {
case ALT_application__Container:
  delete field_application__Container;
  break;
case ALT_application__Error__Container:
  delete field_application__Error__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel::log() const
{
switch (union_selection) {
case ALT_application__Container:
TTCN_Logger::log_event_str("{ application_Container := ");
field_application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_application__Error__Container:
TTCN_Logger::log_event_str("{ application_Error_Container := ");
field_application__Error__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel::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, "application_Container")) {
    application__Container().set_param(*mp_last);
    if (!application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "application_Error_Container")) {
    application__Error__Container().set_param(*mp_last);
    if (!application__Error__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.", last_name);
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel::set_implicit_omit()
{
switch (union_selection) {
case ALT_application__Container:
field_application__Container->set_implicit_omit(); break;
case ALT_application__Error__Container:
field_application__Error__Container->set_implicit_omit(); break;
default: break;
}
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_application__Container:
field_application__Container->encode_text(text_buf);
break;
case ALT_application__Error__Container:
field_application__Error__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_application__Container:
application__Container().decode_text(text_buf);
break;
case ALT_application__Error__Container:
application__Error__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel::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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::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, RAN__Information__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = application__Container().RAW_decode(RAN__Information__Application__Container__MBMS__data__channel_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, Application__Error__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = application__Error__Container().RAW_decode(Application__Error__Container__MBMS__data__channel_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, RAN__Information__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = application__Container().RAW_decode(RAN__Information__Application__Container__MBMS__data__channel_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, Application__Error__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = application__Error__Container().RAW_decode(Application__Error__Container__MBMS__data__channel_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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::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_application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Application__Container__MBMS__data__channel_descr_.raw);
    encoded_length = field_application__Container->RAW_encode(RAN__Information__Application__Container__MBMS__data__channel_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Application__Container__MBMS__data__channel_descr_;
    break;
  case ALT_application__Error__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, Application__Error__Container__MBMS__data__channel_descr_.raw);
    encoded_length = field_application__Error__Container->RAW_encode(Application__Error__Container__MBMS__data__channel_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &Application__Error__Container__MBMS__data__channel_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::copy_value(const ApplContainer__or__ApplErrContainer__MBMS__data__channel& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template(other_value.application__Container());
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__MBMS__data__channel_template(other_value.application__Error__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
set_selection(SPECIFIC_VALUE);
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::copy_template(const ApplContainer__or__ApplErrContainer__MBMS__data__channel_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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template(*other_value.single_value.field_application__Container);
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__MBMS__data__channel_template(*other_value.single_value.field_application__Error__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
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 ApplContainer__or__ApplErrContainer__MBMS__data__channel_template[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 ApplContainer__or__ApplErrContainer__MBMS__data__channel_template(*other_value.implication_.precondition);
implication_.implied_template = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
set_selection(other_value);
}

ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::ApplContainer__or__ApplErrContainer__MBMS__data__channel_template()
{
}

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

ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::ApplContainer__or__ApplErrContainer__MBMS__data__channel_template(const ApplContainer__or__ApplErrContainer__MBMS__data__channel& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
delete single_value.field_application__Container;
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
delete single_value.field_application__Error__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;
}

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

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

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

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

boolean ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::match(const ApplContainer__or__ApplErrContainer__MBMS__data__channel& 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:
{
ApplContainer__or__ApplErrContainer__MBMS__data__channel::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ApplContainer__or__ApplErrContainer__MBMS__data__channel::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
return single_value.field_application__Container->match(other_value.application__Container(), legacy);
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
return single_value.field_application__Error__Container->match(other_value.application__Error__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
}
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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
return FALSE;
}

boolean ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
return single_value.field_application__Container->is_value();
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
return single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
}

ApplContainer__or__ApplErrContainer__MBMS__data__channel ApplContainer__or__ApplErrContainer__MBMS__data__channel_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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
ApplContainer__or__ApplErrContainer__MBMS__data__channel ret_val;
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
ret_val.application__Container() = single_value.field_application__Container->valueof();
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
ret_val.application__Error__Container() = single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
return ret_val;
}

ApplContainer__or__ApplErrContainer__MBMS__data__channel_template& ApplContainer__or__ApplErrContainer__MBMS__data__channel_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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
return value_list.list_value[list_index];
}
void ApplContainer__or__ApplErrContainer__MBMS__data__channel_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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template[list_length];
}

RAN__Information__Application__Container__MBMS__data__channel_template& ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template(ANY_VALUE);
else single_value.field_application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_application__Container;
}

const RAN__Information__Application__Container__MBMS__data__channel_template& ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field application_Container in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container) TTCN_error("Accessing non-selected field application_Container in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
return *single_value.field_application__Container;
}

Application__Error__Container__MBMS__data__channel_template& ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::application__Error__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_application__Error__Container = new Application__Error__Container__MBMS__data__channel_template(ANY_VALUE);
else single_value.field_application__Error__Container = new Application__Error__Container__MBMS__data__channel_template;
single_value.union_selection = ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_application__Error__Container;
}

const Application__Error__Container__MBMS__data__channel_template& ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::application__Error__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field application_Error_Container in a non-specific template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
if (single_value.union_selection != ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container) TTCN_error("Accessing non-selected field application_Error_Container in a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
return *single_value.field_application__Error__Container;
}

boolean ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::ischosen(ApplContainer__or__ApplErrContainer__MBMS__data__channel::union_selection_type checked_selection) const
{
if (checked_selection == ApplContainer__or__ApplErrContainer__MBMS__data__channel::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ApplContainer__or__ApplErrContainer__MBMS__data__channel::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
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.ApplContainer_or_ApplErrContainer_MBMS_data_channel 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 ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
TTCN_Logger::log_event_str("{ application_Container := ");
single_value.field_application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
TTCN_Logger::log_event_str("{ application_Error_Container := ");
single_value.field_application__Error__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 ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::log_match(const ApplContainer__or__ApplErrContainer__MBMS__data__channel& 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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".application_Container");
single_value.field_application__Container->log_match(match_value.application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ application_Container := ");
single_value.field_application__Container->log_match(match_value.application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".application_Error_Container");
single_value.field_application__Error__Container->log_match(match_value.application__Error__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ application_Error_Container := ");
single_value.field_application__Error__Container->log_match(match_value.application__Error__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 ApplContainer__or__ApplErrContainer__MBMS__data__channel_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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
single_value.field_application__Container->encode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
single_value.field_application__Error__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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ApplContainer__or__ApplErrContainer__MBMS__data__channel::UNBOUND_VALUE;
ApplContainer__or__ApplErrContainer__MBMS__data__channel::union_selection_type new_selection = (ApplContainer__or__ApplErrContainer__MBMS__data__channel::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
single_value.field_application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template;
single_value.field_application__Container->decode_text(text_buf);
break;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
single_value.field_application__Error__Container = new Application__Error__Container__MBMS__data__channel_template;
single_value.field_application__Error__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
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 ApplContainer__or__ApplErrContainer__MBMS__data__channel_template[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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
}

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

boolean ApplContainer__or__ApplErrContainer__MBMS__data__channel_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 ApplContainer__or__ApplErrContainer__MBMS__data__channel_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.ApplContainer_or_ApplErrContainer_MBMS_data_channel'");
    }
    if (strcmp("application_Container", param_field) == 0) {
      application__Container().set_param(param);
      return;
    } else if (strcmp("application_Error_Container", param_field) == 0) {
      application__Error__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel'", 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: {
    ApplContainer__or__ApplErrContainer__MBMS__data__channel_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.ApplContainer_or_ApplErrContainer_MBMS_data_channel");
    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, "application_Container")) {
      application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "application_Error_Container")) {
      application__Error__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    ApplContainer__or__ApplErrContainer__MBMS__data__channel_template* precondition = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template;
    precondition->set_param(*m_p->get_elem(0));
    ApplContainer__or__ApplErrContainer__MBMS__data__channel_template* implied_template = new ApplContainer__or__ApplErrContainer__MBMS__data__channel_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = ApplContainer__or__ApplErrContainer__MBMS__data__channel_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel");
  }
  is_ifpresent = param.get_ifpresent();
}

void ApplContainer__or__ApplErrContainer__MBMS__data__channel_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 ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Container:
single_value.field_application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel");
return;
case ApplContainer__or__ApplErrContainer__MBMS__data__channel::ALT_application__Error__Container:
single_value.field_application__Error__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ApplContainer_or_ApplErrContainer_MBMS_data_channel");
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.ApplContainer_or_ApplErrContainer_MBMS_data_channel.");
}
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.ApplContainer_or_ApplErrContainer_MBMS_data_channel");
}

RAN__Information__Application__Container__MBMS__data__channel::RAN__Information__Application__Container__MBMS__data__channel()
{
}

RAN__Information__Application__Container__MBMS__data__channel::RAN__Information__Application__Container__MBMS__data__channel(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier,
    const OCTETSTRING& par_mBMS__data__channel__report)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier),
  field_mBMS__data__channel__report(par_mBMS__data__channel__report)
{
}

RAN__Information__Application__Container__MBMS__data__channel::RAN__Information__Application__Container__MBMS__data__channel(const RAN__Information__Application__Container__MBMS__data__channel& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel.");
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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
else field_reporting__Cell__Identifier.clean_up();
if (other_value.mBMS__data__channel__report().is_bound()) field_mBMS__data__channel__report = other_value.mBMS__data__channel__report();
else field_mBMS__data__channel__report.clean_up();
}

void RAN__Information__Application__Container__MBMS__data__channel::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
field_mBMS__data__channel__report.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Application__Container__MBMS__data__channel::get_descriptor() const { return &RAN__Information__Application__Container__MBMS__data__channel_descr_; }
RAN__Information__Application__Container__MBMS__data__channel& RAN__Information__Application__Container__MBMS__data__channel::operator=(const RAN__Information__Application__Container__MBMS__data__channel& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel.");
  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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
  else field_reporting__Cell__Identifier.clean_up();
  if (other_value.mBMS__data__channel__report().is_bound()) field_mBMS__data__channel__report = other_value.mBMS__data__channel__report();
  else field_mBMS__data__channel__report.clean_up();
}
return *this;
}

boolean RAN__Information__Application__Container__MBMS__data__channel::operator==(const RAN__Information__Application__Container__MBMS__data__channel& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reporting__Cell__Identifier==other_value.field_reporting__Cell__Identifier
  && field_mBMS__data__channel__report==other_value.field_mBMS__data__channel__report;
}

boolean RAN__Information__Application__Container__MBMS__data__channel::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reporting__Cell__Identifier.is_bound())
  || (field_mBMS__data__channel__report.is_bound());
}
boolean RAN__Information__Application__Container__MBMS__data__channel::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reporting__Cell__Identifier.is_value()
  && field_mBMS__data__channel__report.is_value();
}
void RAN__Information__Application__Container__MBMS__data__channel::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(", reporting_Cell_Identifier := ");
field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", mBMS_data_channel_report := ");
field_mBMS__data__channel__report.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Application__Container__MBMS__data__channel::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 (reporting__Cell__Identifier().is_bound()) reporting__Cell__Identifier().set_implicit_omit();
if (mBMS__data__channel__report().is_bound()) mBMS__data__channel__report().set_implicit_omit();
}

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

void RAN__Information__Application__Container__MBMS__data__channel::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_reporting__Cell__Identifier.encode_text(text_buf);
field_mBMS__data__channel__report.encode_text(text_buf);
}

void RAN__Information__Application__Container__MBMS__data__channel::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_reporting__Cell__Identifier.decode_text(text_buf);
field_mBMS__data__channel__report.decode_text(text_buf);
}

void RAN__Information__Application__Container__MBMS__data__channel::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 RAN__Information__Application__Container__MBMS__data__channel::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 RAN__Information__Application__Container__MBMS__data__channel::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, RAN__Information__Application__Container__MBMS__data__channel_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Application__Container__MBMS__data__channel_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, RAN__Information__Application__Container__MBMS__data__channel_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Application__Container__MBMS__data__channel_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__data__channel__report.RAW_decode(OCTETSTRING_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_136) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Application__Container__MBMS__data__channel::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, RAN__Information__Application__Container__MBMS__data__channel_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Application__Container__MBMS__data__channel_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, OCTETSTRING_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Application__Container__MBMS__data__channel_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Application__Container__MBMS__data__channel_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mBMS__data__channel__report.RAW_encode(OCTETSTRING_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(RAN__Information__Application__Container__MBMS__data__channel_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(RAN__Information__Application__Container__MBMS__data__channel_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_136) {
  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_136.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 RAN__Information__Application__Container__MBMS__data__channel_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
OCTETSTRING_template field_mBMS__data__channel__report;
};

void RAN__Information__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier = ANY_VALUE;
single_value->field_mBMS__data__channel__report = ANY_VALUE;
}
}
}

void RAN__Information__Application__Container__MBMS__data__channel_template::copy_value(const RAN__Information__Application__Container__MBMS__data__channel& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
if (other_value.mBMS__data__channel__report().is_bound()) {
  single_value->field_mBMS__data__channel__report = other_value.mBMS__data__channel__report();
} else {
  single_value->field_mBMS__data__channel__report.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Application__Container__MBMS__data__channel_template::copy_template(const RAN__Information__Application__Container__MBMS__data__channel_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__data__channel__report().get_selection()) {
single_value->field_mBMS__data__channel__report = other_value.mBMS__data__channel__report();
} else {
single_value->field_mBMS__data__channel__report.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 RAN__Information__Application__Container__MBMS__data__channel_template[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 RAN__Information__Application__Container__MBMS__data__channel_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Application__Container__MBMS__data__channel_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.RAN_Information_Application_Container_MBMS_data_channel.");
break;
}
set_selection(other_value);
}

RAN__Information__Application__Container__MBMS__data__channel_template::RAN__Information__Application__Container__MBMS__data__channel_template()
{
}

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

RAN__Information__Application__Container__MBMS__data__channel_template::RAN__Information__Application__Container__MBMS__data__channel_template(const RAN__Information__Application__Container__MBMS__data__channel& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Application__Container__MBMS__data__channel_template::match(const RAN__Information__Application__Container__MBMS__data__channel& 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), legacy))return FALSE;
if(!other_value.mBMS__data__channel__report().is_bound()) return FALSE;
if(!single_value->field_mBMS__data__channel__report.match(other_value.mBMS__data__channel__report(), 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.RAN_Information_Application_Container_MBMS_data_channel.");
}
return FALSE;
}

boolean RAN__Information__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.is_bound()
 || single_value->field_mBMS__data__channel__report.is_bound();
}

boolean RAN__Information__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.is_value()
 && single_value->field_mBMS__data__channel__report.is_value();
}

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

RAN__Information__Application__Container__MBMS__data__channel RAN__Information__Application__Container__MBMS__data__channel_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.RAN_Information_Application_Container_MBMS_data_channel.");
RAN__Information__Application__Container__MBMS__data__channel 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
if (single_value->field_mBMS__data__channel__report.is_bound()) {
ret_val.mBMS__data__channel__report() = single_value->field_mBMS__data__channel__report.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Application__Container__MBMS__data__channel_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Application__Container__MBMS__data__channel_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel.");
return single_value->field_reporting__Cell__Identifier;
}

OCTETSTRING_template& RAN__Information__Application__Container__MBMS__data__channel_template::mBMS__data__channel__report()
{
set_specific();
return single_value->field_mBMS__data__channel__report;
}

const OCTETSTRING_template& RAN__Information__Application__Container__MBMS__data__channel_template::mBMS__data__channel__report() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_data_channel_report of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel.");
return single_value->field_mBMS__data__channel__report;
}

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

void RAN__Information__Application__Container__MBMS__data__channel_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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", mBMS_data_channel_report := ");
single_value->field_mBMS__data__channel__report.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 RAN__Information__Application__Container__MBMS__data__channel_template::log_match(const RAN__Information__Application__Container__MBMS__data__channel& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS__data__channel__report.match(match_value.mBMS__data__channel__report(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_data_channel_report");
single_value->field_mBMS__data__channel__report.log_match(match_value.mBMS__data__channel__report(), 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", mBMS_data_channel_report := ");
single_value->field_mBMS__data__channel__report.log_match(match_value.mBMS__data__channel__report(), 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 RAN__Information__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.encode_text(text_buf);
single_value->field_mBMS__data__channel__report.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.RAN_Information_Application_Container_MBMS_data_channel.");
}
}

void RAN__Information__Application__Container__MBMS__data__channel_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_reporting__Cell__Identifier.decode_text(text_buf);
single_value->field_mBMS__data__channel__report.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 RAN__Information__Application__Container__MBMS__data__channel_template[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.RAN_Information_Application_Container_MBMS_data_channel.");
}
}

void RAN__Information__Application__Container__MBMS__data__channel_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: {
    RAN__Information__Application__Container__MBMS__data__channel_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.RAN_Information_Application_Container_MBMS_data_channel 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) reporting__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mBMS__data__channel__report().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(), "reporting_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reporting__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_data_channel_report")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__data__channel__report().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Application_Container_MBMS_data_channel: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Application__Container__MBMS__data__channel_template* precondition = new RAN__Information__Application__Container__MBMS__data__channel_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__Application__Container__MBMS__data__channel_template* implied_template = new RAN__Information__Application__Container__MBMS__data__channel_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__Application__Container__MBMS__data__channel_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Application__Container__MBMS__data__channel_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.RAN_Information_Application_Container_MBMS_data_channel");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel");
single_value->field_reporting__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel");
single_value->field_mBMS__data__channel__report.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_MBMS_data_channel");
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.RAN_Information_Application_Container_MBMS_data_channel");
}

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

boolean RAN__Information__Application__Container__MBMS__data__channel_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 Application__Container__IE__MBMS__data__channel::copy_value(const Application__Container__IE__MBMS__data__channel& other_value)
{
switch (other_value.union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__MBMS__data__channel(*other_value.field_rAN__Information__Request__Application__Container);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__MBMS__data__channel(*other_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Application__Container__IE__MBMS__data__channel::operator==(const Application__Container__IE__MBMS__data__channel& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
return *field_rAN__Information__Request__Application__Container == *other_value.field_rAN__Information__Request__Application__Container;
case ALT_rAN__Information__Application__Container:
return *field_rAN__Information__Application__Container == *other_value.field_rAN__Information__Application__Container;
default:
return FALSE;
}
}

RAN__Information__Request__Application__Container__MBMS__data__channel& Application__Container__IE__MBMS__data__channel::rAN__Information__Request__Application__Container()
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) {
clean_up();
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__MBMS__data__channel;
union_selection = ALT_rAN__Information__Request__Application__Container;
}
return *field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__MBMS__data__channel& Application__Container__IE__MBMS__data__channel::rAN__Information__Request__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) TTCN_error("Using non-selected field rAN_Information_Request_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
return *field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__MBMS__data__channel& Application__Container__IE__MBMS__data__channel::rAN__Information__Application__Container()
{
if (union_selection != ALT_rAN__Information__Application__Container) {
clean_up();
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__MBMS__data__channel;
union_selection = ALT_rAN__Information__Application__Container;
}
return *field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__MBMS__data__channel& Application__Container__IE__MBMS__data__channel::rAN__Information__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Application__Container) TTCN_error("Using non-selected field rAN_Information_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
return *field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__MBMS__data__channel::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.Application_Container_IE_MBMS_data_channel.");
return union_selection == checked_selection;
}

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

boolean Application__Container__IE__MBMS__data__channel::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rAN__Information__Request__Application__Container: return field_rAN__Information__Request__Application__Container->is_value();
case ALT_rAN__Information__Application__Container: return field_rAN__Information__Application__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Application__Container__IE__MBMS__data__channel::clean_up()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
  delete field_rAN__Information__Request__Application__Container;
  break;
case ALT_rAN__Information__Application__Container:
  delete field_rAN__Information__Application__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Application__Container__IE__MBMS__data__channel::log() const
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
field_rAN__Information__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Application__Container__IE__MBMS__data__channel::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, "rAN_Information_Request_Application_Container")) {
    rAN__Information__Request__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Request__Application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rAN_Information_Application_Container")) {
    rAN__Information__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Application__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.", last_name);
}

void Application__Container__IE__MBMS__data__channel::set_implicit_omit()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->set_implicit_omit(); break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->set_implicit_omit(); break;
default: break;
}
}

void Application__Container__IE__MBMS__data__channel::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
}
}

void Application__Container__IE__MBMS__data__channel::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rAN__Information__Request__Application__Container:
rAN__Information__Request__Application__Container().decode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
rAN__Information__Application__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
}
}

void Application__Container__IE__MBMS__data__channel::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 Application__Container__IE__MBMS__data__channel::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 Application__Container__IE__MBMS__data__channel::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, RAN__Information__Request__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__MBMS__data__channel_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, RAN__Information__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__MBMS__data__channel_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, RAN__Information__Request__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__MBMS__data__channel_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, RAN__Information__Application__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__MBMS__data__channel_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 Application__Container__IE__MBMS__data__channel::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_rAN__Information__Request__Application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Request__Application__Container__MBMS__data__channel_descr_.raw);
    encoded_length = field_rAN__Information__Request__Application__Container->RAW_encode(RAN__Information__Request__Application__Container__MBMS__data__channel_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Request__Application__Container__MBMS__data__channel_descr_;
    break;
  case ALT_rAN__Information__Application__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RAN__Information__Application__Container__MBMS__data__channel_descr_.raw);
    encoded_length = field_rAN__Information__Application__Container->RAW_encode(RAN__Information__Application__Container__MBMS__data__channel_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RAN__Information__Application__Container__MBMS__data__channel_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Application__Container__IE__MBMS__data__channel_template::copy_value(const Application__Container__IE__MBMS__data__channel& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__MBMS__data__channel_template(other_value.rAN__Information__Request__Application__Container());
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template(other_value.rAN__Information__Application__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
}
set_selection(SPECIFIC_VALUE);
}

void Application__Container__IE__MBMS__data__channel_template::copy_template(const Application__Container__IE__MBMS__data__channel_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 Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__MBMS__data__channel_template(*other_value.single_value.field_rAN__Information__Request__Application__Container);
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template(*other_value.single_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
}
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 Application__Container__IE__MBMS__data__channel_template[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 Application__Container__IE__MBMS__data__channel_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Container__IE__MBMS__data__channel_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.Application_Container_IE_MBMS_data_channel.");
}
set_selection(other_value);
}

Application__Container__IE__MBMS__data__channel_template::Application__Container__IE__MBMS__data__channel_template()
{
}

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

Application__Container__IE__MBMS__data__channel_template::Application__Container__IE__MBMS__data__channel_template(const Application__Container__IE__MBMS__data__channel& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Application__Container__IE__MBMS__data__channel_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
delete single_value.field_rAN__Information__Request__Application__Container;
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
delete single_value.field_rAN__Information__Application__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;
}

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

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

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

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

boolean Application__Container__IE__MBMS__data__channel_template::match(const Application__Container__IE__MBMS__data__channel& 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:
{
Application__Container__IE__MBMS__data__channel::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Application__Container__IE__MBMS__data__channel::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->match(other_value.rAN__Information__Request__Application__Container(), legacy);
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__Container->match(other_value.rAN__Information__Application__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
}
}
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.Application_Container_IE_MBMS_data_channel.");
}
return FALSE;
}

boolean Application__Container__IE__MBMS__data__channel_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->is_value();
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__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.Application_Container_IE_MBMS_data_channel.");
}
}

Application__Container__IE__MBMS__data__channel Application__Container__IE__MBMS__data__channel_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.Application_Container_IE_MBMS_data_channel.");
Application__Container__IE__MBMS__data__channel ret_val;
switch (single_value.union_selection) {
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
ret_val.rAN__Information__Request__Application__Container() = single_value.field_rAN__Information__Request__Application__Container->valueof();
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
ret_val.rAN__Information__Application__Container() = single_value.field_rAN__Information__Application__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.Application_Container_IE_MBMS_data_channel.");
}
return ret_val;
}

Application__Container__IE__MBMS__data__channel_template& Application__Container__IE__MBMS__data__channel_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.Application_Container_IE_MBMS_data_channel.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
return value_list.list_value[list_index];
}
void Application__Container__IE__MBMS__data__channel_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.Application_Container_IE_MBMS_data_channel.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Application__Container__IE__MBMS__data__channel_template[list_length];
}

RAN__Information__Request__Application__Container__MBMS__data__channel_template& Application__Container__IE__MBMS__data__channel_template::rAN__Information__Request__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__MBMS__data__channel_template(ANY_VALUE);
else single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__MBMS__data__channel_template;
single_value.union_selection = Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__MBMS__data__channel_template& Application__Container__IE__MBMS__data__channel_template::rAN__Information__Request__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Request_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
if (single_value.union_selection != Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Request_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
return *single_value.field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__MBMS__data__channel_template& Application__Container__IE__MBMS__data__channel_template::rAN__Information__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template(ANY_VALUE);
else single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template;
single_value.union_selection = Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__MBMS__data__channel_template& Application__Container__IE__MBMS__data__channel_template::rAN__Information__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
if (single_value.union_selection != Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
return *single_value.field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__MBMS__data__channel_template::ischosen(Application__Container__IE__MBMS__data__channel::union_selection_type checked_selection) const
{
if (checked_selection == Application__Container__IE__MBMS__data__channel::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Application__Container__IE__MBMS__data__channel::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
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.Application_Container_IE_MBMS_data_channel 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 Application__Container__IE__MBMS__data__channel_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__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 Application__Container__IE__MBMS__data__channel_template::log_match(const Application__Container__IE__MBMS__data__channel& 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 Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Request_Application_Container");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Application_Container");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__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 Application__Container__IE__MBMS__data__channel_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 Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__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.Application_Container_IE_MBMS_data_channel.");
}
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.Application_Container_IE_MBMS_data_channel.");
}
}

void Application__Container__IE__MBMS__data__channel_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Application__Container__IE__MBMS__data__channel::UNBOUND_VALUE;
Application__Container__IE__MBMS__data__channel::union_selection_type new_selection = (Application__Container__IE__MBMS__data__channel::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__MBMS__data__channel_template;
single_value.field_rAN__Information__Request__Application__Container->decode_text(text_buf);
break;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__MBMS__data__channel_template;
single_value.field_rAN__Information__Application__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.");
}
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 Application__Container__IE__MBMS__data__channel_template[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.Application_Container_IE_MBMS_data_channel.");
}
}

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

boolean Application__Container__IE__MBMS__data__channel_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 Application__Container__IE__MBMS__data__channel_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.Application_Container_IE_MBMS_data_channel'");
    }
    if (strcmp("rAN_Information_Request_Application_Container", param_field) == 0) {
      rAN__Information__Request__Application__Container().set_param(param);
      return;
    } else if (strcmp("rAN_Information_Application_Container", param_field) == 0) {
      rAN__Information__Application__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Application_Container_IE_MBMS_data_channel'", 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: {
    Application__Container__IE__MBMS__data__channel_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.Application_Container_IE_MBMS_data_channel");
    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, "rAN_Information_Request_Application_Container")) {
      rAN__Information__Request__Application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rAN_Information_Application_Container")) {
      rAN__Information__Application__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_MBMS_data_channel.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Container__IE__MBMS__data__channel_template* precondition = new Application__Container__IE__MBMS__data__channel_template;
    precondition->set_param(*m_p->get_elem(0));
    Application__Container__IE__MBMS__data__channel_template* implied_template = new Application__Container__IE__MBMS__data__channel_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Application__Container__IE__MBMS__data__channel_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Application_Container_IE_MBMS_data_channel");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Container__IE__MBMS__data__channel_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 Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_MBMS_data_channel");
return;
case Application__Container__IE__MBMS__data__channel::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_MBMS_data_channel");
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.Application_Container_IE_MBMS_data_channel.");
}
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.Application_Container_IE_MBMS_data_channel");
}

Application__Error__Container__MBMS__data__channel::Application__Error__Container__MBMS__data__channel()
{
}

Application__Error__Container__MBMS__data__channel::Application__Error__Container__MBMS__data__channel(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_mBMS__data__channel__cause,
    const Application__Container__IE__MBMS__data__channel& par_erroneousApplicationContainer)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mBMS__data__channel__cause(par_mBMS__data__channel__cause),
  field_erroneousApplicationContainer(par_erroneousApplicationContainer)
{
}

Application__Error__Container__MBMS__data__channel::Application__Error__Container__MBMS__data__channel(const Application__Error__Container__MBMS__data__channel& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Application_Error_Container_MBMS_data_channel.");
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__data__channel__cause().is_bound()) field_mBMS__data__channel__cause = other_value.mBMS__data__channel__cause();
else field_mBMS__data__channel__cause.clean_up();
if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
else field_erroneousApplicationContainer.clean_up();
}

void Application__Error__Container__MBMS__data__channel::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mBMS__data__channel__cause.clean_up();
field_erroneousApplicationContainer.clean_up();
}

const TTCN_Typedescriptor_t* Application__Error__Container__MBMS__data__channel::get_descriptor() const { return &Application__Error__Container__MBMS__data__channel_descr_; }
Application__Error__Container__MBMS__data__channel& Application__Error__Container__MBMS__data__channel::operator=(const Application__Error__Container__MBMS__data__channel& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Application_Error_Container_MBMS_data_channel.");
  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__data__channel__cause().is_bound()) field_mBMS__data__channel__cause = other_value.mBMS__data__channel__cause();
  else field_mBMS__data__channel__cause.clean_up();
  if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
  else field_erroneousApplicationContainer.clean_up();
}
return *this;
}

boolean Application__Error__Container__MBMS__data__channel::operator==(const Application__Error__Container__MBMS__data__channel& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mBMS__data__channel__cause==other_value.field_mBMS__data__channel__cause
  && field_erroneousApplicationContainer==other_value.field_erroneousApplicationContainer;
}

boolean Application__Error__Container__MBMS__data__channel::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mBMS__data__channel__cause.is_bound())
  || (field_erroneousApplicationContainer.is_bound());
}
boolean Application__Error__Container__MBMS__data__channel::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mBMS__data__channel__cause.is_value()
  && field_erroneousApplicationContainer.is_value();
}
void Application__Error__Container__MBMS__data__channel::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_data_channel_cause := ");
field_mBMS__data__channel__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
field_erroneousApplicationContainer.log();
TTCN_Logger::log_event_str(" }");
}

void Application__Error__Container__MBMS__data__channel::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__data__channel__cause().is_bound()) mBMS__data__channel__cause().set_implicit_omit();
if (erroneousApplicationContainer().is_bound()) erroneousApplicationContainer().set_implicit_omit();
}

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

void Application__Error__Container__MBMS__data__channel::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__data__channel__cause.encode_text(text_buf);
field_erroneousApplicationContainer.encode_text(text_buf);
}

void Application__Error__Container__MBMS__data__channel::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__data__channel__cause.decode_text(text_buf);
field_erroneousApplicationContainer.decode_text(text_buf);
}

void Application__Error__Container__MBMS__data__channel::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 Application__Error__Container__MBMS__data__channel::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 Application__Error__Container__MBMS__data__channel::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, Application__Error__Container__MBMS__data__channel_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Application__Error__Container__MBMS__data__channel_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, Application__Error__Container__MBMS__data__channel_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Application__Error__Container__MBMS__data__channel_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_mBMS__data__channel__cause.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;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Application__Container__IE__MBMS__data__channel_descr_.raw->forceomit);
  decoded_field_length = field_erroneousApplicationContainer.RAW_decode(Application__Container__IE__MBMS__data__channel_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_81) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Application__Error__Container__MBMS__data__channel::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, Application__Error__Container__MBMS__data__channel_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Application__Error__Container__MBMS__data__channel_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Application__Container__IE__MBMS__data__channel_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Application__Error__Container__MBMS__data__channel_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Application__Error__Container__MBMS__data__channel_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mBMS__data__channel__cause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_erroneousApplicationContainer.RAW_encode(Application__Container__IE__MBMS__data__channel_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(Application__Error__Container__MBMS__data__channel_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(Application__Error__Container__MBMS__data__channel_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_81) {
  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_81.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 Application__Error__Container__MBMS__data__channel_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_mBMS__data__channel__cause;
Application__Container__IE__MBMS__data__channel_template field_erroneousApplicationContainer;
};

void Application__Error__Container__MBMS__data__channel_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__data__channel__cause = ANY_VALUE;
single_value->field_erroneousApplicationContainer = ANY_VALUE;
}
}
}

void Application__Error__Container__MBMS__data__channel_template::copy_value(const Application__Error__Container__MBMS__data__channel& 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__data__channel__cause().is_bound()) {
  single_value->field_mBMS__data__channel__cause = other_value.mBMS__data__channel__cause();
} else {
  single_value->field_mBMS__data__channel__cause.clean_up();
}
if (other_value.erroneousApplicationContainer().is_bound()) {
  single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
  single_value->field_erroneousApplicationContainer.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Application__Error__Container__MBMS__data__channel_template::copy_template(const Application__Error__Container__MBMS__data__channel_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__data__channel__cause().get_selection()) {
single_value->field_mBMS__data__channel__cause = other_value.mBMS__data__channel__cause();
} else {
single_value->field_mBMS__data__channel__cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.erroneousApplicationContainer().get_selection()) {
single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__MBMS__data__channel_template[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 Application__Error__Container__MBMS__data__channel_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Error__Container__MBMS__data__channel_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.Application_Error_Container_MBMS_data_channel.");
break;
}
set_selection(other_value);
}

Application__Error__Container__MBMS__data__channel_template::Application__Error__Container__MBMS__data__channel_template()
{
}

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

Application__Error__Container__MBMS__data__channel_template::Application__Error__Container__MBMS__data__channel_template(const Application__Error__Container__MBMS__data__channel& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Application__Error__Container__MBMS__data__channel_template::match(const Application__Error__Container__MBMS__data__channel& 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__data__channel__cause().is_bound()) return FALSE;
if(!single_value->field_mBMS__data__channel__cause.match(other_value.mBMS__data__channel__cause(), legacy))return FALSE;
if(!other_value.erroneousApplicationContainer().is_bound()) return FALSE;
if(!single_value->field_erroneousApplicationContainer.match(other_value.erroneousApplicationContainer(), 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.Application_Error_Container_MBMS_data_channel.");
}
return FALSE;
}

boolean Application__Error__Container__MBMS__data__channel_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__data__channel__cause.is_bound()
 || single_value->field_erroneousApplicationContainer.is_bound();
}

boolean Application__Error__Container__MBMS__data__channel_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__data__channel__cause.is_value()
 && single_value->field_erroneousApplicationContainer.is_value();
}

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

Application__Error__Container__MBMS__data__channel Application__Error__Container__MBMS__data__channel_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.Application_Error_Container_MBMS_data_channel.");
Application__Error__Container__MBMS__data__channel 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__data__channel__cause.is_bound()) {
ret_val.mBMS__data__channel__cause() = single_value->field_mBMS__data__channel__cause.valueof();
}
if (single_value->field_erroneousApplicationContainer.is_bound()) {
ret_val.erroneousApplicationContainer() = single_value->field_erroneousApplicationContainer.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& Application__Error__Container__MBMS__data__channel_template::mBMS__data__channel__cause()
{
set_specific();
return single_value->field_mBMS__data__channel__cause;
}

const OCTETSTRING_template& Application__Error__Container__MBMS__data__channel_template::mBMS__data__channel__cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_data_channel_cause of a non-specific template of type @BSSGP_Types.Application_Error_Container_MBMS_data_channel.");
return single_value->field_mBMS__data__channel__cause;
}

Application__Container__IE__MBMS__data__channel_template& Application__Error__Container__MBMS__data__channel_template::erroneousApplicationContainer()
{
set_specific();
return single_value->field_erroneousApplicationContainer;
}

const Application__Container__IE__MBMS__data__channel_template& Application__Error__Container__MBMS__data__channel_template::erroneousApplicationContainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field erroneousApplicationContainer of a non-specific template of type @BSSGP_Types.Application_Error_Container_MBMS_data_channel.");
return single_value->field_erroneousApplicationContainer;
}

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

void Application__Error__Container__MBMS__data__channel_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_data_channel_cause := ");
single_value->field_mBMS__data__channel__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__MBMS__data__channel_template::log_match(const Application__Error__Container__MBMS__data__channel& 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__data__channel__cause.match(match_value.mBMS__data__channel__cause(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_data_channel_cause");
single_value->field_mBMS__data__channel__cause.log_match(match_value.mBMS__data__channel__cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_erroneousApplicationContainer.match(match_value.erroneousApplicationContainer(), legacy)){
TTCN_Logger::log_logmatch_info(".erroneousApplicationContainer");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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_data_channel_cause := ");
single_value->field_mBMS__data__channel__cause.log_match(match_value.mBMS__data__channel__cause(), legacy);
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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 Application__Error__Container__MBMS__data__channel_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__data__channel__cause.encode_text(text_buf);
single_value->field_erroneousApplicationContainer.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.Application_Error_Container_MBMS_data_channel.");
}
}

void Application__Error__Container__MBMS__data__channel_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__data__channel__cause.decode_text(text_buf);
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__MBMS__data__channel_template[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.Application_Error_Container_MBMS_data_channel.");
}
}

void Application__Error__Container__MBMS__data__channel_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: {
    Application__Error__Container__MBMS__data__channel_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.Application_Error_Container_MBMS_data_channel 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) mBMS__data__channel__cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) erroneousApplicationContainer().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(), "mBMS_data_channel_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__data__channel__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "erroneousApplicationContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          erroneousApplicationContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Application_Error_Container_MBMS_data_channel: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Error__Container__MBMS__data__channel_template* precondition = new Application__Error__Container__MBMS__data__channel_template;
    precondition->set_param(*param.get_elem(0));
    Application__Error__Container__MBMS__data__channel_template* implied_template = new Application__Error__Container__MBMS__data__channel_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Application__Error__Container__MBMS__data__channel_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Application_Error_Container_MBMS_data_channel");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Error__Container__MBMS__data__channel_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.Application_Error_Container_MBMS_data_channel");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_MBMS_data_channel");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_MBMS_data_channel");
single_value->field_mBMS__data__channel__cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_MBMS_data_channel");
single_value->field_erroneousApplicationContainer.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_MBMS_data_channel");
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.Application_Error_Container_MBMS_data_channel");
}

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

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

RAN__Information__Ack__RIM__Container::RAN__Information__Ack__RIM__Container()
{
}

RAN__Information__Ack__RIM__Container::RAN__Information__Ack__RIM__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const RIM__Application__Identity& par_rIM__Application__Identity,
    const RIM__Sequence__Number& par_rIM__Sequence__Number,
    const OPTIONAL< RIM__Protocol__Version__Number >& par_rIM__Protocol__Version__Number,
    const OPTIONAL< SON__Transfer__Application__Identity__TLV >& par_sON__Transfer__Application__Identity)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_rIM__Application__Identity(par_rIM__Application__Identity),
  field_rIM__Sequence__Number(par_rIM__Sequence__Number),
  field_rIM__Protocol__Version__Number(par_rIM__Protocol__Version__Number),
  field_sON__Transfer__Application__Identity(par_sON__Transfer__Application__Identity)
{
}

RAN__Information__Ack__RIM__Container::RAN__Information__Ack__RIM__Container(const RAN__Information__Ack__RIM__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Ack_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
else field_rIM__Application__Identity.clean_up();
if (other_value.rIM__Sequence__Number().is_bound()) field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
else field_rIM__Sequence__Number.clean_up();
if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
else field_rIM__Protocol__Version__Number.clean_up();
if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
else field_sON__Transfer__Application__Identity.clean_up();
}

void RAN__Information__Ack__RIM__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_rIM__Application__Identity.clean_up();
field_rIM__Sequence__Number.clean_up();
field_rIM__Protocol__Version__Number.clean_up();
field_sON__Transfer__Application__Identity.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Ack__RIM__Container::get_descriptor() const { return &RAN__Information__Ack__RIM__Container_descr_; }
RAN__Information__Ack__RIM__Container& RAN__Information__Ack__RIM__Container::operator=(const RAN__Information__Ack__RIM__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Ack_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
  else field_rIM__Application__Identity.clean_up();
  if (other_value.rIM__Sequence__Number().is_bound()) field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
  else field_rIM__Sequence__Number.clean_up();
  if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
  else field_rIM__Protocol__Version__Number.clean_up();
  if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
  else field_sON__Transfer__Application__Identity.clean_up();
}
return *this;
}

boolean RAN__Information__Ack__RIM__Container::operator==(const RAN__Information__Ack__RIM__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_rIM__Application__Identity==other_value.field_rIM__Application__Identity
  && field_rIM__Sequence__Number==other_value.field_rIM__Sequence__Number
  && field_rIM__Protocol__Version__Number==other_value.field_rIM__Protocol__Version__Number
  && field_sON__Transfer__Application__Identity==other_value.field_sON__Transfer__Application__Identity;
}

boolean RAN__Information__Ack__RIM__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_rIM__Application__Identity.is_bound())
  || (field_rIM__Sequence__Number.is_bound())
  || (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_bound())
  || (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_bound());
}
boolean RAN__Information__Ack__RIM__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_rIM__Application__Identity.is_value()
  && field_rIM__Sequence__Number.is_value()
  && (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_value())
  && (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_value());
}
int RAN__Information__Ack__RIM__Container::size_of() const
{
  int ret_val = 5;
  if (field_rIM__Protocol__Version__Number.ispresent()) ret_val++;
  if (field_sON__Transfer__Application__Identity.ispresent()) ret_val++;
  return ret_val;
}

void RAN__Information__Ack__RIM__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(", rIM_Application_Identity := ");
field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
field_rIM__Sequence__Number.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
field_sON__Transfer__Application__Identity.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Ack__RIM__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 (rIM__Application__Identity().is_bound()) rIM__Application__Identity().set_implicit_omit();
if (rIM__Sequence__Number().is_bound()) rIM__Sequence__Number().set_implicit_omit();
if (!rIM__Protocol__Version__Number().is_bound()) rIM__Protocol__Version__Number() = OMIT_VALUE;
else rIM__Protocol__Version__Number().set_implicit_omit();
if (!sON__Transfer__Application__Identity().is_bound()) sON__Transfer__Application__Identity() = OMIT_VALUE;
else sON__Transfer__Application__Identity().set_implicit_omit();
}

void RAN__Information__Ack__RIM__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 (7<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RAN_Information_Ack_RIM_Container has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__Sequence__Number().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_Sequence_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Sequence__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Ack_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RAN_Information_Ack_RIM_Container");
  }
}

void RAN__Information__Ack__RIM__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_rIM__Application__Identity.encode_text(text_buf);
field_rIM__Sequence__Number.encode_text(text_buf);
field_rIM__Protocol__Version__Number.encode_text(text_buf);
field_sON__Transfer__Application__Identity.encode_text(text_buf);
}

void RAN__Information__Ack__RIM__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_rIM__Application__Identity.decode_text(text_buf);
field_rIM__Sequence__Number.decode_text(text_buf);
field_rIM__Protocol__Version__Number.decode_text(text_buf);
field_sON__Transfer__Application__Identity.decode_text(text_buf);
}

void RAN__Information__Ack__RIM__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 RAN__Information__Ack__RIM__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 RAN__Information__Ack__RIM__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, RAN__Information__Ack__RIM__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Ack__RIM__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, RAN__Information__Ack__RIM__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Ack__RIM__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, RIM__Application__Identity_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Application__Identity.RAW_decode(RIM__Application__Identity_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, RIM__Sequence__Number_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Sequence__Number.RAW_decode(RIM__Sequence__Number_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_rIM__Protocol__Version__Number = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, RIM__Protocol__Version__Number_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Protocol__Version__Number().RAW_decode(RIM__Protocol__Version__Number_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_rIM__Protocol__Version__Number = 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_rIM__Protocol__Version__Number=OMIT_VALUE;
  if (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_sON__Transfer__Application__Identity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, SON__Transfer__Application__Identity__TLV_descr_.raw->forceomit);
  decoded_field_length = field_sON__Transfer__Application__Identity().RAW_decode(SON__Transfer__Application__Identity__TLV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_sON__Transfer__Application__Identity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  }
  }
  }
  else field_sON__Transfer__Application__Identity=OMIT_VALUE;
  if (field_iEI !=  os_107) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Ack__RIM__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 = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RAN__Information__Ack__RIM__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Ack__RIM__Container_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RIM__Application__Identity_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RIM__Sequence__Number_descr_.raw);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RIM__Protocol__Version__Number_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, SON__Transfer__Application__Identity__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Ack__RIM__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Ack__RIM__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rIM__Application__Identity.RAW_encode(RIM__Application__Identity_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rIM__Sequence__Number.RAW_encode(RIM__Sequence__Number_descr_, *myleaf.body.node.nodes[4]);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  encoded_length += field_rIM__Protocol__Version__Number().RAW_encode(RIM__Protocol__Version__Number_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  encoded_length += field_sON__Transfer__Application__Identity().RAW_encode(SON__Transfer__Application__Identity__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 4;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(4);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  if (field_rIM__Protocol__Version__Number.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;
  }
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].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(RAN__Information__Ack__RIM__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(RAN__Information__Ack__RIM__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_107) {
  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_107.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 RAN__Information__Ack__RIM__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
RIM__Application__Identity_template field_rIM__Application__Identity;
RIM__Sequence__Number_template field_rIM__Sequence__Number;
RIM__Protocol__Version__Number_template field_rIM__Protocol__Version__Number;
SON__Transfer__Application__Identity__TLV_template field_sON__Transfer__Application__Identity;
};

void RAN__Information__Ack__RIM__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_rIM__Application__Identity = ANY_VALUE;
single_value->field_rIM__Sequence__Number = ANY_VALUE;
single_value->field_rIM__Protocol__Version__Number = ANY_OR_OMIT;
single_value->field_sON__Transfer__Application__Identity = ANY_OR_OMIT;
}
}
}

void RAN__Information__Ack__RIM__Container_template::copy_value(const RAN__Information__Ack__RIM__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.rIM__Application__Identity().is_bound()) {
  single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
  single_value->field_rIM__Application__Identity.clean_up();
}
if (other_value.rIM__Sequence__Number().is_bound()) {
  single_value->field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
} else {
  single_value->field_rIM__Sequence__Number.clean_up();
}
if (other_value.rIM__Protocol__Version__Number().is_bound()) {
  if (other_value.rIM__Protocol__Version__Number().ispresent()) single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number()();
  else single_value->field_rIM__Protocol__Version__Number = OMIT_VALUE;
} else {
  single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (other_value.sON__Transfer__Application__Identity().is_bound()) {
  if (other_value.sON__Transfer__Application__Identity().ispresent()) single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity()();
  else single_value->field_sON__Transfer__Application__Identity = OMIT_VALUE;
} else {
  single_value->field_sON__Transfer__Application__Identity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Ack__RIM__Container_template::copy_template(const RAN__Information__Ack__RIM__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.rIM__Application__Identity().get_selection()) {
single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
single_value->field_rIM__Application__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Sequence__Number().get_selection()) {
single_value->field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
} else {
single_value->field_rIM__Sequence__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Protocol__Version__Number().get_selection()) {
single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
} else {
single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sON__Transfer__Application__Identity().get_selection()) {
single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
} else {
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Ack__RIM__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 RAN__Information__Ack__RIM__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Ack__RIM__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.RAN_Information_Ack_RIM_Container.");
break;
}
set_selection(other_value);
}

RAN__Information__Ack__RIM__Container_template::RAN__Information__Ack__RIM__Container_template()
{
}

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

RAN__Information__Ack__RIM__Container_template::RAN__Information__Ack__RIM__Container_template(const RAN__Information__Ack__RIM__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Ack__RIM__Container_template::match(const RAN__Information__Ack__RIM__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.rIM__Application__Identity().is_bound()) return FALSE;
if(!single_value->field_rIM__Application__Identity.match(other_value.rIM__Application__Identity(), legacy))return FALSE;
if(!other_value.rIM__Sequence__Number().is_bound()) return FALSE;
if(!single_value->field_rIM__Sequence__Number.match(other_value.rIM__Sequence__Number(), legacy))return FALSE;
if(!other_value.rIM__Protocol__Version__Number().is_bound()) return FALSE;
if((other_value.rIM__Protocol__Version__Number().ispresent() ? !single_value->field_rIM__Protocol__Version__Number.match((const RIM__Protocol__Version__Number&)other_value.rIM__Protocol__Version__Number(), legacy) : !single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)))return FALSE;
if(!other_value.sON__Transfer__Application__Identity().is_bound()) return FALSE;
if((other_value.sON__Transfer__Application__Identity().ispresent() ? !single_value->field_sON__Transfer__Application__Identity.match((const SON__Transfer__Application__Identity__TLV&)other_value.sON__Transfer__Application__Identity(), legacy) : !single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_Ack_RIM_Container.");
}
return FALSE;
}

boolean RAN__Information__Ack__RIM__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_rIM__Application__Identity.is_bound()
 || single_value->field_rIM__Sequence__Number.is_bound()
 || (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_bound())
 || (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_bound());
}

boolean RAN__Information__Ack__RIM__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_rIM__Application__Identity.is_value()
 && single_value->field_rIM__Sequence__Number.is_value()
 && (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_value())
 && (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_value());
}

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

RAN__Information__Ack__RIM__Container RAN__Information__Ack__RIM__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.RAN_Information_Ack_RIM_Container.");
RAN__Information__Ack__RIM__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_rIM__Application__Identity.is_bound()) {
ret_val.rIM__Application__Identity() = single_value->field_rIM__Application__Identity.valueof();
}
if (single_value->field_rIM__Sequence__Number.is_bound()) {
ret_val.rIM__Sequence__Number() = single_value->field_rIM__Sequence__Number.valueof();
}
if (single_value->field_rIM__Protocol__Version__Number.is_omit()) ret_val.rIM__Protocol__Version__Number() = OMIT_VALUE;
else if (single_value->field_rIM__Protocol__Version__Number.is_bound()) {
ret_val.rIM__Protocol__Version__Number() = single_value->field_rIM__Protocol__Version__Number.valueof();
}
if (single_value->field_sON__Transfer__Application__Identity.is_omit()) ret_val.sON__Transfer__Application__Identity() = OMIT_VALUE;
else if (single_value->field_sON__Transfer__Application__Identity.is_bound()) {
ret_val.sON__Transfer__Application__Identity() = single_value->field_sON__Transfer__Application__Identity.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

RIM__Application__Identity_template& RAN__Information__Ack__RIM__Container_template::rIM__Application__Identity()
{
set_specific();
return single_value->field_rIM__Application__Identity;
}

const RIM__Application__Identity_template& RAN__Information__Ack__RIM__Container_template::rIM__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_Ack_RIM_Container.");
return single_value->field_rIM__Application__Identity;
}

RIM__Sequence__Number_template& RAN__Information__Ack__RIM__Container_template::rIM__Sequence__Number()
{
set_specific();
return single_value->field_rIM__Sequence__Number;
}

const RIM__Sequence__Number_template& RAN__Information__Ack__RIM__Container_template::rIM__Sequence__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Sequence_Number of a non-specific template of type @BSSGP_Types.RAN_Information_Ack_RIM_Container.");
return single_value->field_rIM__Sequence__Number;
}

RIM__Protocol__Version__Number_template& RAN__Information__Ack__RIM__Container_template::rIM__Protocol__Version__Number()
{
set_specific();
return single_value->field_rIM__Protocol__Version__Number;
}

const RIM__Protocol__Version__Number_template& RAN__Information__Ack__RIM__Container_template::rIM__Protocol__Version__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Protocol_Version_Number of a non-specific template of type @BSSGP_Types.RAN_Information_Ack_RIM_Container.");
return single_value->field_rIM__Protocol__Version__Number;
}

SON__Transfer__Application__Identity__TLV_template& RAN__Information__Ack__RIM__Container_template::sON__Transfer__Application__Identity()
{
set_specific();
return single_value->field_sON__Transfer__Application__Identity;
}

const SON__Transfer__Application__Identity__TLV_template& RAN__Information__Ack__RIM__Container_template::sON__Transfer__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_Transfer_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_Ack_RIM_Container.");
return single_value->field_sON__Transfer__Application__Identity;
}

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

void RAN__Information__Ack__RIM__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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
single_value->field_rIM__Sequence__Number.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Ack__RIM__Container_template::log_match(const RAN__Information__Ack__RIM__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_rIM__Application__Identity.match(match_value.rIM__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Application_Identity");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__Sequence__Number.match(match_value.rIM__Sequence__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Sequence_Number");
single_value->field_rIM__Sequence__Number.log_match(match_value.rIM__Sequence__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rIM__Protocol__Version__Number().ispresent()){
if(!single_value->field_rIM__Protocol__Version__Number.match(match_value.rIM__Protocol__Version__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number");
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sON__Transfer__Application__Identity().ispresent()){
if(!single_value->field_sON__Transfer__Application__Identity.match(match_value.sON__Transfer__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity");
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sON__Transfer__Application__Identity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sON__Transfer__Application__Identity.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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
single_value->field_rIM__Sequence__Number.log_match(match_value.rIM__Sequence__Number(), legacy);
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
if (match_value.rIM__Protocol__Version__Number().ispresent()) {
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rIM__Protocol__Version__Number.log();
if (single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
if (match_value.sON__Transfer__Application__Identity().ispresent()) {
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sON__Transfer__Application__Identity.log();
if (single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Ack__RIM__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_rIM__Application__Identity.encode_text(text_buf);
single_value->field_rIM__Sequence__Number.encode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.encode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_Ack_RIM_Container.");
}
}

void RAN__Information__Ack__RIM__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_rIM__Application__Identity.decode_text(text_buf);
single_value->field_rIM__Sequence__Number.decode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.decode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Ack__RIM__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.RAN_Information_Ack_RIM_Container.");
}
}

void RAN__Information__Ack__RIM__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: {
    RAN__Information__Ack__RIM__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 (7<param.get_size()) {
      param.error("record template of type @BSSGP_Types.RAN_Information_Ack_RIM_Container has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__Sequence__Number().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_Sequence_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Sequence__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Ack_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Ack__RIM__Container_template* precondition = new RAN__Information__Ack__RIM__Container_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__Ack__RIM__Container_template* implied_template = new RAN__Information__Ack__RIM__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__Ack__RIM__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_Ack_RIM_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Ack__RIM__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.RAN_Information_Ack_RIM_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Ack_RIM_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Ack_RIM_Container");
single_value->field_rIM__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Ack_RIM_Container");
single_value->field_rIM__Sequence__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Ack_RIM_Container");
single_value->field_rIM__Protocol__Version__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Ack_RIM_Container");
single_value->field_sON__Transfer__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Ack_RIM_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.RAN_Information_Ack_RIM_Container");
}

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

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

RAN__Information__Error__RIM__Container::RAN__Information__Error__RIM__Container()
{
}

RAN__Information__Error__RIM__Container::RAN__Information__Error__RIM__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const RIM__Application__Identity& par_rIM__Application__Identity,
    const Cause__BSSGP& par_rIM__cause,
    const OPTIONAL< RIM__Protocol__Version__Number >& par_rIM__Protocol__Version__Number,
    const PDU__in__Error& par_pDU__in__Error,
    const OPTIONAL< SON__Transfer__Application__Identity__TLV >& par_sON__Transfer__Application__Identity)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_rIM__Application__Identity(par_rIM__Application__Identity),
  field_rIM__cause(par_rIM__cause),
  field_rIM__Protocol__Version__Number(par_rIM__Protocol__Version__Number),
  field_pDU__in__Error(par_pDU__in__Error),
  field_sON__Transfer__Application__Identity(par_sON__Transfer__Application__Identity)
{
}

RAN__Information__Error__RIM__Container::RAN__Information__Error__RIM__Container(const RAN__Information__Error__RIM__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Error_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
else field_rIM__Application__Identity.clean_up();
if (other_value.rIM__cause().is_bound()) field_rIM__cause = other_value.rIM__cause();
else field_rIM__cause.clean_up();
if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
else field_rIM__Protocol__Version__Number.clean_up();
if (other_value.pDU__in__Error().is_bound()) field_pDU__in__Error = other_value.pDU__in__Error();
else field_pDU__in__Error.clean_up();
if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
else field_sON__Transfer__Application__Identity.clean_up();
}

void RAN__Information__Error__RIM__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_rIM__Application__Identity.clean_up();
field_rIM__cause.clean_up();
field_rIM__Protocol__Version__Number.clean_up();
field_pDU__in__Error.clean_up();
field_sON__Transfer__Application__Identity.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Error__RIM__Container::get_descriptor() const { return &RAN__Information__Error__RIM__Container_descr_; }
RAN__Information__Error__RIM__Container& RAN__Information__Error__RIM__Container::operator=(const RAN__Information__Error__RIM__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Error_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
  else field_rIM__Application__Identity.clean_up();
  if (other_value.rIM__cause().is_bound()) field_rIM__cause = other_value.rIM__cause();
  else field_rIM__cause.clean_up();
  if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
  else field_rIM__Protocol__Version__Number.clean_up();
  if (other_value.pDU__in__Error().is_bound()) field_pDU__in__Error = other_value.pDU__in__Error();
  else field_pDU__in__Error.clean_up();
  if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
  else field_sON__Transfer__Application__Identity.clean_up();
}
return *this;
}

boolean RAN__Information__Error__RIM__Container::operator==(const RAN__Information__Error__RIM__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_rIM__Application__Identity==other_value.field_rIM__Application__Identity
  && field_rIM__cause==other_value.field_rIM__cause
  && field_rIM__Protocol__Version__Number==other_value.field_rIM__Protocol__Version__Number
  && field_pDU__in__Error==other_value.field_pDU__in__Error
  && field_sON__Transfer__Application__Identity==other_value.field_sON__Transfer__Application__Identity;
}

boolean RAN__Information__Error__RIM__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_rIM__Application__Identity.is_bound())
  || (field_rIM__cause.is_bound())
  || (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_bound())
  || (field_pDU__in__Error.is_bound())
  || (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_bound());
}
boolean RAN__Information__Error__RIM__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_rIM__Application__Identity.is_value()
  && field_rIM__cause.is_value()
  && (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_value())
  && field_pDU__in__Error.is_value()
  && (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_value());
}
int RAN__Information__Error__RIM__Container::size_of() const
{
  int ret_val = 6;
  if (field_rIM__Protocol__Version__Number.ispresent()) ret_val++;
  if (field_sON__Transfer__Application__Identity.ispresent()) ret_val++;
  return ret_val;
}

void RAN__Information__Error__RIM__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(", rIM_Application_Identity := ");
field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_cause := ");
field_rIM__cause.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", pDU_in_Error := ");
field_pDU__in__Error.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
field_sON__Transfer__Application__Identity.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Error__RIM__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 (rIM__Application__Identity().is_bound()) rIM__Application__Identity().set_implicit_omit();
if (rIM__cause().is_bound()) rIM__cause().set_implicit_omit();
if (!rIM__Protocol__Version__Number().is_bound()) rIM__Protocol__Version__Number() = OMIT_VALUE;
else rIM__Protocol__Version__Number().set_implicit_omit();
if (pDU__in__Error().is_bound()) pDU__in__Error().set_implicit_omit();
if (!sON__Transfer__Application__Identity().is_bound()) sON__Transfer__Application__Identity() = OMIT_VALUE;
else sON__Transfer__Application__Identity().set_implicit_omit();
}

void RAN__Information__Error__RIM__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 (8<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RAN_Information_Error_RIM_Container 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) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__cause().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pDU__in__Error().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().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(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pDU_in_Error")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pDU__in__Error().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Error_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RAN_Information_Error_RIM_Container");
  }
}

void RAN__Information__Error__RIM__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_rIM__Application__Identity.encode_text(text_buf);
field_rIM__cause.encode_text(text_buf);
field_rIM__Protocol__Version__Number.encode_text(text_buf);
field_pDU__in__Error.encode_text(text_buf);
field_sON__Transfer__Application__Identity.encode_text(text_buf);
}

void RAN__Information__Error__RIM__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_rIM__Application__Identity.decode_text(text_buf);
field_rIM__cause.decode_text(text_buf);
field_rIM__Protocol__Version__Number.decode_text(text_buf);
field_pDU__in__Error.decode_text(text_buf);
field_sON__Transfer__Application__Identity.decode_text(text_buf);
}

void RAN__Information__Error__RIM__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 RAN__Information__Error__RIM__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 RAN__Information__Error__RIM__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, RAN__Information__Error__RIM__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Error__RIM__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, RAN__Information__Error__RIM__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Error__RIM__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, RIM__Application__Identity_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Application__Identity.RAW_decode(RIM__Application__Identity_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_rIM__cause.RAW_decode(Cause__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;
  if (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_rIM__Protocol__Version__Number = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, RIM__Protocol__Version__Number_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Protocol__Version__Number().RAW_decode(RIM__Protocol__Version__Number_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_rIM__Protocol__Version__Number = 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_rIM__Protocol__Version__Number=OMIT_VALUE;
  RAW_Force_Omit field_6_force_omit(6, force_omit, PDU__in__Error_descr_.raw->forceomit);
  decoded_field_length = field_pDU__in__Error.RAW_decode(PDU__in__Error_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_sON__Transfer__Application__Identity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, SON__Transfer__Application__Identity__TLV_descr_.raw->forceomit);
  decoded_field_length = field_sON__Transfer__Application__Identity().RAW_decode(SON__Transfer__Application__Identity__TLV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_sON__Transfer__Application__Identity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  }
  }
  }
  else field_sON__Transfer__Application__Identity=OMIT_VALUE;
  if (field_iEI !=  os_108) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Error__RIM__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 = 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, RAN__Information__Error__RIM__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Error__RIM__Container_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RIM__Application__Identity_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Cause__BSSGP_descr_.raw);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RIM__Protocol__Version__Number_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, PDU__in__Error_descr_.raw);
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, SON__Transfer__Application__Identity__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Error__RIM__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Error__RIM__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rIM__Application__Identity.RAW_encode(RIM__Application__Identity_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rIM__cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  encoded_length += field_rIM__Protocol__Version__Number().RAW_encode(RIM__Protocol__Version__Number_descr_, *myleaf.body.node.nodes[5]);
  }
  encoded_length += field_pDU__in__Error.RAW_encode(PDU__in__Error_descr_, *myleaf.body.node.nodes[6]);
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  encoded_length += field_sON__Transfer__Application__Identity().RAW_encode(SON__Transfer__Application__Identity__TLV_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;
  if (field_rIM__Protocol__Version__Number.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;
  }
  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;
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].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(RAN__Information__Error__RIM__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(RAN__Information__Error__RIM__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_108) {
  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_108.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 RAN__Information__Error__RIM__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
RIM__Application__Identity_template field_rIM__Application__Identity;
Cause__BSSGP_template field_rIM__cause;
RIM__Protocol__Version__Number_template field_rIM__Protocol__Version__Number;
PDU__in__Error_template field_pDU__in__Error;
SON__Transfer__Application__Identity__TLV_template field_sON__Transfer__Application__Identity;
};

void RAN__Information__Error__RIM__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_rIM__Application__Identity = ANY_VALUE;
single_value->field_rIM__cause = ANY_VALUE;
single_value->field_rIM__Protocol__Version__Number = ANY_OR_OMIT;
single_value->field_pDU__in__Error = ANY_VALUE;
single_value->field_sON__Transfer__Application__Identity = ANY_OR_OMIT;
}
}
}

void RAN__Information__Error__RIM__Container_template::copy_value(const RAN__Information__Error__RIM__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.rIM__Application__Identity().is_bound()) {
  single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
  single_value->field_rIM__Application__Identity.clean_up();
}
if (other_value.rIM__cause().is_bound()) {
  single_value->field_rIM__cause = other_value.rIM__cause();
} else {
  single_value->field_rIM__cause.clean_up();
}
if (other_value.rIM__Protocol__Version__Number().is_bound()) {
  if (other_value.rIM__Protocol__Version__Number().ispresent()) single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number()();
  else single_value->field_rIM__Protocol__Version__Number = OMIT_VALUE;
} else {
  single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (other_value.pDU__in__Error().is_bound()) {
  single_value->field_pDU__in__Error = other_value.pDU__in__Error();
} else {
  single_value->field_pDU__in__Error.clean_up();
}
if (other_value.sON__Transfer__Application__Identity().is_bound()) {
  if (other_value.sON__Transfer__Application__Identity().ispresent()) single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity()();
  else single_value->field_sON__Transfer__Application__Identity = OMIT_VALUE;
} else {
  single_value->field_sON__Transfer__Application__Identity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Error__RIM__Container_template::copy_template(const RAN__Information__Error__RIM__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.rIM__Application__Identity().get_selection()) {
single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
single_value->field_rIM__Application__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__cause().get_selection()) {
single_value->field_rIM__cause = other_value.rIM__cause();
} else {
single_value->field_rIM__cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Protocol__Version__Number().get_selection()) {
single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
} else {
single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pDU__in__Error().get_selection()) {
single_value->field_pDU__in__Error = other_value.pDU__in__Error();
} else {
single_value->field_pDU__in__Error.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sON__Transfer__Application__Identity().get_selection()) {
single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
} else {
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Error__RIM__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 RAN__Information__Error__RIM__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Error__RIM__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.RAN_Information_Error_RIM_Container.");
break;
}
set_selection(other_value);
}

RAN__Information__Error__RIM__Container_template::RAN__Information__Error__RIM__Container_template()
{
}

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

RAN__Information__Error__RIM__Container_template::RAN__Information__Error__RIM__Container_template(const RAN__Information__Error__RIM__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Error__RIM__Container_template::match(const RAN__Information__Error__RIM__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.rIM__Application__Identity().is_bound()) return FALSE;
if(!single_value->field_rIM__Application__Identity.match(other_value.rIM__Application__Identity(), legacy))return FALSE;
if(!other_value.rIM__cause().is_bound()) return FALSE;
if(!single_value->field_rIM__cause.match(other_value.rIM__cause(), legacy))return FALSE;
if(!other_value.rIM__Protocol__Version__Number().is_bound()) return FALSE;
if((other_value.rIM__Protocol__Version__Number().ispresent() ? !single_value->field_rIM__Protocol__Version__Number.match((const RIM__Protocol__Version__Number&)other_value.rIM__Protocol__Version__Number(), legacy) : !single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)))return FALSE;
if(!other_value.pDU__in__Error().is_bound()) return FALSE;
if(!single_value->field_pDU__in__Error.match(other_value.pDU__in__Error(), legacy))return FALSE;
if(!other_value.sON__Transfer__Application__Identity().is_bound()) return FALSE;
if((other_value.sON__Transfer__Application__Identity().ispresent() ? !single_value->field_sON__Transfer__Application__Identity.match((const SON__Transfer__Application__Identity__TLV&)other_value.sON__Transfer__Application__Identity(), legacy) : !single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_Error_RIM_Container.");
}
return FALSE;
}

boolean RAN__Information__Error__RIM__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_rIM__Application__Identity.is_bound()
 || single_value->field_rIM__cause.is_bound()
 || (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_bound())
 || single_value->field_pDU__in__Error.is_bound()
 || (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_bound());
}

boolean RAN__Information__Error__RIM__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_rIM__Application__Identity.is_value()
 && single_value->field_rIM__cause.is_value()
 && (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_value())
 && single_value->field_pDU__in__Error.is_value()
 && (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_value());
}

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

RAN__Information__Error__RIM__Container RAN__Information__Error__RIM__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.RAN_Information_Error_RIM_Container.");
RAN__Information__Error__RIM__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_rIM__Application__Identity.is_bound()) {
ret_val.rIM__Application__Identity() = single_value->field_rIM__Application__Identity.valueof();
}
if (single_value->field_rIM__cause.is_bound()) {
ret_val.rIM__cause() = single_value->field_rIM__cause.valueof();
}
if (single_value->field_rIM__Protocol__Version__Number.is_omit()) ret_val.rIM__Protocol__Version__Number() = OMIT_VALUE;
else if (single_value->field_rIM__Protocol__Version__Number.is_bound()) {
ret_val.rIM__Protocol__Version__Number() = single_value->field_rIM__Protocol__Version__Number.valueof();
}
if (single_value->field_pDU__in__Error.is_bound()) {
ret_val.pDU__in__Error() = single_value->field_pDU__in__Error.valueof();
}
if (single_value->field_sON__Transfer__Application__Identity.is_omit()) ret_val.sON__Transfer__Application__Identity() = OMIT_VALUE;
else if (single_value->field_sON__Transfer__Application__Identity.is_bound()) {
ret_val.sON__Transfer__Application__Identity() = single_value->field_sON__Transfer__Application__Identity.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

RIM__Application__Identity_template& RAN__Information__Error__RIM__Container_template::rIM__Application__Identity()
{
set_specific();
return single_value->field_rIM__Application__Identity;
}

const RIM__Application__Identity_template& RAN__Information__Error__RIM__Container_template::rIM__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_Error_RIM_Container.");
return single_value->field_rIM__Application__Identity;
}

Cause__BSSGP_template& RAN__Information__Error__RIM__Container_template::rIM__cause()
{
set_specific();
return single_value->field_rIM__cause;
}

const Cause__BSSGP_template& RAN__Information__Error__RIM__Container_template::rIM__cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_cause of a non-specific template of type @BSSGP_Types.RAN_Information_Error_RIM_Container.");
return single_value->field_rIM__cause;
}

RIM__Protocol__Version__Number_template& RAN__Information__Error__RIM__Container_template::rIM__Protocol__Version__Number()
{
set_specific();
return single_value->field_rIM__Protocol__Version__Number;
}

const RIM__Protocol__Version__Number_template& RAN__Information__Error__RIM__Container_template::rIM__Protocol__Version__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Protocol_Version_Number of a non-specific template of type @BSSGP_Types.RAN_Information_Error_RIM_Container.");
return single_value->field_rIM__Protocol__Version__Number;
}

PDU__in__Error_template& RAN__Information__Error__RIM__Container_template::pDU__in__Error()
{
set_specific();
return single_value->field_pDU__in__Error;
}

const PDU__in__Error_template& RAN__Information__Error__RIM__Container_template::pDU__in__Error() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pDU_in_Error of a non-specific template of type @BSSGP_Types.RAN_Information_Error_RIM_Container.");
return single_value->field_pDU__in__Error;
}

SON__Transfer__Application__Identity__TLV_template& RAN__Information__Error__RIM__Container_template::sON__Transfer__Application__Identity()
{
set_specific();
return single_value->field_sON__Transfer__Application__Identity;
}

const SON__Transfer__Application__Identity__TLV_template& RAN__Information__Error__RIM__Container_template::sON__Transfer__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_Transfer_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_Error_RIM_Container.");
return single_value->field_sON__Transfer__Application__Identity;
}

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

void RAN__Information__Error__RIM__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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_cause := ");
single_value->field_rIM__cause.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", pDU_in_Error := ");
single_value->field_pDU__in__Error.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Error__RIM__Container_template::log_match(const RAN__Information__Error__RIM__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_rIM__Application__Identity.match(match_value.rIM__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Application_Identity");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__cause.match(match_value.rIM__cause(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_cause");
single_value->field_rIM__cause.log_match(match_value.rIM__cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rIM__Protocol__Version__Number().ispresent()){
if(!single_value->field_rIM__Protocol__Version__Number.match(match_value.rIM__Protocol__Version__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number");
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_pDU__in__Error.match(match_value.pDU__in__Error(), legacy)){
TTCN_Logger::log_logmatch_info(".pDU_in_Error");
single_value->field_pDU__in__Error.log_match(match_value.pDU__in__Error(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.sON__Transfer__Application__Identity().ispresent()){
if(!single_value->field_sON__Transfer__Application__Identity.match(match_value.sON__Transfer__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity");
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sON__Transfer__Application__Identity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sON__Transfer__Application__Identity.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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::log_event_str(", rIM_cause := ");
single_value->field_rIM__cause.log_match(match_value.rIM__cause(), legacy);
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
if (match_value.rIM__Protocol__Version__Number().ispresent()) {
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rIM__Protocol__Version__Number.log();
if (single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pDU_in_Error := ");
single_value->field_pDU__in__Error.log_match(match_value.pDU__in__Error(), legacy);
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
if (match_value.sON__Transfer__Application__Identity().ispresent()) {
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sON__Transfer__Application__Identity.log();
if (single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Error__RIM__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_rIM__Application__Identity.encode_text(text_buf);
single_value->field_rIM__cause.encode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.encode_text(text_buf);
single_value->field_pDU__in__Error.encode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_Error_RIM_Container.");
}
}

void RAN__Information__Error__RIM__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_rIM__Application__Identity.decode_text(text_buf);
single_value->field_rIM__cause.decode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.decode_text(text_buf);
single_value->field_pDU__in__Error.decode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Error__RIM__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.RAN_Information_Error_RIM_Container.");
}
}

void RAN__Information__Error__RIM__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: {
    RAN__Information__Error__RIM__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 (8<param.get_size()) {
      param.error("record template of type @BSSGP_Types.RAN_Information_Error_RIM_Container 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) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__cause().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pDU__in__Error().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().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(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pDU_in_Error")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pDU__in__Error().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Error_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Error__RIM__Container_template* precondition = new RAN__Information__Error__RIM__Container_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__Error__RIM__Container_template* implied_template = new RAN__Information__Error__RIM__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__Error__RIM__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_Error_RIM_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Error__RIM__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.RAN_Information_Error_RIM_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Error_RIM_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Error_RIM_Container");
single_value->field_rIM__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Error_RIM_Container");
single_value->field_rIM__cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Error_RIM_Container");
single_value->field_rIM__Protocol__Version__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Error_RIM_Container");
single_value->field_pDU__in__Error.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Error_RIM_Container");
single_value->field_sON__Transfer__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Error_RIM_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.RAN_Information_Error_RIM_Container");
}

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

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

void Application__Error__Container::copy_value(const Application__Error__Container& other_value)
{
switch (other_value.union_selection) {
case ALT_nacc:
field_nacc = new Application__Error__Container__NACC(*other_value.field_nacc);
break;
case ALT_si3:
field_si3 = new Application__Error__Container__SI3(*other_value.field_si3);
break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel = new Application__Error__Container__MBMS__data__channel(*other_value.field_mBMS__data__channel);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Application_Error_Container.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Application__Error__Container::operator==(const Application__Error__Container& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Application_Error_Container.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Application_Error_Container.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_nacc:
return *field_nacc == *other_value.field_nacc;
case ALT_si3:
return *field_si3 == *other_value.field_si3;
case ALT_mBMS__data__channel:
return *field_mBMS__data__channel == *other_value.field_mBMS__data__channel;
default:
return FALSE;
}
}

Application__Error__Container__NACC& Application__Error__Container::nacc()
{
if (union_selection != ALT_nacc) {
clean_up();
field_nacc = new Application__Error__Container__NACC;
union_selection = ALT_nacc;
}
return *field_nacc;
}

const Application__Error__Container__NACC& Application__Error__Container::nacc() const
{
if (union_selection != ALT_nacc) TTCN_error("Using non-selected field nacc in a value of union type @BSSGP_Types.Application_Error_Container.");
return *field_nacc;
}

Application__Error__Container__SI3& Application__Error__Container::si3()
{
if (union_selection != ALT_si3) {
clean_up();
field_si3 = new Application__Error__Container__SI3;
union_selection = ALT_si3;
}
return *field_si3;
}

const Application__Error__Container__SI3& Application__Error__Container::si3() const
{
if (union_selection != ALT_si3) TTCN_error("Using non-selected field si3 in a value of union type @BSSGP_Types.Application_Error_Container.");
return *field_si3;
}

Application__Error__Container__MBMS__data__channel& Application__Error__Container::mBMS__data__channel()
{
if (union_selection != ALT_mBMS__data__channel) {
clean_up();
field_mBMS__data__channel = new Application__Error__Container__MBMS__data__channel;
union_selection = ALT_mBMS__data__channel;
}
return *field_mBMS__data__channel;
}

const Application__Error__Container__MBMS__data__channel& Application__Error__Container::mBMS__data__channel() const
{
if (union_selection != ALT_mBMS__data__channel) TTCN_error("Using non-selected field mBMS_data_channel in a value of union type @BSSGP_Types.Application_Error_Container.");
return *field_mBMS__data__channel;
}

boolean Application__Error__Container::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.Application_Error_Container.");
return union_selection == checked_selection;
}

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

boolean Application__Error__Container::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_nacc: return field_nacc->is_value();
case ALT_si3: return field_si3->is_value();
case ALT_mBMS__data__channel: return field_mBMS__data__channel->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Application__Error__Container::clean_up()
{
switch (union_selection) {
case ALT_nacc:
  delete field_nacc;
  break;
case ALT_si3:
  delete field_si3;
  break;
case ALT_mBMS__data__channel:
  delete field_mBMS__data__channel;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Application__Error__Container::log() const
{
switch (union_selection) {
case ALT_nacc:
TTCN_Logger::log_event_str("{ nacc := ");
field_nacc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mBMS__data__channel:
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
field_mBMS__data__channel->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Application__Error__Container::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, "nacc")) {
    nacc().set_param(*mp_last);
    if (!nacc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si3")) {
    si3().set_param(*mp_last);
    if (!si3().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mBMS_data_channel")) {
    mBMS__data__channel().set_param(*mp_last);
    if (!mBMS__data__channel().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Error_Container.", last_name);
}

void Application__Error__Container::set_implicit_omit()
{
switch (union_selection) {
case ALT_nacc:
field_nacc->set_implicit_omit(); break;
case ALT_si3:
field_si3->set_implicit_omit(); break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel->set_implicit_omit(); break;
default: break;
}
}

void Application__Error__Container::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_nacc:
field_nacc->encode_text(text_buf);
break;
case ALT_si3:
field_si3->encode_text(text_buf);
break;
case ALT_mBMS__data__channel:
field_mBMS__data__channel->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Application_Error_Container.");
}
}

void Application__Error__Container::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_nacc:
nacc().decode_text(text_buf);
break;
case ALT_si3:
si3().decode_text(text_buf);
break;
case ALT_mBMS__data__channel:
mBMS__data__channel().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Application_Error_Container.");
}
}

void Application__Error__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(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 Application__Error__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 Application__Error__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 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, Application__Error__Container__NACC_descr_.raw->forceomit);
      decoded_length = nacc().RAW_decode(Application__Error__Container__NACC_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, Application__Error__Container__SI3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(Application__Error__Container__SI3_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, Application__Error__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = mBMS__data__channel().RAW_decode(Application__Error__Container__MBMS__data__channel_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, Application__Error__Container__NACC_descr_.raw->forceomit);
      decoded_length = nacc().RAW_decode(Application__Error__Container__NACC_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, Application__Error__Container__SI3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(Application__Error__Container__SI3_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, Application__Error__Container__MBMS__data__channel_descr_.raw->forceomit);
      decoded_length = mBMS__data__channel().RAW_decode(Application__Error__Container__MBMS__data__channel_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int Application__Error__Container::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_nacc:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, Application__Error__Container__NACC_descr_.raw);
    encoded_length = field_nacc->RAW_encode(Application__Error__Container__NACC_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &Application__Error__Container__NACC_descr_;
    break;
  case ALT_si3:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, Application__Error__Container__SI3_descr_.raw);
    encoded_length = field_si3->RAW_encode(Application__Error__Container__SI3_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &Application__Error__Container__SI3_descr_;
    break;
  case ALT_mBMS__data__channel:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, Application__Error__Container__MBMS__data__channel_descr_.raw);
    encoded_length = field_mBMS__data__channel->RAW_encode(Application__Error__Container__MBMS__data__channel_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &Application__Error__Container__MBMS__data__channel_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Application__Error__Container_template::copy_value(const Application__Error__Container& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Application__Error__Container::ALT_nacc:
single_value.field_nacc = new Application__Error__Container__NACC_template(other_value.nacc());
break;
case Application__Error__Container::ALT_si3:
single_value.field_si3 = new Application__Error__Container__SI3_template(other_value.si3());
break;
case Application__Error__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new Application__Error__Container__MBMS__data__channel_template(other_value.mBMS__data__channel());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Application_Error_Container.");
}
set_selection(SPECIFIC_VALUE);
}

void Application__Error__Container_template::copy_template(const Application__Error__Container_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 Application__Error__Container::ALT_nacc:
single_value.field_nacc = new Application__Error__Container__NACC_template(*other_value.single_value.field_nacc);
break;
case Application__Error__Container::ALT_si3:
single_value.field_si3 = new Application__Error__Container__SI3_template(*other_value.single_value.field_si3);
break;
case Application__Error__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new Application__Error__Container__MBMS__data__channel_template(*other_value.single_value.field_mBMS__data__channel);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Application_Error_Container.");
}
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 Application__Error__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 Application__Error__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Error__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 template of union type @BSSGP_Types.Application_Error_Container.");
}
set_selection(other_value);
}

Application__Error__Container_template::Application__Error__Container_template()
{
}

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

Application__Error__Container_template::Application__Error__Container_template(const Application__Error__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Application__Error__Container_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Error__Container::ALT_nacc:
delete single_value.field_nacc;
break;
case Application__Error__Container::ALT_si3:
delete single_value.field_si3;
break;
case Application__Error__Container::ALT_mBMS__data__channel:
delete single_value.field_mBMS__data__channel;
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;
}

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

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

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

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

boolean Application__Error__Container_template::match(const Application__Error__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:
{
Application__Error__Container::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Application__Error__Container::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Application__Error__Container::ALT_nacc:
return single_value.field_nacc->match(other_value.nacc(), legacy);
case Application__Error__Container::ALT_si3:
return single_value.field_si3->match(other_value.si3(), legacy);
case Application__Error__Container::ALT_mBMS__data__channel:
return single_value.field_mBMS__data__channel->match(other_value.mBMS__data__channel(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Application_Error_Container.");
}
}
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.Application_Error_Container.");
}
return FALSE;
}

boolean Application__Error__Container_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Application__Error__Container::ALT_nacc:
return single_value.field_nacc->is_value();
case Application__Error__Container::ALT_si3:
return single_value.field_si3->is_value();
case Application__Error__Container::ALT_mBMS__data__channel:
return single_value.field_mBMS__data__channel->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.Application_Error_Container.");
}
}

Application__Error__Container Application__Error__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 union type @BSSGP_Types.Application_Error_Container.");
Application__Error__Container ret_val;
switch (single_value.union_selection) {
case Application__Error__Container::ALT_nacc:
ret_val.nacc() = single_value.field_nacc->valueof();
break;
case Application__Error__Container::ALT_si3:
ret_val.si3() = single_value.field_si3->valueof();
break;
case Application__Error__Container::ALT_mBMS__data__channel:
ret_val.mBMS__data__channel() = single_value.field_mBMS__data__channel->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.Application_Error_Container.");
}
return ret_val;
}

Application__Error__Container_template& Application__Error__Container_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.Application_Error_Container.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Application_Error_Container.");
return value_list.list_value[list_index];
}
void Application__Error__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 ("Internal error: Setting an invalid list for a template of union type @BSSGP_Types.Application_Error_Container.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Application__Error__Container_template[list_length];
}

Application__Error__Container__NACC_template& Application__Error__Container_template::nacc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Error__Container::ALT_nacc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nacc = new Application__Error__Container__NACC_template(ANY_VALUE);
else single_value.field_nacc = new Application__Error__Container__NACC_template;
single_value.union_selection = Application__Error__Container::ALT_nacc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nacc;
}

const Application__Error__Container__NACC_template& Application__Error__Container_template::nacc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nacc in a non-specific template of union type @BSSGP_Types.Application_Error_Container.");
if (single_value.union_selection != Application__Error__Container::ALT_nacc) TTCN_error("Accessing non-selected field nacc in a template of union type @BSSGP_Types.Application_Error_Container.");
return *single_value.field_nacc;
}

Application__Error__Container__SI3_template& Application__Error__Container_template::si3()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Error__Container::ALT_si3) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si3 = new Application__Error__Container__SI3_template(ANY_VALUE);
else single_value.field_si3 = new Application__Error__Container__SI3_template;
single_value.union_selection = Application__Error__Container::ALT_si3;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si3;
}

const Application__Error__Container__SI3_template& Application__Error__Container_template::si3() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si3 in a non-specific template of union type @BSSGP_Types.Application_Error_Container.");
if (single_value.union_selection != Application__Error__Container::ALT_si3) TTCN_error("Accessing non-selected field si3 in a template of union type @BSSGP_Types.Application_Error_Container.");
return *single_value.field_si3;
}

Application__Error__Container__MBMS__data__channel_template& Application__Error__Container_template::mBMS__data__channel()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Error__Container::ALT_mBMS__data__channel) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mBMS__data__channel = new Application__Error__Container__MBMS__data__channel_template(ANY_VALUE);
else single_value.field_mBMS__data__channel = new Application__Error__Container__MBMS__data__channel_template;
single_value.union_selection = Application__Error__Container::ALT_mBMS__data__channel;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mBMS__data__channel;
}

const Application__Error__Container__MBMS__data__channel_template& Application__Error__Container_template::mBMS__data__channel() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mBMS_data_channel in a non-specific template of union type @BSSGP_Types.Application_Error_Container.");
if (single_value.union_selection != Application__Error__Container::ALT_mBMS__data__channel) TTCN_error("Accessing non-selected field mBMS_data_channel in a template of union type @BSSGP_Types.Application_Error_Container.");
return *single_value.field_mBMS__data__channel;
}

boolean Application__Error__Container_template::ischosen(Application__Error__Container::union_selection_type checked_selection) const
{
if (checked_selection == Application__Error__Container::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Application_Error_Container.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Application__Error__Container::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Application_Error_Container.");
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.Application_Error_Container 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 Application__Error__Container_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Error__Container::ALT_nacc:
TTCN_Logger::log_event_str("{ nacc := ");
single_value.field_nacc->log();
TTCN_Logger::log_event_str(" }");
break;
case Application__Error__Container::ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case Application__Error__Container::ALT_mBMS__data__channel:
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
single_value.field_mBMS__data__channel->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 Application__Error__Container_template::log_match(const Application__Error__Container& 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 Application__Error__Container::ALT_nacc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nacc");
single_value.field_nacc->log_match(match_value.nacc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nacc := ");
single_value.field_nacc->log_match(match_value.nacc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Application__Error__Container::ALT_si3:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si3");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Application__Error__Container::ALT_mBMS__data__channel:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mBMS_data_channel");
single_value.field_mBMS__data__channel->log_match(match_value.mBMS__data__channel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mBMS_data_channel := ");
single_value.field_mBMS__data__channel->log_match(match_value.mBMS__data__channel(), 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 Application__Error__Container_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 Application__Error__Container::ALT_nacc:
single_value.field_nacc->encode_text(text_buf);
break;
case Application__Error__Container::ALT_si3:
single_value.field_si3->encode_text(text_buf);
break;
case Application__Error__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel->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.Application_Error_Container.");
}
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.Application_Error_Container.");
}
}

void Application__Error__Container_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Application__Error__Container::UNBOUND_VALUE;
Application__Error__Container::union_selection_type new_selection = (Application__Error__Container::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Application__Error__Container::ALT_nacc:
single_value.field_nacc = new Application__Error__Container__NACC_template;
single_value.field_nacc->decode_text(text_buf);
break;
case Application__Error__Container::ALT_si3:
single_value.field_si3 = new Application__Error__Container__SI3_template;
single_value.field_si3->decode_text(text_buf);
break;
case Application__Error__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel = new Application__Error__Container__MBMS__data__channel_template;
single_value.field_mBMS__data__channel->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Application_Error_Container.");
}
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 Application__Error__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: Unrecognized selector was received in a template of type @BSSGP_Types.Application_Error_Container.");
}
}

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

boolean Application__Error__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 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 Application__Error__Container_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.Application_Error_Container'");
    }
    if (strcmp("nacc", param_field) == 0) {
      nacc().set_param(param);
      return;
    } else if (strcmp("si3", param_field) == 0) {
      si3().set_param(param);
      return;
    } else if (strcmp("mBMS_data_channel", param_field) == 0) {
      mBMS__data__channel().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Application_Error_Container'", 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: {
    Application__Error__Container_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.Application_Error_Container");
    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, "nacc")) {
      nacc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si3")) {
      si3().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mBMS_data_channel")) {
      mBMS__data__channel().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Error_Container.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Error__Container_template* precondition = new Application__Error__Container_template;
    precondition->set_param(*m_p->get_elem(0));
    Application__Error__Container_template* implied_template = new Application__Error__Container_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Application__Error__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Application_Error_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Error__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;
switch (single_value.union_selection) {
case Application__Error__Container::ALT_nacc:
single_value.field_nacc->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container");
return;
case Application__Error__Container::ALT_si3:
single_value.field_si3->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container");
return;
case Application__Error__Container::ALT_mBMS__data__channel:
single_value.field_mBMS__data__channel->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container");
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.Application_Error_Container.");
}
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.Application_Error_Container");
}

RAN__Information__Application__Error__RIM__Container::RAN__Information__Application__Error__RIM__Container()
{
}

RAN__Information__Application__Error__RIM__Container::RAN__Information__Application__Error__RIM__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const RIM__Application__Identity& par_rIM__Application__Identity,
    const RIM__Sequence__Number& par_rIM__Sequence__Number,
    const RIM__PDU__Indications& par_rIM__PDU__Indications,
    const OPTIONAL< RIM__Protocol__Version__Number >& par_rIM__Protocol__Version__Number,
    const Application__Error__Container& par_application__Error__Container,
    const OPTIONAL< SON__Transfer__Application__Identity__TLV >& par_sON__Transfer__Application__Identity)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_rIM__Application__Identity(par_rIM__Application__Identity),
  field_rIM__Sequence__Number(par_rIM__Sequence__Number),
  field_rIM__PDU__Indications(par_rIM__PDU__Indications),
  field_rIM__Protocol__Version__Number(par_rIM__Protocol__Version__Number),
  field_application__Error__Container(par_application__Error__Container),
  field_sON__Transfer__Application__Identity(par_sON__Transfer__Application__Identity)
{
}

RAN__Information__Application__Error__RIM__Container::RAN__Information__Application__Error__RIM__Container(const RAN__Information__Application__Error__RIM__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Application_Error_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
else field_rIM__Application__Identity.clean_up();
if (other_value.rIM__Sequence__Number().is_bound()) field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
else field_rIM__Sequence__Number.clean_up();
if (other_value.rIM__PDU__Indications().is_bound()) field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
else field_rIM__PDU__Indications.clean_up();
if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
else field_rIM__Protocol__Version__Number.clean_up();
if (other_value.application__Error__Container().is_bound()) field_application__Error__Container = other_value.application__Error__Container();
else field_application__Error__Container.clean_up();
if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
else field_sON__Transfer__Application__Identity.clean_up();
}

void RAN__Information__Application__Error__RIM__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_rIM__Application__Identity.clean_up();
field_rIM__Sequence__Number.clean_up();
field_rIM__PDU__Indications.clean_up();
field_rIM__Protocol__Version__Number.clean_up();
field_application__Error__Container.clean_up();
field_sON__Transfer__Application__Identity.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Application__Error__RIM__Container::get_descriptor() const { return &RAN__Information__Application__Error__RIM__Container_descr_; }
RAN__Information__Application__Error__RIM__Container& RAN__Information__Application__Error__RIM__Container::operator=(const RAN__Information__Application__Error__RIM__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Application_Error_RIM_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.rIM__Application__Identity().is_bound()) field_rIM__Application__Identity = other_value.rIM__Application__Identity();
  else field_rIM__Application__Identity.clean_up();
  if (other_value.rIM__Sequence__Number().is_bound()) field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
  else field_rIM__Sequence__Number.clean_up();
  if (other_value.rIM__PDU__Indications().is_bound()) field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
  else field_rIM__PDU__Indications.clean_up();
  if (other_value.rIM__Protocol__Version__Number().is_bound()) field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
  else field_rIM__Protocol__Version__Number.clean_up();
  if (other_value.application__Error__Container().is_bound()) field_application__Error__Container = other_value.application__Error__Container();
  else field_application__Error__Container.clean_up();
  if (other_value.sON__Transfer__Application__Identity().is_bound()) field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
  else field_sON__Transfer__Application__Identity.clean_up();
}
return *this;
}

boolean RAN__Information__Application__Error__RIM__Container::operator==(const RAN__Information__Application__Error__RIM__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_rIM__Application__Identity==other_value.field_rIM__Application__Identity
  && field_rIM__Sequence__Number==other_value.field_rIM__Sequence__Number
  && field_rIM__PDU__Indications==other_value.field_rIM__PDU__Indications
  && field_rIM__Protocol__Version__Number==other_value.field_rIM__Protocol__Version__Number
  && field_application__Error__Container==other_value.field_application__Error__Container
  && field_sON__Transfer__Application__Identity==other_value.field_sON__Transfer__Application__Identity;
}

boolean RAN__Information__Application__Error__RIM__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_rIM__Application__Identity.is_bound())
  || (field_rIM__Sequence__Number.is_bound())
  || (field_rIM__PDU__Indications.is_bound())
  || (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_bound())
  || (field_application__Error__Container.is_bound())
  || (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_bound());
}
boolean RAN__Information__Application__Error__RIM__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_rIM__Application__Identity.is_value()
  && field_rIM__Sequence__Number.is_value()
  && field_rIM__PDU__Indications.is_value()
  && (OPTIONAL_OMIT == field_rIM__Protocol__Version__Number.get_selection() || field_rIM__Protocol__Version__Number.is_value())
  && field_application__Error__Container.is_value()
  && (OPTIONAL_OMIT == field_sON__Transfer__Application__Identity.get_selection() || field_sON__Transfer__Application__Identity.is_value());
}
int RAN__Information__Application__Error__RIM__Container::size_of() const
{
  int ret_val = 7;
  if (field_rIM__Protocol__Version__Number.ispresent()) ret_val++;
  if (field_sON__Transfer__Application__Identity.ispresent()) ret_val++;
  return ret_val;
}

void RAN__Information__Application__Error__RIM__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(", rIM_Application_Identity := ");
field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
field_rIM__Sequence__Number.log();
TTCN_Logger::log_event_str(", rIM_PDU_Indications := ");
field_rIM__PDU__Indications.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", application_Error_Container := ");
field_application__Error__Container.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
field_sON__Transfer__Application__Identity.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Application__Error__RIM__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 (rIM__Application__Identity().is_bound()) rIM__Application__Identity().set_implicit_omit();
if (rIM__Sequence__Number().is_bound()) rIM__Sequence__Number().set_implicit_omit();
if (rIM__PDU__Indications().is_bound()) rIM__PDU__Indications().set_implicit_omit();
if (!rIM__Protocol__Version__Number().is_bound()) rIM__Protocol__Version__Number() = OMIT_VALUE;
else rIM__Protocol__Version__Number().set_implicit_omit();
if (application__Error__Container().is_bound()) application__Error__Container().set_implicit_omit();
if (!sON__Transfer__Application__Identity().is_bound()) sON__Transfer__Application__Identity() = OMIT_VALUE;
else sON__Transfer__Application__Identity().set_implicit_omit();
}

void RAN__Information__Application__Error__RIM__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 (9<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__Sequence__Number().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__PDU__Indications().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) application__Error__Container().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_Sequence_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Sequence__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_PDU_Indications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__PDU__Indications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "application_Error_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          application__Error__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(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Application_Error_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
  }
}

void RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.encode_text(text_buf);
field_rIM__Sequence__Number.encode_text(text_buf);
field_rIM__PDU__Indications.encode_text(text_buf);
field_rIM__Protocol__Version__Number.encode_text(text_buf);
field_application__Error__Container.encode_text(text_buf);
field_sON__Transfer__Application__Identity.encode_text(text_buf);
}

void RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.decode_text(text_buf);
field_rIM__Sequence__Number.decode_text(text_buf);
field_rIM__PDU__Indications.decode_text(text_buf);
field_rIM__Protocol__Version__Number.decode_text(text_buf);
field_application__Error__Container.decode_text(text_buf);
field_sON__Transfer__Application__Identity.decode_text(text_buf);
}

void RAN__Information__Application__Error__RIM__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 RAN__Information__Application__Error__RIM__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 RAN__Information__Application__Error__RIM__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, RAN__Information__Application__Error__RIM__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Application__Error__RIM__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, RAN__Information__Application__Error__RIM__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Application__Error__RIM__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, RIM__Application__Identity_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Application__Identity.RAW_decode(RIM__Application__Identity_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, RIM__Sequence__Number_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Sequence__Number.RAW_decode(RIM__Sequence__Number_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, RIM__PDU__Indications_descr_.raw->forceomit);
  decoded_field_length = field_rIM__PDU__Indications.RAW_decode(RIM__PDU__Indications_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 (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_rIM__Protocol__Version__Number = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, RIM__Protocol__Version__Number_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Protocol__Version__Number().RAW_decode(RIM__Protocol__Version__Number_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_rIM__Protocol__Version__Number = 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_rIM__Protocol__Version__Number=OMIT_VALUE;
  if (field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_26) selected_field = 0;
  else if (field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_27) selected_field = 1;
  else if (field_rIM__Application__Identity.rIMApplicationIdentity() ==  os_59) selected_field = 2;
  else selected_field = -1;
  RAW_Force_Omit field_7_force_omit(7, force_omit, RAN__Information__Application__Error__RIM__Container_application__Error__Container_descr_.raw->forceomit);
  decoded_field_length = field_application__Error__Container.RAW_decode(RAN__Information__Application__Error__RIM__Container_application__Error__Container_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, selected_field, 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 (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_sON__Transfer__Application__Identity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, SON__Transfer__Application__Identity__TLV_descr_.raw->forceomit);
  decoded_field_length = field_sON__Transfer__Application__Identity().RAW_decode(SON__Transfer__Application__Identity__TLV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_sON__Transfer__Application__Identity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  }
  }
  }
  else field_sON__Transfer__Application__Identity=OMIT_VALUE;
  if (field_iEI !=  os_100) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Application__Error__RIM__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 = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RAN__Information__Application__Error__RIM__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Application__Error__RIM__Container_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RIM__Application__Identity_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RIM__Sequence__Number_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RIM__PDU__Indications_descr_.raw);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RIM__Protocol__Version__Number_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, RAN__Information__Application__Error__RIM__Container_application__Error__Container_descr_.raw);
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, SON__Transfer__Application__Identity__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Application__Error__RIM__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Application__Error__RIM__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rIM__Application__Identity.RAW_encode(RIM__Application__Identity_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rIM__Sequence__Number.RAW_encode(RIM__Sequence__Number_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_rIM__PDU__Indications.RAW_encode(RIM__PDU__Indications_descr_, *myleaf.body.node.nodes[5]);
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  encoded_length += field_rIM__Protocol__Version__Number().RAW_encode(RIM__Protocol__Version__Number_descr_, *myleaf.body.node.nodes[6]);
  }
  encoded_length += field_application__Error__Container.RAW_encode(RAN__Information__Application__Error__RIM__Container_application__Error__Container_descr_, *myleaf.body.node.nodes[7]);
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  encoded_length += field_sON__Transfer__Application__Identity().RAW_encode(SON__Transfer__Application__Identity__TLV_descr_, *myleaf.body.node.nodes[8]);
  }
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 6;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(6);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  if (field_rIM__Protocol__Version__Number.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = 0;
  }
  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;
  if (field_sON__Transfer__Application__Identity.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].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(RAN__Information__Application__Error__RIM__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(RAN__Information__Application__Error__RIM__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_application__Error__Container.get_selection()) {
  case Application__Error__Container::ALT_nacc:
  if (field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_26) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 3, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_26.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case Application__Error__Container::ALT_si3:
  if (field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_27) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 3, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_27.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case Application__Error__Container::ALT_mBMS__data__channel:
  if (field_rIM__Application__Identity.rIMApplicationIdentity() !=  os_59) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 3, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_59.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_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_100) {
  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_100.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 RAN__Information__Application__Error__RIM__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
RIM__Application__Identity_template field_rIM__Application__Identity;
RIM__Sequence__Number_template field_rIM__Sequence__Number;
RIM__PDU__Indications_template field_rIM__PDU__Indications;
RIM__Protocol__Version__Number_template field_rIM__Protocol__Version__Number;
Application__Error__Container_template field_application__Error__Container;
SON__Transfer__Application__Identity__TLV_template field_sON__Transfer__Application__Identity;
};

void RAN__Information__Application__Error__RIM__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_rIM__Application__Identity = ANY_VALUE;
single_value->field_rIM__Sequence__Number = ANY_VALUE;
single_value->field_rIM__PDU__Indications = ANY_VALUE;
single_value->field_rIM__Protocol__Version__Number = ANY_OR_OMIT;
single_value->field_application__Error__Container = ANY_VALUE;
single_value->field_sON__Transfer__Application__Identity = ANY_OR_OMIT;
}
}
}

void RAN__Information__Application__Error__RIM__Container_template::copy_value(const RAN__Information__Application__Error__RIM__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.rIM__Application__Identity().is_bound()) {
  single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
  single_value->field_rIM__Application__Identity.clean_up();
}
if (other_value.rIM__Sequence__Number().is_bound()) {
  single_value->field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
} else {
  single_value->field_rIM__Sequence__Number.clean_up();
}
if (other_value.rIM__PDU__Indications().is_bound()) {
  single_value->field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
} else {
  single_value->field_rIM__PDU__Indications.clean_up();
}
if (other_value.rIM__Protocol__Version__Number().is_bound()) {
  if (other_value.rIM__Protocol__Version__Number().ispresent()) single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number()();
  else single_value->field_rIM__Protocol__Version__Number = OMIT_VALUE;
} else {
  single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (other_value.application__Error__Container().is_bound()) {
  single_value->field_application__Error__Container = other_value.application__Error__Container();
} else {
  single_value->field_application__Error__Container.clean_up();
}
if (other_value.sON__Transfer__Application__Identity().is_bound()) {
  if (other_value.sON__Transfer__Application__Identity().ispresent()) single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity()();
  else single_value->field_sON__Transfer__Application__Identity = OMIT_VALUE;
} else {
  single_value->field_sON__Transfer__Application__Identity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Application__Error__RIM__Container_template::copy_template(const RAN__Information__Application__Error__RIM__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.rIM__Application__Identity().get_selection()) {
single_value->field_rIM__Application__Identity = other_value.rIM__Application__Identity();
} else {
single_value->field_rIM__Application__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Sequence__Number().get_selection()) {
single_value->field_rIM__Sequence__Number = other_value.rIM__Sequence__Number();
} else {
single_value->field_rIM__Sequence__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__PDU__Indications().get_selection()) {
single_value->field_rIM__PDU__Indications = other_value.rIM__PDU__Indications();
} else {
single_value->field_rIM__PDU__Indications.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Protocol__Version__Number().get_selection()) {
single_value->field_rIM__Protocol__Version__Number = other_value.rIM__Protocol__Version__Number();
} else {
single_value->field_rIM__Protocol__Version__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.application__Error__Container().get_selection()) {
single_value->field_application__Error__Container = other_value.application__Error__Container();
} else {
single_value->field_application__Error__Container.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sON__Transfer__Application__Identity().get_selection()) {
single_value->field_sON__Transfer__Application__Identity = other_value.sON__Transfer__Application__Identity();
} else {
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Application__Error__RIM__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 RAN__Information__Application__Error__RIM__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Application__Error__RIM__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.RAN_Information_Application_Error_RIM_Container.");
break;
}
set_selection(other_value);
}

RAN__Information__Application__Error__RIM__Container_template::RAN__Information__Application__Error__RIM__Container_template()
{
}

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

RAN__Information__Application__Error__RIM__Container_template::RAN__Information__Application__Error__RIM__Container_template(const RAN__Information__Application__Error__RIM__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Application__Error__RIM__Container_template::match(const RAN__Information__Application__Error__RIM__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.rIM__Application__Identity().is_bound()) return FALSE;
if(!single_value->field_rIM__Application__Identity.match(other_value.rIM__Application__Identity(), legacy))return FALSE;
if(!other_value.rIM__Sequence__Number().is_bound()) return FALSE;
if(!single_value->field_rIM__Sequence__Number.match(other_value.rIM__Sequence__Number(), legacy))return FALSE;
if(!other_value.rIM__PDU__Indications().is_bound()) return FALSE;
if(!single_value->field_rIM__PDU__Indications.match(other_value.rIM__PDU__Indications(), legacy))return FALSE;
if(!other_value.rIM__Protocol__Version__Number().is_bound()) return FALSE;
if((other_value.rIM__Protocol__Version__Number().ispresent() ? !single_value->field_rIM__Protocol__Version__Number.match((const RIM__Protocol__Version__Number&)other_value.rIM__Protocol__Version__Number(), legacy) : !single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)))return FALSE;
if(!other_value.application__Error__Container().is_bound()) return FALSE;
if(!single_value->field_application__Error__Container.match(other_value.application__Error__Container(), legacy))return FALSE;
if(!other_value.sON__Transfer__Application__Identity().is_bound()) return FALSE;
if((other_value.sON__Transfer__Application__Identity().ispresent() ? !single_value->field_sON__Transfer__Application__Identity.match((const SON__Transfer__Application__Identity__TLV&)other_value.sON__Transfer__Application__Identity(), legacy) : !single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_Application_Error_RIM_Container.");
}
return FALSE;
}

boolean RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.is_bound()
 || single_value->field_rIM__Sequence__Number.is_bound()
 || single_value->field_rIM__PDU__Indications.is_bound()
 || (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_bound())
 || single_value->field_application__Error__Container.is_bound()
 || (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_bound());
}

boolean RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.is_value()
 && single_value->field_rIM__Sequence__Number.is_value()
 && single_value->field_rIM__PDU__Indications.is_value()
 && (single_value->field_rIM__Protocol__Version__Number.is_omit() || single_value->field_rIM__Protocol__Version__Number.is_value())
 && single_value->field_application__Error__Container.is_value()
 && (single_value->field_sON__Transfer__Application__Identity.is_omit() || single_value->field_sON__Transfer__Application__Identity.is_value());
}

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

RAN__Information__Application__Error__RIM__Container RAN__Information__Application__Error__RIM__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.RAN_Information_Application_Error_RIM_Container.");
RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.is_bound()) {
ret_val.rIM__Application__Identity() = single_value->field_rIM__Application__Identity.valueof();
}
if (single_value->field_rIM__Sequence__Number.is_bound()) {
ret_val.rIM__Sequence__Number() = single_value->field_rIM__Sequence__Number.valueof();
}
if (single_value->field_rIM__PDU__Indications.is_bound()) {
ret_val.rIM__PDU__Indications() = single_value->field_rIM__PDU__Indications.valueof();
}
if (single_value->field_rIM__Protocol__Version__Number.is_omit()) ret_val.rIM__Protocol__Version__Number() = OMIT_VALUE;
else if (single_value->field_rIM__Protocol__Version__Number.is_bound()) {
ret_val.rIM__Protocol__Version__Number() = single_value->field_rIM__Protocol__Version__Number.valueof();
}
if (single_value->field_application__Error__Container.is_bound()) {
ret_val.application__Error__Container() = single_value->field_application__Error__Container.valueof();
}
if (single_value->field_sON__Transfer__Application__Identity.is_omit()) ret_val.sON__Transfer__Application__Identity() = OMIT_VALUE;
else if (single_value->field_sON__Transfer__Application__Identity.is_bound()) {
ret_val.sON__Transfer__Application__Identity() = single_value->field_sON__Transfer__Application__Identity.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

RIM__Application__Identity_template& RAN__Information__Application__Error__RIM__Container_template::rIM__Application__Identity()
{
set_specific();
return single_value->field_rIM__Application__Identity;
}

const RIM__Application__Identity_template& RAN__Information__Application__Error__RIM__Container_template::rIM__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container.");
return single_value->field_rIM__Application__Identity;
}

RIM__Sequence__Number_template& RAN__Information__Application__Error__RIM__Container_template::rIM__Sequence__Number()
{
set_specific();
return single_value->field_rIM__Sequence__Number;
}

const RIM__Sequence__Number_template& RAN__Information__Application__Error__RIM__Container_template::rIM__Sequence__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Sequence_Number of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container.");
return single_value->field_rIM__Sequence__Number;
}

RIM__PDU__Indications_template& RAN__Information__Application__Error__RIM__Container_template::rIM__PDU__Indications()
{
set_specific();
return single_value->field_rIM__PDU__Indications;
}

const RIM__PDU__Indications_template& RAN__Information__Application__Error__RIM__Container_template::rIM__PDU__Indications() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_PDU_Indications of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container.");
return single_value->field_rIM__PDU__Indications;
}

RIM__Protocol__Version__Number_template& RAN__Information__Application__Error__RIM__Container_template::rIM__Protocol__Version__Number()
{
set_specific();
return single_value->field_rIM__Protocol__Version__Number;
}

const RIM__Protocol__Version__Number_template& RAN__Information__Application__Error__RIM__Container_template::rIM__Protocol__Version__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Protocol_Version_Number of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container.");
return single_value->field_rIM__Protocol__Version__Number;
}

Application__Error__Container_template& RAN__Information__Application__Error__RIM__Container_template::application__Error__Container()
{
set_specific();
return single_value->field_application__Error__Container;
}

const Application__Error__Container_template& RAN__Information__Application__Error__RIM__Container_template::application__Error__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field application_Error_Container of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container.");
return single_value->field_application__Error__Container;
}

SON__Transfer__Application__Identity__TLV_template& RAN__Information__Application__Error__RIM__Container_template::sON__Transfer__Application__Identity()
{
set_specific();
return single_value->field_sON__Transfer__Application__Identity;
}

const SON__Transfer__Application__Identity__TLV_template& RAN__Information__Application__Error__RIM__Container_template::sON__Transfer__Application__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_Transfer_Application_Identity of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container.");
return single_value->field_sON__Transfer__Application__Identity;
}

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

void RAN__Information__Application__Error__RIM__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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log();
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
single_value->field_rIM__Sequence__Number.log();
TTCN_Logger::log_event_str(", rIM_PDU_Indications := ");
single_value->field_rIM__PDU__Indications.log();
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(", application_Error_Container := ");
single_value->field_application__Error__Container.log();
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Application__Error__RIM__Container_template::log_match(const RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.match(match_value.rIM__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Application_Identity");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__Sequence__Number.match(match_value.rIM__Sequence__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Sequence_Number");
single_value->field_rIM__Sequence__Number.log_match(match_value.rIM__Sequence__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__PDU__Indications.match(match_value.rIM__PDU__Indications(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_PDU_Indications");
single_value->field_rIM__PDU__Indications.log_match(match_value.rIM__PDU__Indications(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rIM__Protocol__Version__Number().ispresent()){
if(!single_value->field_rIM__Protocol__Version__Number.match(match_value.rIM__Protocol__Version__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number");
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rIM_Protocol_Version_Number := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rIM__Protocol__Version__Number.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_application__Error__Container.match(match_value.application__Error__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".application_Error_Container");
single_value->field_application__Error__Container.log_match(match_value.application__Error__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.sON__Transfer__Application__Identity().ispresent()){
if(!single_value->field_sON__Transfer__Application__Identity.match(match_value.sON__Transfer__Application__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity");
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sON__Transfer__Application__Identity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sON_Transfer_Application_Identity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sON__Transfer__Application__Identity.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(", rIM_Application_Identity := ");
single_value->field_rIM__Application__Identity.log_match(match_value.rIM__Application__Identity(), legacy);
TTCN_Logger::log_event_str(", rIM_Sequence_Number := ");
single_value->field_rIM__Sequence__Number.log_match(match_value.rIM__Sequence__Number(), legacy);
TTCN_Logger::log_event_str(", rIM_PDU_Indications := ");
single_value->field_rIM__PDU__Indications.log_match(match_value.rIM__PDU__Indications(), legacy);
TTCN_Logger::log_event_str(", rIM_Protocol_Version_Number := ");
if (match_value.rIM__Protocol__Version__Number().ispresent()) {
single_value->field_rIM__Protocol__Version__Number.log_match(match_value.rIM__Protocol__Version__Number(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rIM__Protocol__Version__Number.log();
if (single_value->field_rIM__Protocol__Version__Number.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", application_Error_Container := ");
single_value->field_application__Error__Container.log_match(match_value.application__Error__Container(), legacy);
TTCN_Logger::log_event_str(", sON_Transfer_Application_Identity := ");
if (match_value.sON__Transfer__Application__Identity().ispresent()) {
single_value->field_sON__Transfer__Application__Identity.log_match(match_value.sON__Transfer__Application__Identity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sON__Transfer__Application__Identity.log();
if (single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.encode_text(text_buf);
single_value->field_rIM__Sequence__Number.encode_text(text_buf);
single_value->field_rIM__PDU__Indications.encode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.encode_text(text_buf);
single_value->field_application__Error__Container.encode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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.RAN_Information_Application_Error_RIM_Container.");
}
}

void RAN__Information__Application__Error__RIM__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_rIM__Application__Identity.decode_text(text_buf);
single_value->field_rIM__Sequence__Number.decode_text(text_buf);
single_value->field_rIM__PDU__Indications.decode_text(text_buf);
single_value->field_rIM__Protocol__Version__Number.decode_text(text_buf);
single_value->field_application__Error__Container.decode_text(text_buf);
single_value->field_sON__Transfer__Application__Identity.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 RAN__Information__Application__Error__RIM__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.RAN_Information_Application_Error_RIM_Container.");
}
}

void RAN__Information__Application__Error__RIM__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: {
    RAN__Information__Application__Error__RIM__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 (9<param.get_size()) {
      param.error("record template of type @BSSGP_Types.RAN_Information_Application_Error_RIM_Container has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Application__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rIM__Sequence__Number().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__PDU__Indications().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rIM__Protocol__Version__Number().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) application__Error__Container().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Application__Identity().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Application__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(), "rIM_Sequence_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Sequence__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_PDU_Indications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__PDU__Indications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rIM_Protocol_Version_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Protocol__Version__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "application_Error_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          application__Error__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(), "sON_Transfer_Application_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Application__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RAN_Information_Application_Error_RIM_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Application__Error__RIM__Container_template* precondition = new RAN__Information__Application__Error__RIM__Container_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__Application__Error__RIM__Container_template* implied_template = new RAN__Information__Application__Error__RIM__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__Application__Error__RIM__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Application__Error__RIM__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.RAN_Information_Application_Error_RIM_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
single_value->field_rIM__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
single_value->field_rIM__Sequence__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
single_value->field_rIM__PDU__Indications.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
single_value->field_rIM__Protocol__Version__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
single_value->field_application__Error__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_Container");
single_value->field_sON__Transfer__Application__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Error_RIM_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.RAN_Information_Application_Error_RIM_Container");
}

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

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

RAN__Information__Request__Application__Container__SON__transfer::RAN__Information__Request__Application__Container__SON__transfer()
{
}

RAN__Information__Request__Application__Container__SON__transfer::RAN__Information__Request__Application__Container__SON__transfer(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier,
    const OCTETSTRING& par_sON__Transfer__Request__Container)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier),
  field_sON__Transfer__Request__Container(par_sON__Transfer__Request__Container)
{
}

RAN__Information__Request__Application__Container__SON__transfer::RAN__Information__Request__Application__Container__SON__transfer(const RAN__Information__Request__Application__Container__SON__transfer& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
else field_reporting__Cell__Identifier.clean_up();
if (other_value.sON__Transfer__Request__Container().is_bound()) field_sON__Transfer__Request__Container = other_value.sON__Transfer__Request__Container();
else field_sON__Transfer__Request__Container.clean_up();
}

void RAN__Information__Request__Application__Container__SON__transfer::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
field_sON__Transfer__Request__Container.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Request__Application__Container__SON__transfer::get_descriptor() const { return &RAN__Information__Request__Application__Container__SON__transfer_descr_; }
RAN__Information__Request__Application__Container__SON__transfer& RAN__Information__Request__Application__Container__SON__transfer::operator=(const RAN__Information__Request__Application__Container__SON__transfer& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
  else field_reporting__Cell__Identifier.clean_up();
  if (other_value.sON__Transfer__Request__Container().is_bound()) field_sON__Transfer__Request__Container = other_value.sON__Transfer__Request__Container();
  else field_sON__Transfer__Request__Container.clean_up();
}
return *this;
}

boolean RAN__Information__Request__Application__Container__SON__transfer::operator==(const RAN__Information__Request__Application__Container__SON__transfer& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reporting__Cell__Identifier==other_value.field_reporting__Cell__Identifier
  && field_sON__Transfer__Request__Container==other_value.field_sON__Transfer__Request__Container;
}

boolean RAN__Information__Request__Application__Container__SON__transfer::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reporting__Cell__Identifier.is_bound())
  || (field_sON__Transfer__Request__Container.is_bound());
}
boolean RAN__Information__Request__Application__Container__SON__transfer::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reporting__Cell__Identifier.is_value()
  && field_sON__Transfer__Request__Container.is_value();
}
void RAN__Information__Request__Application__Container__SON__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(", reporting_Cell_Identifier := ");
field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", sON_Transfer_Request_Container := ");
field_sON__Transfer__Request__Container.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Request__Application__Container__SON__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 (reporting__Cell__Identifier().is_bound()) reporting__Cell__Identifier().set_implicit_omit();
if (sON__Transfer__Request__Container().is_bound()) sON__Transfer__Request__Container().set_implicit_omit();
}

void RAN__Information__Request__Application__Container__SON__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer 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) reporting__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Request__Container().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(), "reporting_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reporting__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Request_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Request__Container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer");
  }
}

void RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier.encode_text(text_buf);
field_sON__Transfer__Request__Container.encode_text(text_buf);
}

void RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier.decode_text(text_buf);
field_sON__Transfer__Request__Container.decode_text(text_buf);
}

void RAN__Information__Request__Application__Container__SON__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 RAN__Information__Request__Application__Container__SON__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 RAN__Information__Request__Application__Container__SON__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, RAN__Information__Request__Application__Container__SON__transfer_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Request__Application__Container__SON__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, RAN__Information__Request__Application__Container__SON__transfer_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Request__Application__Container__SON__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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_sON__Transfer__Request__Container.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_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_137) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Request__Application__Container__SON__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 = 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, RAN__Information__Request__Application__Container__SON__transfer_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Request__Application__Container__SON__transfer_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, 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(RAN__Information__Request__Application__Container__SON__transfer_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Request__Application__Container__SON__transfer_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_sON__Transfer__Request__Container.RAW_encode(General__Types::OCTN_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(RAN__Information__Request__Application__Container__SON__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(RAN__Information__Request__Application__Container__SON__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_137) {
  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_137.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 RAN__Information__Request__Application__Container__SON__transfer_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
OCTETSTRING_template field_sON__Transfer__Request__Container;
};

void RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier = ANY_VALUE;
single_value->field_sON__Transfer__Request__Container = ANY_VALUE;
}
}
}

void RAN__Information__Request__Application__Container__SON__transfer_template::copy_value(const RAN__Information__Request__Application__Container__SON__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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
if (other_value.sON__Transfer__Request__Container().is_bound()) {
  single_value->field_sON__Transfer__Request__Container = other_value.sON__Transfer__Request__Container();
} else {
  single_value->field_sON__Transfer__Request__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Request__Application__Container__SON__transfer_template::copy_template(const RAN__Information__Request__Application__Container__SON__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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sON__Transfer__Request__Container().get_selection()) {
single_value->field_sON__Transfer__Request__Container = other_value.sON__Transfer__Request__Container();
} else {
single_value->field_sON__Transfer__Request__Container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RAN__Information__Request__Application__Container__SON__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 RAN__Information__Request__Application__Container__SON__transfer_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Request__Application__Container__SON__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.RAN_Information_Request_Application_Container_SON_transfer.");
break;
}
set_selection(other_value);
}

RAN__Information__Request__Application__Container__SON__transfer_template::RAN__Information__Request__Application__Container__SON__transfer_template()
{
}

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

RAN__Information__Request__Application__Container__SON__transfer_template::RAN__Information__Request__Application__Container__SON__transfer_template(const RAN__Information__Request__Application__Container__SON__transfer& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Request__Application__Container__SON__transfer_template::match(const RAN__Information__Request__Application__Container__SON__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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), legacy))return FALSE;
if(!other_value.sON__Transfer__Request__Container().is_bound()) return FALSE;
if(!single_value->field_sON__Transfer__Request__Container.match(other_value.sON__Transfer__Request__Container(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer.");
}
return FALSE;
}

boolean RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier.is_bound()
 || single_value->field_sON__Transfer__Request__Container.is_bound();
}

boolean RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier.is_value()
 && single_value->field_sON__Transfer__Request__Container.is_value();
}

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

RAN__Information__Request__Application__Container__SON__transfer RAN__Information__Request__Application__Container__SON__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.RAN_Information_Request_Application_Container_SON_transfer.");
RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
if (single_value->field_sON__Transfer__Request__Container.is_bound()) {
ret_val.sON__Transfer__Request__Container() = single_value->field_sON__Transfer__Request__Container.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Request__Application__Container__SON__transfer_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Request__Application__Container__SON__transfer_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer.");
return single_value->field_reporting__Cell__Identifier;
}

OCTETSTRING_template& RAN__Information__Request__Application__Container__SON__transfer_template::sON__Transfer__Request__Container()
{
set_specific();
return single_value->field_sON__Transfer__Request__Container;
}

const OCTETSTRING_template& RAN__Information__Request__Application__Container__SON__transfer_template::sON__Transfer__Request__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_Transfer_Request_Container of a non-specific template of type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer.");
return single_value->field_sON__Transfer__Request__Container;
}

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

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

void RAN__Information__Request__Application__Container__SON__transfer_template::log_match(const RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sON__Transfer__Request__Container.match(match_value.sON__Transfer__Request__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".sON_Transfer_Request_Container");
single_value->field_sON__Transfer__Request__Container.log_match(match_value.sON__Transfer__Request__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", sON_Transfer_Request_Container := ");
single_value->field_sON__Transfer__Request__Container.log_match(match_value.sON__Transfer__Request__Container(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RAN__Information__Request__Application__Container__SON__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_reporting__Cell__Identifier.encode_text(text_buf);
single_value->field_sON__Transfer__Request__Container.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer.");
}
}

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

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

void RAN__Information__Request__Application__Container__SON__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.RAN_Information_Request_Application_Container_SON_transfer");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer");
single_value->field_reporting__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Request_Application_Container_SON_transfer");
single_value->field_sON__Transfer__Request__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Request_Application_Container_SON_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.RAN_Information_Request_Application_Container_SON_transfer");
}

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

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

RAN__Information__Request__Application__Container__UTRA__SI::RAN__Information__Request__Application__Container__UTRA__SI()
{
}

RAN__Information__Request__Application__Container__UTRA__SI::RAN__Information__Request__Application__Container__UTRA__SI(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier)
{
}

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

void RAN__Information__Request__Application__Container__UTRA__SI::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
}

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

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

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

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

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

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

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

void RAN__Information__Request__Application__Container__UTRA__SI::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 RAN__Information__Request__Application__Container__UTRA__SI::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 RAN__Information__Request__Application__Container__UTRA__SI::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, RAN__Information__Request__Application__Container__UTRA__SI_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Request__Application__Container__UTRA__SI_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, RAN__Information__Request__Application__Container__UTRA__SI_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Request__Application__Container__UTRA__SI_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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_137) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Request__Application__Container__UTRA__SI::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, RAN__Information__Request__Application__Container__UTRA__SI_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Request__Application__Container__UTRA__SI_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RAN__Information__Request__Application__Container__UTRA__SI_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Request__Application__Container__UTRA__SI_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_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(RAN__Information__Request__Application__Container__UTRA__SI_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(RAN__Information__Request__Application__Container__UTRA__SI_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_137) {
  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_137.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 RAN__Information__Request__Application__Container__UTRA__SI_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
};

void RAN__Information__Request__Application__Container__UTRA__SI_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_reporting__Cell__Identifier = ANY_VALUE;
}
}
}

void RAN__Information__Request__Application__Container__UTRA__SI_template::copy_value(const RAN__Information__Request__Application__Container__UTRA__SI& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Request__Application__Container__UTRA__SI_template::copy_template(const RAN__Information__Request__Application__Container__UTRA__SI_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__UTRA__SI_template[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 RAN__Information__Request__Application__Container__UTRA__SI_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Request__Application__Container__UTRA__SI_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.RAN_Information_Request_Application_Container_UTRA_SI.");
break;
}
set_selection(other_value);
}

RAN__Information__Request__Application__Container__UTRA__SI_template::RAN__Information__Request__Application__Container__UTRA__SI_template()
{
}

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

RAN__Information__Request__Application__Container__UTRA__SI_template::RAN__Information__Request__Application__Container__UTRA__SI_template(const RAN__Information__Request__Application__Container__UTRA__SI& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Request__Application__Container__UTRA__SI_template::match(const RAN__Information__Request__Application__Container__UTRA__SI& 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), 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.RAN_Information_Request_Application_Container_UTRA_SI.");
}
return FALSE;
}

boolean RAN__Information__Request__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.is_bound();
}

boolean RAN__Information__Request__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.is_value();
}

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

RAN__Information__Request__Application__Container__UTRA__SI RAN__Information__Request__Application__Container__UTRA__SI_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.RAN_Information_Request_Application_Container_UTRA_SI.");
RAN__Information__Request__Application__Container__UTRA__SI 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Request__Application__Container__UTRA__SI_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Request__Application__Container__UTRA__SI_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Request_Application_Container_UTRA_SI.");
return single_value->field_reporting__Cell__Identifier;
}

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

void RAN__Information__Request__Application__Container__UTRA__SI_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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__UTRA__SI_template::log_match(const RAN__Information__Request__Application__Container__UTRA__SI& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), 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 RAN__Information__Request__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.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.RAN_Information_Request_Application_Container_UTRA_SI.");
}
}

void RAN__Information__Request__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.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 RAN__Information__Request__Application__Container__UTRA__SI_template[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.RAN_Information_Request_Application_Container_UTRA_SI.");
}
}

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

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

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

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

RAN__Information__Application__Container__SON__transfer::RAN__Information__Application__Container__SON__transfer()
{
}

RAN__Information__Application__Container__SON__transfer::RAN__Information__Application__Container__SON__transfer(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_rAT__Discriminator,
    const BITSTRING& par_spare,
    const Cell__Identifier__V& par_reporting__Cell__Identifier,
    const OCTETSTRING& par_sON__Transfer__Response__Container)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_rAT__Discriminator(par_rAT__Discriminator),
  field_spare(par_spare),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier),
  field_sON__Transfer__Response__Container(par_sON__Transfer__Response__Container)
{
}

RAN__Information__Application__Container__SON__transfer::RAN__Information__Application__Container__SON__transfer(const RAN__Information__Application__Container__SON__transfer& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_SON_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.rAT__Discriminator().is_bound()) field_rAT__Discriminator = other_value.rAT__Discriminator();
else field_rAT__Discriminator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
else field_reporting__Cell__Identifier.clean_up();
if (other_value.sON__Transfer__Response__Container().is_bound()) field_sON__Transfer__Response__Container = other_value.sON__Transfer__Response__Container();
else field_sON__Transfer__Response__Container.clean_up();
}

void RAN__Information__Application__Container__SON__transfer::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_rAT__Discriminator.clean_up();
field_spare.clean_up();
field_reporting__Cell__Identifier.clean_up();
field_sON__Transfer__Response__Container.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Application__Container__SON__transfer::get_descriptor() const { return &RAN__Information__Application__Container__SON__transfer_descr_; }
RAN__Information__Application__Container__SON__transfer& RAN__Information__Application__Container__SON__transfer::operator=(const RAN__Information__Application__Container__SON__transfer& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_SON_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.rAT__Discriminator().is_bound()) field_rAT__Discriminator = other_value.rAT__Discriminator();
  else field_rAT__Discriminator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
  else field_reporting__Cell__Identifier.clean_up();
  if (other_value.sON__Transfer__Response__Container().is_bound()) field_sON__Transfer__Response__Container = other_value.sON__Transfer__Response__Container();
  else field_sON__Transfer__Response__Container.clean_up();
}
return *this;
}

boolean RAN__Information__Application__Container__SON__transfer::operator==(const RAN__Information__Application__Container__SON__transfer& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_rAT__Discriminator==other_value.field_rAT__Discriminator
  && field_spare==other_value.field_spare
  && field_reporting__Cell__Identifier==other_value.field_reporting__Cell__Identifier
  && field_sON__Transfer__Response__Container==other_value.field_sON__Transfer__Response__Container;
}

boolean RAN__Information__Application__Container__SON__transfer::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_rAT__Discriminator.is_bound())
  || (field_spare.is_bound())
  || (field_reporting__Cell__Identifier.is_bound())
  || (field_sON__Transfer__Response__Container.is_bound());
}
boolean RAN__Information__Application__Container__SON__transfer::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_rAT__Discriminator.is_value()
  && field_spare.is_value()
  && field_reporting__Cell__Identifier.is_value()
  && field_sON__Transfer__Response__Container.is_value();
}
void RAN__Information__Application__Container__SON__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(", rAT_Discriminator := ");
field_rAT__Discriminator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", reporting_Cell_Identifier := ");
field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", sON_Transfer_Response_Container := ");
field_sON__Transfer__Response__Container.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Application__Container__SON__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 (rAT__Discriminator().is_bound()) rAT__Discriminator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (reporting__Cell__Identifier().is_bound()) reporting__Cell__Identifier().set_implicit_omit();
if (sON__Transfer__Response__Container().is_bound()) sON__Transfer__Response__Container().set_implicit_omit();
}

void RAN__Information__Application__Container__SON__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 (7<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rAT__Discriminator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) reporting__Cell__Identifier().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Response__Container().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rAT_Discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rAT__Discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "reporting_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reporting__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Response_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Response__Container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RAN_Information_Application_Container_SON_transfer");
  }
}

void RAN__Information__Application__Container__SON__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_rAT__Discriminator.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_reporting__Cell__Identifier.encode_text(text_buf);
field_sON__Transfer__Response__Container.encode_text(text_buf);
}

void RAN__Information__Application__Container__SON__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_rAT__Discriminator.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_reporting__Cell__Identifier.decode_text(text_buf);
field_sON__Transfer__Response__Container.decode_text(text_buf);
}

void RAN__Information__Application__Container__SON__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 RAN__Information__Application__Container__SON__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 RAN__Information__Application__Container__SON__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, RAN__Information__Application__Container__SON__transfer_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Application__Container__SON__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, RAN__Information__Application__Container__SON__transfer_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Application__Container__SON__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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_rAT__Discriminator.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_sON__Transfer__Response__Container.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_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_136) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Application__Container__SON__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 = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RAN__Information__Application__Container__SON__transfer_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Application__Container__SON__transfer_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Cell__Identifier__V_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, 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(RAN__Information__Application__Container__SON__transfer_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Application__Container__SON__transfer_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rAT__Discriminator.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_sON__Transfer__Response__Container.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[6]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 4;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(4);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(RAN__Information__Application__Container__SON__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(RAN__Information__Application__Container__SON__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_136) {
  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_136.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 RAN__Information__Application__Container__SON__transfer_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_rAT__Discriminator;
BITSTRING_template field_spare;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
OCTETSTRING_template field_sON__Transfer__Response__Container;
};

void RAN__Information__Application__Container__SON__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_rAT__Discriminator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_reporting__Cell__Identifier = ANY_VALUE;
single_value->field_sON__Transfer__Response__Container = ANY_VALUE;
}
}
}

void RAN__Information__Application__Container__SON__transfer_template::copy_value(const RAN__Information__Application__Container__SON__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.rAT__Discriminator().is_bound()) {
  single_value->field_rAT__Discriminator = other_value.rAT__Discriminator();
} else {
  single_value->field_rAT__Discriminator.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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
if (other_value.sON__Transfer__Response__Container().is_bound()) {
  single_value->field_sON__Transfer__Response__Container = other_value.sON__Transfer__Response__Container();
} else {
  single_value->field_sON__Transfer__Response__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Application__Container__SON__transfer_template::copy_template(const RAN__Information__Application__Container__SON__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.rAT__Discriminator().get_selection()) {
single_value->field_rAT__Discriminator = other_value.rAT__Discriminator();
} else {
single_value->field_rAT__Discriminator.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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sON__Transfer__Response__Container().get_selection()) {
single_value->field_sON__Transfer__Response__Container = other_value.sON__Transfer__Response__Container();
} else {
single_value->field_sON__Transfer__Response__Container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RAN__Information__Application__Container__SON__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 RAN__Information__Application__Container__SON__transfer_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Application__Container__SON__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.RAN_Information_Application_Container_SON_transfer.");
break;
}
set_selection(other_value);
}

RAN__Information__Application__Container__SON__transfer_template::RAN__Information__Application__Container__SON__transfer_template()
{
}

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

RAN__Information__Application__Container__SON__transfer_template::RAN__Information__Application__Container__SON__transfer_template(const RAN__Information__Application__Container__SON__transfer& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Application__Container__SON__transfer_template::match(const RAN__Information__Application__Container__SON__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.rAT__Discriminator().is_bound()) return FALSE;
if(!single_value->field_rAT__Discriminator.match(other_value.rAT__Discriminator(), 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.reporting__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_reporting__Cell__Identifier.match(other_value.reporting__Cell__Identifier(), legacy))return FALSE;
if(!other_value.sON__Transfer__Response__Container().is_bound()) return FALSE;
if(!single_value->field_sON__Transfer__Response__Container.match(other_value.sON__Transfer__Response__Container(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer.");
}
return FALSE;
}

boolean RAN__Information__Application__Container__SON__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_rAT__Discriminator.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_reporting__Cell__Identifier.is_bound()
 || single_value->field_sON__Transfer__Response__Container.is_bound();
}

boolean RAN__Information__Application__Container__SON__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_rAT__Discriminator.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_reporting__Cell__Identifier.is_value()
 && single_value->field_sON__Transfer__Response__Container.is_value();
}

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

RAN__Information__Application__Container__SON__transfer RAN__Information__Application__Container__SON__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.RAN_Information_Application_Container_SON_transfer.");
RAN__Information__Application__Container__SON__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_rAT__Discriminator.is_bound()) {
ret_val.rAT__Discriminator() = single_value->field_rAT__Discriminator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
if (single_value->field_sON__Transfer__Response__Container.is_bound()) {
ret_val.sON__Transfer__Response__Container() = single_value->field_sON__Transfer__Response__Container.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& RAN__Information__Application__Container__SON__transfer_template::rAT__Discriminator()
{
set_specific();
return single_value->field_rAT__Discriminator;
}

const BITSTRING_template& RAN__Information__Application__Container__SON__transfer_template::rAT__Discriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rAT_Discriminator of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer.");
return single_value->field_rAT__Discriminator;
}

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

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

Cell__Identifier__V_template& RAN__Information__Application__Container__SON__transfer_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Application__Container__SON__transfer_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer.");
return single_value->field_reporting__Cell__Identifier;
}

OCTETSTRING_template& RAN__Information__Application__Container__SON__transfer_template::sON__Transfer__Response__Container()
{
set_specific();
return single_value->field_sON__Transfer__Response__Container;
}

const OCTETSTRING_template& RAN__Information__Application__Container__SON__transfer_template::sON__Transfer__Response__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_Transfer_Response_Container of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer.");
return single_value->field_sON__Transfer__Response__Container;
}

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

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

void RAN__Information__Application__Container__SON__transfer_template::log_match(const RAN__Information__Application__Container__SON__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_rAT__Discriminator.match(match_value.rAT__Discriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".rAT_Discriminator");
single_value->field_rAT__Discriminator.log_match(match_value.rAT__Discriminator(), 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sON__Transfer__Response__Container.match(match_value.sON__Transfer__Response__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".sON_Transfer_Response_Container");
single_value->field_sON__Transfer__Response__Container.log_match(match_value.sON__Transfer__Response__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ 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(", rAT_Discriminator := ");
single_value->field_rAT__Discriminator.log_match(match_value.rAT__Discriminator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", sON_Transfer_Response_Container := ");
single_value->field_sON__Transfer__Response__Container.log_match(match_value.sON__Transfer__Response__Container(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RAN__Information__Application__Container__SON__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_rAT__Discriminator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_reporting__Cell__Identifier.encode_text(text_buf);
single_value->field_sON__Transfer__Response__Container.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer.");
}
}

void RAN__Information__Application__Container__SON__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_rAT__Discriminator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_reporting__Cell__Identifier.decode_text(text_buf);
single_value->field_sON__Transfer__Response__Container.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RAN__Information__Application__Container__SON__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.RAN_Information_Application_Container_SON_transfer.");
}
}

void RAN__Information__Application__Container__SON__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: {
    RAN__Information__Application__Container__SON__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 (7<param.get_size()) {
      param.error("record template of type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rAT__Discriminator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) reporting__Cell__Identifier().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sON__Transfer__Response__Container().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rAT_Discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rAT__Discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "reporting_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reporting__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sON_Transfer_Response_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__Transfer__Response__Container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.RAN_Information_Application_Container_SON_transfer: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RAN__Information__Application__Container__SON__transfer_template* precondition = new RAN__Information__Application__Container__SON__transfer_template;
    precondition->set_param(*param.get_elem(0));
    RAN__Information__Application__Container__SON__transfer_template* implied_template = new RAN__Information__Application__Container__SON__transfer_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RAN__Information__Application__Container__SON__transfer_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RAN_Information_Application_Container_SON_transfer");
  }
  is_ifpresent = param.get_ifpresent();
}

void RAN__Information__Application__Container__SON__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.RAN_Information_Application_Container_SON_transfer");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SON_transfer");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SON_transfer");
single_value->field_rAT__Discriminator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SON_transfer");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SON_transfer");
single_value->field_reporting__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SON_transfer");
single_value->field_sON__Transfer__Response__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_SON_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.RAN_Information_Application_Container_SON_transfer");
}

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

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

RAN__Information__Application__Container__UTRA__SI::RAN__Information__Application__Container__UTRA__SI()
{
}

RAN__Information__Application__Container__UTRA__SI::RAN__Information__Application__Container__UTRA__SI(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Cell__Identifier__V& par_reporting__Cell__Identifier,
    const OCTETSTRING& par_uTRA__SI__Container)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reporting__Cell__Identifier(par_reporting__Cell__Identifier),
  field_uTRA__SI__Container(par_uTRA__SI__Container)
{
}

RAN__Information__Application__Container__UTRA__SI::RAN__Information__Application__Container__UTRA__SI(const RAN__Information__Application__Container__UTRA__SI& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_UTRA_SI.");
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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
else field_reporting__Cell__Identifier.clean_up();
if (other_value.uTRA__SI__Container().is_bound()) field_uTRA__SI__Container = other_value.uTRA__SI__Container();
else field_uTRA__SI__Container.clean_up();
}

void RAN__Information__Application__Container__UTRA__SI::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reporting__Cell__Identifier.clean_up();
field_uTRA__SI__Container.clean_up();
}

const TTCN_Typedescriptor_t* RAN__Information__Application__Container__UTRA__SI::get_descriptor() const { return &RAN__Information__Application__Container__UTRA__SI_descr_; }
RAN__Information__Application__Container__UTRA__SI& RAN__Information__Application__Container__UTRA__SI::operator=(const RAN__Information__Application__Container__UTRA__SI& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RAN_Information_Application_Container_UTRA_SI.");
  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.reporting__Cell__Identifier().is_bound()) field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
  else field_reporting__Cell__Identifier.clean_up();
  if (other_value.uTRA__SI__Container().is_bound()) field_uTRA__SI__Container = other_value.uTRA__SI__Container();
  else field_uTRA__SI__Container.clean_up();
}
return *this;
}

boolean RAN__Information__Application__Container__UTRA__SI::operator==(const RAN__Information__Application__Container__UTRA__SI& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reporting__Cell__Identifier==other_value.field_reporting__Cell__Identifier
  && field_uTRA__SI__Container==other_value.field_uTRA__SI__Container;
}

boolean RAN__Information__Application__Container__UTRA__SI::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reporting__Cell__Identifier.is_bound())
  || (field_uTRA__SI__Container.is_bound());
}
boolean RAN__Information__Application__Container__UTRA__SI::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reporting__Cell__Identifier.is_value()
  && field_uTRA__SI__Container.is_value();
}
void RAN__Information__Application__Container__UTRA__SI::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(", reporting_Cell_Identifier := ");
field_reporting__Cell__Identifier.log();
TTCN_Logger::log_event_str(", uTRA_SI_Container := ");
field_uTRA__SI__Container.log();
TTCN_Logger::log_event_str(" }");
}

void RAN__Information__Application__Container__UTRA__SI::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 (reporting__Cell__Identifier().is_bound()) reporting__Cell__Identifier().set_implicit_omit();
if (uTRA__SI__Container().is_bound()) uTRA__SI__Container().set_implicit_omit();
}

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

void RAN__Information__Application__Container__UTRA__SI::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_reporting__Cell__Identifier.encode_text(text_buf);
field_uTRA__SI__Container.encode_text(text_buf);
}

void RAN__Information__Application__Container__UTRA__SI::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_reporting__Cell__Identifier.decode_text(text_buf);
field_uTRA__SI__Container.decode_text(text_buf);
}

void RAN__Information__Application__Container__UTRA__SI::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 RAN__Information__Application__Container__UTRA__SI::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 RAN__Information__Application__Container__UTRA__SI::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, RAN__Information__Application__Container__UTRA__SI_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RAN__Information__Application__Container__UTRA__SI_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, RAN__Information__Application__Container__UTRA__SI_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RAN__Information__Application__Container__UTRA__SI_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, Cell__Identifier__V_descr_.raw->forceomit);
  decoded_field_length = field_reporting__Cell__Identifier.RAW_decode(Cell__Identifier__V_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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_uTRA__SI__Container.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_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_136) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RAN__Information__Application__Container__UTRA__SI::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, RAN__Information__Application__Container__UTRA__SI_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RAN__Information__Application__Container__UTRA__SI_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, 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(RAN__Information__Application__Container__UTRA__SI_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RAN__Information__Application__Container__UTRA__SI_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reporting__Cell__Identifier.RAW_encode(Cell__Identifier__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_uTRA__SI__Container.RAW_encode(General__Types::OCTN_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(RAN__Information__Application__Container__UTRA__SI_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(RAN__Information__Application__Container__UTRA__SI_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_136) {
  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_136.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 RAN__Information__Application__Container__UTRA__SI_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Cell__Identifier__V_template field_reporting__Cell__Identifier;
OCTETSTRING_template field_uTRA__SI__Container;
};

void RAN__Information__Application__Container__UTRA__SI_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_reporting__Cell__Identifier = ANY_VALUE;
single_value->field_uTRA__SI__Container = ANY_VALUE;
}
}
}

void RAN__Information__Application__Container__UTRA__SI_template::copy_value(const RAN__Information__Application__Container__UTRA__SI& 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.reporting__Cell__Identifier().is_bound()) {
  single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
  single_value->field_reporting__Cell__Identifier.clean_up();
}
if (other_value.uTRA__SI__Container().is_bound()) {
  single_value->field_uTRA__SI__Container = other_value.uTRA__SI__Container();
} else {
  single_value->field_uTRA__SI__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RAN__Information__Application__Container__UTRA__SI_template::copy_template(const RAN__Information__Application__Container__UTRA__SI_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.reporting__Cell__Identifier().get_selection()) {
single_value->field_reporting__Cell__Identifier = other_value.reporting__Cell__Identifier();
} else {
single_value->field_reporting__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uTRA__SI__Container().get_selection()) {
single_value->field_uTRA__SI__Container = other_value.uTRA__SI__Container();
} else {
single_value->field_uTRA__SI__Container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RAN__Information__Application__Container__UTRA__SI_template[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 RAN__Information__Application__Container__UTRA__SI_template(*other_value.implication_.precondition);
implication_.implied_template = new RAN__Information__Application__Container__UTRA__SI_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.RAN_Information_Application_Container_UTRA_SI.");
break;
}
set_selection(other_value);
}

RAN__Information__Application__Container__UTRA__SI_template::RAN__Information__Application__Container__UTRA__SI_template()
{
}

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

RAN__Information__Application__Container__UTRA__SI_template::RAN__Information__Application__Container__UTRA__SI_template(const RAN__Information__Application__Container__UTRA__SI& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean RAN__Information__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.is_bound()
 || single_value->field_uTRA__SI__Container.is_bound();
}

boolean RAN__Information__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.is_value()
 && single_value->field_uTRA__SI__Container.is_value();
}

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

RAN__Information__Application__Container__UTRA__SI RAN__Information__Application__Container__UTRA__SI_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.RAN_Information_Application_Container_UTRA_SI.");
RAN__Information__Application__Container__UTRA__SI 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_reporting__Cell__Identifier.is_bound()) {
ret_val.reporting__Cell__Identifier() = single_value->field_reporting__Cell__Identifier.valueof();
}
if (single_value->field_uTRA__SI__Container.is_bound()) {
ret_val.uTRA__SI__Container() = single_value->field_uTRA__SI__Container.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Cell__Identifier__V_template& RAN__Information__Application__Container__UTRA__SI_template::reporting__Cell__Identifier()
{
set_specific();
return single_value->field_reporting__Cell__Identifier;
}

const Cell__Identifier__V_template& RAN__Information__Application__Container__UTRA__SI_template::reporting__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reporting_Cell_Identifier of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_UTRA_SI.");
return single_value->field_reporting__Cell__Identifier;
}

OCTETSTRING_template& RAN__Information__Application__Container__UTRA__SI_template::uTRA__SI__Container()
{
set_specific();
return single_value->field_uTRA__SI__Container;
}

const OCTETSTRING_template& RAN__Information__Application__Container__UTRA__SI_template::uTRA__SI__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRA_SI_Container of a non-specific template of type @BSSGP_Types.RAN_Information_Application_Container_UTRA_SI.");
return single_value->field_uTRA__SI__Container;
}

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

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

void RAN__Information__Application__Container__UTRA__SI_template::log_match(const RAN__Information__Application__Container__UTRA__SI& 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_reporting__Cell__Identifier.match(match_value.reporting__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".reporting_Cell_Identifier");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uTRA__SI__Container.match(match_value.uTRA__SI__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRA_SI_Container");
single_value->field_uTRA__SI__Container.log_match(match_value.uTRA__SI__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ 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(", reporting_Cell_Identifier := ");
single_value->field_reporting__Cell__Identifier.log_match(match_value.reporting__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", uTRA_SI_Container := ");
single_value->field_uTRA__SI__Container.log_match(match_value.uTRA__SI__Container(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RAN__Information__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.encode_text(text_buf);
single_value->field_uTRA__SI__Container.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.RAN_Information_Application_Container_UTRA_SI.");
}
}

void RAN__Information__Application__Container__UTRA__SI_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_reporting__Cell__Identifier.decode_text(text_buf);
single_value->field_uTRA__SI__Container.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RAN__Information__Application__Container__UTRA__SI_template[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.RAN_Information_Application_Container_UTRA_SI.");
}
}

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

void RAN__Information__Application__Container__UTRA__SI_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.RAN_Information_Application_Container_UTRA_SI");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_UTRA_SI");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_UTRA_SI");
single_value->field_reporting__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_UTRA_SI");
single_value->field_uTRA__SI__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RAN_Information_Application_Container_UTRA_SI");
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.RAN_Information_Application_Container_UTRA_SI");
}

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

boolean RAN__Information__Application__Container__UTRA__SI_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 Application__Container__IE__SON__transfer::copy_value(const Application__Container__IE__SON__transfer& other_value)
{
switch (other_value.union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SON__transfer(*other_value.field_rAN__Information__Request__Application__Container);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SON__transfer(*other_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Application__Container__IE__SON__transfer::operator==(const Application__Container__IE__SON__transfer& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
return *field_rAN__Information__Request__Application__Container == *other_value.field_rAN__Information__Request__Application__Container;
case ALT_rAN__Information__Application__Container:
return *field_rAN__Information__Application__Container == *other_value.field_rAN__Information__Application__Container;
default:
return FALSE;
}
}

RAN__Information__Request__Application__Container__SON__transfer& Application__Container__IE__SON__transfer::rAN__Information__Request__Application__Container()
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) {
clean_up();
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SON__transfer;
union_selection = ALT_rAN__Information__Request__Application__Container;
}
return *field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__SON__transfer& Application__Container__IE__SON__transfer::rAN__Information__Request__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) TTCN_error("Using non-selected field rAN_Information_Request_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
return *field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__SON__transfer& Application__Container__IE__SON__transfer::rAN__Information__Application__Container()
{
if (union_selection != ALT_rAN__Information__Application__Container) {
clean_up();
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SON__transfer;
union_selection = ALT_rAN__Information__Application__Container;
}
return *field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__SON__transfer& Application__Container__IE__SON__transfer::rAN__Information__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Application__Container) TTCN_error("Using non-selected field rAN_Information_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
return *field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__SON__transfer::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.Application_Container_IE_SON_transfer.");
return union_selection == checked_selection;
}

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

boolean Application__Container__IE__SON__transfer::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rAN__Information__Request__Application__Container: return field_rAN__Information__Request__Application__Container->is_value();
case ALT_rAN__Information__Application__Container: return field_rAN__Information__Application__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Application__Container__IE__SON__transfer::clean_up()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
  delete field_rAN__Information__Request__Application__Container;
  break;
case ALT_rAN__Information__Application__Container:
  delete field_rAN__Information__Application__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Application__Container__IE__SON__transfer::log() const
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
field_rAN__Information__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Application__Container__IE__SON__transfer::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, "rAN_Information_Request_Application_Container")) {
    rAN__Information__Request__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Request__Application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rAN_Information_Application_Container")) {
    rAN__Information__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Application__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_SON_transfer.", last_name);
}

void Application__Container__IE__SON__transfer::set_implicit_omit()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->set_implicit_omit(); break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->set_implicit_omit(); break;
default: break;
}
}

void Application__Container__IE__SON__transfer::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
}

void Application__Container__IE__SON__transfer::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rAN__Information__Request__Application__Container:
rAN__Information__Request__Application__Container().decode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
rAN__Information__Application__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
}

void Application__Container__IE__SON__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(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 Application__Container__IE__SON__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 Application__Container__IE__SON__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 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, RAN__Information__Request__Application__Container__SON__transfer_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__SON__transfer_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, RAN__Information__Application__Container__SON__transfer_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__SON__transfer_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, RAN__Information__Request__Application__Container__SON__transfer_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__SON__transfer_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, RAN__Information__Application__Container__SON__transfer_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__SON__transfer_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 Application__Container__IE__SON__transfer::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_rAN__Information__Request__Application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Request__Application__Container__SON__transfer_descr_.raw);
    encoded_length = field_rAN__Information__Request__Application__Container->RAW_encode(RAN__Information__Request__Application__Container__SON__transfer_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Request__Application__Container__SON__transfer_descr_;
    break;
  case ALT_rAN__Information__Application__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RAN__Information__Application__Container__SON__transfer_descr_.raw);
    encoded_length = field_rAN__Information__Application__Container->RAW_encode(RAN__Information__Application__Container__SON__transfer_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RAN__Information__Application__Container__SON__transfer_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Application__Container__IE__SON__transfer_template::copy_value(const Application__Container__IE__SON__transfer& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SON__transfer_template(other_value.rAN__Information__Request__Application__Container());
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SON__transfer_template(other_value.rAN__Information__Application__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
set_selection(SPECIFIC_VALUE);
}

void Application__Container__IE__SON__transfer_template::copy_template(const Application__Container__IE__SON__transfer_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 Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SON__transfer_template(*other_value.single_value.field_rAN__Information__Request__Application__Container);
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SON__transfer_template(*other_value.single_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
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 Application__Container__IE__SON__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 Application__Container__IE__SON__transfer_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Container__IE__SON__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 template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
set_selection(other_value);
}

Application__Container__IE__SON__transfer_template::Application__Container__IE__SON__transfer_template()
{
}

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

Application__Container__IE__SON__transfer_template::Application__Container__IE__SON__transfer_template(const Application__Container__IE__SON__transfer& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Application__Container__IE__SON__transfer_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
delete single_value.field_rAN__Information__Request__Application__Container;
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
delete single_value.field_rAN__Information__Application__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;
}

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

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

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

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

boolean Application__Container__IE__SON__transfer_template::match(const Application__Container__IE__SON__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:
{
Application__Container__IE__SON__transfer::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Application__Container__IE__SON__transfer::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->match(other_value.rAN__Information__Request__Application__Container(), legacy);
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__Container->match(other_value.rAN__Information__Application__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
}
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.Application_Container_IE_SON_transfer.");
}
return FALSE;
}

boolean Application__Container__IE__SON__transfer_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->is_value();
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__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.Application_Container_IE_SON_transfer.");
}
}

Application__Container__IE__SON__transfer Application__Container__IE__SON__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 union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
Application__Container__IE__SON__transfer ret_val;
switch (single_value.union_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
ret_val.rAN__Information__Request__Application__Container() = single_value.field_rAN__Information__Request__Application__Container->valueof();
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
ret_val.rAN__Information__Application__Container() = single_value.field_rAN__Information__Application__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.Application_Container_IE_SON_transfer.");
}
return ret_val;
}

Application__Container__IE__SON__transfer_template& Application__Container__IE__SON__transfer_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.Application_Container_IE_SON_transfer.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
return value_list.list_value[list_index];
}
void Application__Container__IE__SON__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 ("Internal error: Setting an invalid list for a template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Application__Container__IE__SON__transfer_template[list_length];
}

RAN__Information__Request__Application__Container__SON__transfer_template& Application__Container__IE__SON__transfer_template::rAN__Information__Request__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SON__transfer_template(ANY_VALUE);
else single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SON__transfer_template;
single_value.union_selection = Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__SON__transfer_template& Application__Container__IE__SON__transfer_template::rAN__Information__Request__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Request_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
if (single_value.union_selection != Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Request_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
return *single_value.field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__SON__transfer_template& Application__Container__IE__SON__transfer_template::rAN__Information__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SON__transfer_template(ANY_VALUE);
else single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SON__transfer_template;
single_value.union_selection = Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__SON__transfer_template& Application__Container__IE__SON__transfer_template::rAN__Information__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
if (single_value.union_selection != Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
return *single_value.field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__SON__transfer_template::ischosen(Application__Container__IE__SON__transfer::union_selection_type checked_selection) const
{
if (checked_selection == Application__Container__IE__SON__transfer::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Application__Container__IE__SON__transfer::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Application_Container_IE_SON_transfer.");
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.Application_Container_IE_SON_transfer 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 Application__Container__IE__SON__transfer_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__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 Application__Container__IE__SON__transfer_template::log_match(const Application__Container__IE__SON__transfer& 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 Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Request_Application_Container");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Application_Container");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__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 Application__Container__IE__SON__transfer_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 Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__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.Application_Container_IE_SON_transfer.");
}
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.Application_Container_IE_SON_transfer.");
}
}

void Application__Container__IE__SON__transfer_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Application__Container__IE__SON__transfer::UNBOUND_VALUE;
Application__Container__IE__SON__transfer::union_selection_type new_selection = (Application__Container__IE__SON__transfer::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__SON__transfer_template;
single_value.field_rAN__Information__Request__Application__Container->decode_text(text_buf);
break;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__SON__transfer_template;
single_value.field_rAN__Information__Application__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
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 Application__Container__IE__SON__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: Unrecognized selector was received in a template of type @BSSGP_Types.Application_Container_IE_SON_transfer.");
}
}

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

boolean Application__Container__IE__SON__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 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 Application__Container__IE__SON__transfer_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.Application_Container_IE_SON_transfer'");
    }
    if (strcmp("rAN_Information_Request_Application_Container", param_field) == 0) {
      rAN__Information__Request__Application__Container().set_param(param);
      return;
    } else if (strcmp("rAN_Information_Application_Container", param_field) == 0) {
      rAN__Information__Application__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Application_Container_IE_SON_transfer'", 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: {
    Application__Container__IE__SON__transfer_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.Application_Container_IE_SON_transfer");
    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, "rAN_Information_Request_Application_Container")) {
      rAN__Information__Request__Application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rAN_Information_Application_Container")) {
      rAN__Information__Application__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_SON_transfer.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Container__IE__SON__transfer_template* precondition = new Application__Container__IE__SON__transfer_template;
    precondition->set_param(*m_p->get_elem(0));
    Application__Container__IE__SON__transfer_template* implied_template = new Application__Container__IE__SON__transfer_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Application__Container__IE__SON__transfer_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Application_Container_IE_SON_transfer");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Container__IE__SON__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;
switch (single_value.union_selection) {
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_SON_transfer");
return;
case Application__Container__IE__SON__transfer::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_SON_transfer");
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.Application_Container_IE_SON_transfer.");
}
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.Application_Container_IE_SON_transfer");
}

Application__Error__Container__SON__transfer::Application__Error__Container__SON__transfer()
{
}

Application__Error__Container__SON__transfer::Application__Error__Container__SON__transfer(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_sON__transfer__cause,
    const Application__Container__IE__SON__transfer& par_erroneousApplicationContainer)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_sON__transfer__cause(par_sON__transfer__cause),
  field_erroneousApplicationContainer(par_erroneousApplicationContainer)
{
}

Application__Error__Container__SON__transfer::Application__Error__Container__SON__transfer(const Application__Error__Container__SON__transfer& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Application_Error_Container_SON_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.sON__transfer__cause().is_bound()) field_sON__transfer__cause = other_value.sON__transfer__cause();
else field_sON__transfer__cause.clean_up();
if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
else field_erroneousApplicationContainer.clean_up();
}

void Application__Error__Container__SON__transfer::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_sON__transfer__cause.clean_up();
field_erroneousApplicationContainer.clean_up();
}

const TTCN_Typedescriptor_t* Application__Error__Container__SON__transfer::get_descriptor() const { return &Application__Error__Container__SON__transfer_descr_; }
Application__Error__Container__SON__transfer& Application__Error__Container__SON__transfer::operator=(const Application__Error__Container__SON__transfer& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Application_Error_Container_SON_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.sON__transfer__cause().is_bound()) field_sON__transfer__cause = other_value.sON__transfer__cause();
  else field_sON__transfer__cause.clean_up();
  if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
  else field_erroneousApplicationContainer.clean_up();
}
return *this;
}

boolean Application__Error__Container__SON__transfer::operator==(const Application__Error__Container__SON__transfer& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_sON__transfer__cause==other_value.field_sON__transfer__cause
  && field_erroneousApplicationContainer==other_value.field_erroneousApplicationContainer;
}

boolean Application__Error__Container__SON__transfer::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_sON__transfer__cause.is_bound())
  || (field_erroneousApplicationContainer.is_bound());
}
boolean Application__Error__Container__SON__transfer::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_sON__transfer__cause.is_value()
  && field_erroneousApplicationContainer.is_value();
}
void Application__Error__Container__SON__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(", sON_transfer_cause := ");
field_sON__transfer__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
field_erroneousApplicationContainer.log();
TTCN_Logger::log_event_str(" }");
}

void Application__Error__Container__SON__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 (sON__transfer__cause().is_bound()) sON__transfer__cause().set_implicit_omit();
if (erroneousApplicationContainer().is_bound()) erroneousApplicationContainer().set_implicit_omit();
}

void Application__Error__Container__SON__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Application_Error_Container_SON_transfer 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) sON__transfer__cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) erroneousApplicationContainer().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(), "sON_transfer_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__transfer__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "erroneousApplicationContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          erroneousApplicationContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Application_Error_Container_SON_transfer: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Application_Error_Container_SON_transfer");
  }
}

void Application__Error__Container__SON__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_sON__transfer__cause.encode_text(text_buf);
field_erroneousApplicationContainer.encode_text(text_buf);
}

void Application__Error__Container__SON__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_sON__transfer__cause.decode_text(text_buf);
field_erroneousApplicationContainer.decode_text(text_buf);
}

void Application__Error__Container__SON__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 Application__Error__Container__SON__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 Application__Error__Container__SON__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;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_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, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_ext.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, LIN2__2a_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(LIN2__2a_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_sON__transfer__cause.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, Application__Container__IE__SON__transfer_descr_.raw->forceomit);
  decoded_field_length = field_erroneousApplicationContainer.RAW_decode(Application__Container__IE__SON__transfer_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 Application__Error__Container__SON__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 = 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, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, LIN2__2a_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Application__Container__IE__SON__transfer_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(LIN2__2a_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_sON__transfer__cause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_erroneousApplicationContainer.RAW_encode(Application__Container__IE__SON__transfer_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct Application__Error__Container__SON__transfer_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_sON__transfer__cause;
Application__Container__IE__SON__transfer_template field_erroneousApplicationContainer;
};

void Application__Error__Container__SON__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_sON__transfer__cause = ANY_VALUE;
single_value->field_erroneousApplicationContainer = ANY_VALUE;
}
}
}

void Application__Error__Container__SON__transfer_template::copy_value(const Application__Error__Container__SON__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.sON__transfer__cause().is_bound()) {
  single_value->field_sON__transfer__cause = other_value.sON__transfer__cause();
} else {
  single_value->field_sON__transfer__cause.clean_up();
}
if (other_value.erroneousApplicationContainer().is_bound()) {
  single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
  single_value->field_erroneousApplicationContainer.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Application__Error__Container__SON__transfer_template::copy_template(const Application__Error__Container__SON__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.sON__transfer__cause().get_selection()) {
single_value->field_sON__transfer__cause = other_value.sON__transfer__cause();
} else {
single_value->field_sON__transfer__cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.erroneousApplicationContainer().get_selection()) {
single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__SON__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 Application__Error__Container__SON__transfer_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Error__Container__SON__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.Application_Error_Container_SON_transfer.");
break;
}
set_selection(other_value);
}

Application__Error__Container__SON__transfer_template::Application__Error__Container__SON__transfer_template()
{
}

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

Application__Error__Container__SON__transfer_template::Application__Error__Container__SON__transfer_template(const Application__Error__Container__SON__transfer& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Application__Error__Container__SON__transfer_template::match(const Application__Error__Container__SON__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.sON__transfer__cause().is_bound()) return FALSE;
if(!single_value->field_sON__transfer__cause.match(other_value.sON__transfer__cause(), legacy))return FALSE;
if(!other_value.erroneousApplicationContainer().is_bound()) return FALSE;
if(!single_value->field_erroneousApplicationContainer.match(other_value.erroneousApplicationContainer(), 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.Application_Error_Container_SON_transfer.");
}
return FALSE;
}

boolean Application__Error__Container__SON__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_sON__transfer__cause.is_bound()
 || single_value->field_erroneousApplicationContainer.is_bound();
}

boolean Application__Error__Container__SON__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_sON__transfer__cause.is_value()
 && single_value->field_erroneousApplicationContainer.is_value();
}

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

Application__Error__Container__SON__transfer Application__Error__Container__SON__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.Application_Error_Container_SON_transfer.");
Application__Error__Container__SON__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_sON__transfer__cause.is_bound()) {
ret_val.sON__transfer__cause() = single_value->field_sON__transfer__cause.valueof();
}
if (single_value->field_erroneousApplicationContainer.is_bound()) {
ret_val.erroneousApplicationContainer() = single_value->field_erroneousApplicationContainer.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& Application__Error__Container__SON__transfer_template::sON__transfer__cause()
{
set_specific();
return single_value->field_sON__transfer__cause;
}

const OCTETSTRING_template& Application__Error__Container__SON__transfer_template::sON__transfer__cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sON_transfer_cause of a non-specific template of type @BSSGP_Types.Application_Error_Container_SON_transfer.");
return single_value->field_sON__transfer__cause;
}

Application__Container__IE__SON__transfer_template& Application__Error__Container__SON__transfer_template::erroneousApplicationContainer()
{
set_specific();
return single_value->field_erroneousApplicationContainer;
}

const Application__Container__IE__SON__transfer_template& Application__Error__Container__SON__transfer_template::erroneousApplicationContainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field erroneousApplicationContainer of a non-specific template of type @BSSGP_Types.Application_Error_Container_SON_transfer.");
return single_value->field_erroneousApplicationContainer;
}

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

void Application__Error__Container__SON__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(", sON_transfer_cause := ");
single_value->field_sON__transfer__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__SON__transfer_template::log_match(const Application__Error__Container__SON__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_sON__transfer__cause.match(match_value.sON__transfer__cause(), legacy)){
TTCN_Logger::log_logmatch_info(".sON_transfer_cause");
single_value->field_sON__transfer__cause.log_match(match_value.sON__transfer__cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_erroneousApplicationContainer.match(match_value.erroneousApplicationContainer(), legacy)){
TTCN_Logger::log_logmatch_info(".erroneousApplicationContainer");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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(", sON_transfer_cause := ");
single_value->field_sON__transfer__cause.log_match(match_value.sON__transfer__cause(), legacy);
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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 Application__Error__Container__SON__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_sON__transfer__cause.encode_text(text_buf);
single_value->field_erroneousApplicationContainer.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.Application_Error_Container_SON_transfer.");
}
}

void Application__Error__Container__SON__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_sON__transfer__cause.decode_text(text_buf);
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__SON__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.Application_Error_Container_SON_transfer.");
}
}

void Application__Error__Container__SON__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: {
    Application__Error__Container__SON__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 (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Application_Error_Container_SON_transfer 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) sON__transfer__cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) erroneousApplicationContainer().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(), "sON_transfer_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sON__transfer__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "erroneousApplicationContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          erroneousApplicationContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Application_Error_Container_SON_transfer: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Error__Container__SON__transfer_template* precondition = new Application__Error__Container__SON__transfer_template;
    precondition->set_param(*param.get_elem(0));
    Application__Error__Container__SON__transfer_template* implied_template = new Application__Error__Container__SON__transfer_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Application__Error__Container__SON__transfer_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Application_Error_Container_SON_transfer");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Error__Container__SON__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.Application_Error_Container_SON_transfer");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SON_transfer");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SON_transfer");
single_value->field_sON__transfer__cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SON_transfer");
single_value->field_erroneousApplicationContainer.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_SON_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.Application_Error_Container_SON_transfer");
}

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

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

void Application__Container__IE__UTRA__SI::copy_value(const Application__Container__IE__UTRA__SI& other_value)
{
switch (other_value.union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__UTRA__SI(*other_value.field_rAN__Information__Request__Application__Container);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__UTRA__SI(*other_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Application__Container__IE__UTRA__SI::operator==(const Application__Container__IE__UTRA__SI& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
return *field_rAN__Information__Request__Application__Container == *other_value.field_rAN__Information__Request__Application__Container;
case ALT_rAN__Information__Application__Container:
return *field_rAN__Information__Application__Container == *other_value.field_rAN__Information__Application__Container;
default:
return FALSE;
}
}

RAN__Information__Request__Application__Container__UTRA__SI& Application__Container__IE__UTRA__SI::rAN__Information__Request__Application__Container()
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) {
clean_up();
field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__UTRA__SI;
union_selection = ALT_rAN__Information__Request__Application__Container;
}
return *field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__UTRA__SI& Application__Container__IE__UTRA__SI::rAN__Information__Request__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Request__Application__Container) TTCN_error("Using non-selected field rAN_Information_Request_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
return *field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__UTRA__SI& Application__Container__IE__UTRA__SI::rAN__Information__Application__Container()
{
if (union_selection != ALT_rAN__Information__Application__Container) {
clean_up();
field_rAN__Information__Application__Container = new RAN__Information__Application__Container__UTRA__SI;
union_selection = ALT_rAN__Information__Application__Container;
}
return *field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__UTRA__SI& Application__Container__IE__UTRA__SI::rAN__Information__Application__Container() const
{
if (union_selection != ALT_rAN__Information__Application__Container) TTCN_error("Using non-selected field rAN_Information_Application_Container in a value of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
return *field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__UTRA__SI::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.Application_Container_IE_UTRA_SI.");
return union_selection == checked_selection;
}

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

boolean Application__Container__IE__UTRA__SI::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rAN__Information__Request__Application__Container: return field_rAN__Information__Request__Application__Container->is_value();
case ALT_rAN__Information__Application__Container: return field_rAN__Information__Application__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Application__Container__IE__UTRA__SI::clean_up()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
  delete field_rAN__Information__Request__Application__Container;
  break;
case ALT_rAN__Information__Application__Container:
  delete field_rAN__Information__Application__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Application__Container__IE__UTRA__SI::log() const
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
field_rAN__Information__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Application__Container__IE__UTRA__SI::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, "rAN_Information_Request_Application_Container")) {
    rAN__Information__Request__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Request__Application__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rAN_Information_Application_Container")) {
    rAN__Information__Application__Container().set_param(*mp_last);
    if (!rAN__Information__Application__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_UTRA_SI.", last_name);
}

void Application__Container__IE__UTRA__SI::set_implicit_omit()
{
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->set_implicit_omit(); break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->set_implicit_omit(); break;
default: break;
}
}

void Application__Container__IE__UTRA__SI::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rAN__Information__Request__Application__Container:
field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
field_rAN__Information__Application__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
}
}

void Application__Container__IE__UTRA__SI::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rAN__Information__Request__Application__Container:
rAN__Information__Request__Application__Container().decode_text(text_buf);
break;
case ALT_rAN__Information__Application__Container:
rAN__Information__Application__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
}
}

void Application__Container__IE__UTRA__SI::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 Application__Container__IE__UTRA__SI::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 Application__Container__IE__UTRA__SI::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, RAN__Information__Request__Application__Container__UTRA__SI_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__UTRA__SI_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, RAN__Information__Application__Container__UTRA__SI_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__UTRA__SI_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, RAN__Information__Request__Application__Container__UTRA__SI_descr_.raw->forceomit);
      decoded_length = rAN__Information__Request__Application__Container().RAW_decode(RAN__Information__Request__Application__Container__UTRA__SI_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, RAN__Information__Application__Container__UTRA__SI_descr_.raw->forceomit);
      decoded_length = rAN__Information__Application__Container().RAW_decode(RAN__Information__Application__Container__UTRA__SI_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 Application__Container__IE__UTRA__SI::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_rAN__Information__Request__Application__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RAN__Information__Request__Application__Container__UTRA__SI_descr_.raw);
    encoded_length = field_rAN__Information__Request__Application__Container->RAW_encode(RAN__Information__Request__Application__Container__UTRA__SI_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RAN__Information__Request__Application__Container__UTRA__SI_descr_;
    break;
  case ALT_rAN__Information__Application__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RAN__Information__Application__Container__UTRA__SI_descr_.raw);
    encoded_length = field_rAN__Information__Application__Container->RAW_encode(RAN__Information__Application__Container__UTRA__SI_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RAN__Information__Application__Container__UTRA__SI_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Application__Container__IE__UTRA__SI_template::copy_value(const Application__Container__IE__UTRA__SI& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__UTRA__SI_template(other_value.rAN__Information__Request__Application__Container());
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__UTRA__SI_template(other_value.rAN__Information__Application__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
}
set_selection(SPECIFIC_VALUE);
}

void Application__Container__IE__UTRA__SI_template::copy_template(const Application__Container__IE__UTRA__SI_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 Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__UTRA__SI_template(*other_value.single_value.field_rAN__Information__Request__Application__Container);
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__UTRA__SI_template(*other_value.single_value.field_rAN__Information__Application__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
}
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 Application__Container__IE__UTRA__SI_template[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 Application__Container__IE__UTRA__SI_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Container__IE__UTRA__SI_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.Application_Container_IE_UTRA_SI.");
}
set_selection(other_value);
}

Application__Container__IE__UTRA__SI_template::Application__Container__IE__UTRA__SI_template()
{
}

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

Application__Container__IE__UTRA__SI_template::Application__Container__IE__UTRA__SI_template(const Application__Container__IE__UTRA__SI& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Application__Container__IE__UTRA__SI_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
delete single_value.field_rAN__Information__Request__Application__Container;
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
delete single_value.field_rAN__Information__Application__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;
}

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

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

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

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

boolean Application__Container__IE__UTRA__SI_template::match(const Application__Container__IE__UTRA__SI& 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:
{
Application__Container__IE__UTRA__SI::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Application__Container__IE__UTRA__SI::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->match(other_value.rAN__Information__Request__Application__Container(), legacy);
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__Container->match(other_value.rAN__Information__Application__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
}
}
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.Application_Container_IE_UTRA_SI.");
}
return FALSE;
}

boolean Application__Container__IE__UTRA__SI_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
return single_value.field_rAN__Information__Request__Application__Container->is_value();
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
return single_value.field_rAN__Information__Application__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.Application_Container_IE_UTRA_SI.");
}
}

Application__Container__IE__UTRA__SI Application__Container__IE__UTRA__SI_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.Application_Container_IE_UTRA_SI.");
Application__Container__IE__UTRA__SI ret_val;
switch (single_value.union_selection) {
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
ret_val.rAN__Information__Request__Application__Container() = single_value.field_rAN__Information__Request__Application__Container->valueof();
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
ret_val.rAN__Information__Application__Container() = single_value.field_rAN__Information__Application__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.Application_Container_IE_UTRA_SI.");
}
return ret_val;
}

Application__Container__IE__UTRA__SI_template& Application__Container__IE__UTRA__SI_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.Application_Container_IE_UTRA_SI.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
return value_list.list_value[list_index];
}
void Application__Container__IE__UTRA__SI_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.Application_Container_IE_UTRA_SI.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Application__Container__IE__UTRA__SI_template[list_length];
}

RAN__Information__Request__Application__Container__UTRA__SI_template& Application__Container__IE__UTRA__SI_template::rAN__Information__Request__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__UTRA__SI_template(ANY_VALUE);
else single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__UTRA__SI_template;
single_value.union_selection = Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Request__Application__Container;
}

const RAN__Information__Request__Application__Container__UTRA__SI_template& Application__Container__IE__UTRA__SI_template::rAN__Information__Request__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Request_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
if (single_value.union_selection != Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Request_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
return *single_value.field_rAN__Information__Request__Application__Container;
}

RAN__Information__Application__Container__UTRA__SI_template& Application__Container__IE__UTRA__SI_template::rAN__Information__Application__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__UTRA__SI_template(ANY_VALUE);
else single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__UTRA__SI_template;
single_value.union_selection = Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rAN__Information__Application__Container;
}

const RAN__Information__Application__Container__UTRA__SI_template& Application__Container__IE__UTRA__SI_template::rAN__Information__Application__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAN_Information_Application_Container in a non-specific template of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
if (single_value.union_selection != Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container) TTCN_error("Accessing non-selected field rAN_Information_Application_Container in a template of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
return *single_value.field_rAN__Information__Application__Container;
}

boolean Application__Container__IE__UTRA__SI_template::ischosen(Application__Container__IE__UTRA__SI::union_selection_type checked_selection) const
{
if (checked_selection == Application__Container__IE__UTRA__SI::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Application__Container__IE__UTRA__SI::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
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.Application_Container_IE_UTRA_SI 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 Application__Container__IE__UTRA__SI_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__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 Application__Container__IE__UTRA__SI_template::log_match(const Application__Container__IE__UTRA__SI& 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 Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Request_Application_Container");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Request_Application_Container := ");
single_value.field_rAN__Information__Request__Application__Container->log_match(match_value.rAN__Information__Request__Application__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rAN_Information_Application_Container");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rAN_Information_Application_Container := ");
single_value.field_rAN__Information__Application__Container->log_match(match_value.rAN__Information__Application__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 Application__Container__IE__UTRA__SI_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 Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->encode_text(text_buf);
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__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.Application_Container_IE_UTRA_SI.");
}
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.Application_Container_IE_UTRA_SI.");
}
}

void Application__Container__IE__UTRA__SI_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Application__Container__IE__UTRA__SI::UNBOUND_VALUE;
Application__Container__IE__UTRA__SI::union_selection_type new_selection = (Application__Container__IE__UTRA__SI::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container = new RAN__Information__Request__Application__Container__UTRA__SI_template;
single_value.field_rAN__Information__Request__Application__Container->decode_text(text_buf);
break;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container = new RAN__Information__Application__Container__UTRA__SI_template;
single_value.field_rAN__Information__Application__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Application_Container_IE_UTRA_SI.");
}
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 Application__Container__IE__UTRA__SI_template[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.Application_Container_IE_UTRA_SI.");
}
}

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

boolean Application__Container__IE__UTRA__SI_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 Application__Container__IE__UTRA__SI_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.Application_Container_IE_UTRA_SI'");
    }
    if (strcmp("rAN_Information_Request_Application_Container", param_field) == 0) {
      rAN__Information__Request__Application__Container().set_param(param);
      return;
    } else if (strcmp("rAN_Information_Application_Container", param_field) == 0) {
      rAN__Information__Application__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Application_Container_IE_UTRA_SI'", 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: {
    Application__Container__IE__UTRA__SI_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.Application_Container_IE_UTRA_SI");
    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, "rAN_Information_Request_Application_Container")) {
      rAN__Information__Request__Application__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rAN_Information_Application_Container")) {
      rAN__Information__Application__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Application_Container_IE_UTRA_SI.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Container__IE__UTRA__SI_template* precondition = new Application__Container__IE__UTRA__SI_template;
    precondition->set_param(*m_p->get_elem(0));
    Application__Container__IE__UTRA__SI_template* implied_template = new Application__Container__IE__UTRA__SI_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Application__Container__IE__UTRA__SI_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Application_Container_IE_UTRA_SI");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Container__IE__UTRA__SI_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 Application__Container__IE__UTRA__SI::ALT_rAN__Information__Request__Application__Container:
single_value.field_rAN__Information__Request__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_UTRA_SI");
return;
case Application__Container__IE__UTRA__SI::ALT_rAN__Information__Application__Container:
single_value.field_rAN__Information__Application__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Container_IE_UTRA_SI");
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.Application_Container_IE_UTRA_SI.");
}
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.Application_Container_IE_UTRA_SI");
}

Application__Error__Container__UTRA__SI::Application__Error__Container__UTRA__SI()
{
}

Application__Error__Container__UTRA__SI::Application__Error__Container__UTRA__SI(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_uTRA__SI__cause,
    const Application__Container__IE__UTRA__SI& par_erroneousApplicationContainer)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_uTRA__SI__cause(par_uTRA__SI__cause),
  field_erroneousApplicationContainer(par_erroneousApplicationContainer)
{
}

Application__Error__Container__UTRA__SI::Application__Error__Container__UTRA__SI(const Application__Error__Container__UTRA__SI& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Application_Error_Container_UTRA_SI.");
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.uTRA__SI__cause().is_bound()) field_uTRA__SI__cause = other_value.uTRA__SI__cause();
else field_uTRA__SI__cause.clean_up();
if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
else field_erroneousApplicationContainer.clean_up();
}

void Application__Error__Container__UTRA__SI::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_uTRA__SI__cause.clean_up();
field_erroneousApplicationContainer.clean_up();
}

const TTCN_Typedescriptor_t* Application__Error__Container__UTRA__SI::get_descriptor() const { return &Application__Error__Container__UTRA__SI_descr_; }
Application__Error__Container__UTRA__SI& Application__Error__Container__UTRA__SI::operator=(const Application__Error__Container__UTRA__SI& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Application_Error_Container_UTRA_SI.");
  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.uTRA__SI__cause().is_bound()) field_uTRA__SI__cause = other_value.uTRA__SI__cause();
  else field_uTRA__SI__cause.clean_up();
  if (other_value.erroneousApplicationContainer().is_bound()) field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
  else field_erroneousApplicationContainer.clean_up();
}
return *this;
}

boolean Application__Error__Container__UTRA__SI::operator==(const Application__Error__Container__UTRA__SI& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_uTRA__SI__cause==other_value.field_uTRA__SI__cause
  && field_erroneousApplicationContainer==other_value.field_erroneousApplicationContainer;
}

boolean Application__Error__Container__UTRA__SI::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_uTRA__SI__cause.is_bound())
  || (field_erroneousApplicationContainer.is_bound());
}
boolean Application__Error__Container__UTRA__SI::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_uTRA__SI__cause.is_value()
  && field_erroneousApplicationContainer.is_value();
}
void Application__Error__Container__UTRA__SI::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(", uTRA_SI_cause := ");
field_uTRA__SI__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
field_erroneousApplicationContainer.log();
TTCN_Logger::log_event_str(" }");
}

void Application__Error__Container__UTRA__SI::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 (uTRA__SI__cause().is_bound()) uTRA__SI__cause().set_implicit_omit();
if (erroneousApplicationContainer().is_bound()) erroneousApplicationContainer().set_implicit_omit();
}

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

void Application__Error__Container__UTRA__SI::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_uTRA__SI__cause.encode_text(text_buf);
field_erroneousApplicationContainer.encode_text(text_buf);
}

void Application__Error__Container__UTRA__SI::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_uTRA__SI__cause.decode_text(text_buf);
field_erroneousApplicationContainer.decode_text(text_buf);
}

void Application__Error__Container__UTRA__SI::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 Application__Error__Container__UTRA__SI::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 Application__Error__Container__UTRA__SI::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_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, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_ext.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, LIN2__2a_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(LIN2__2a_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_uTRA__SI__cause.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, Application__Container__IE__UTRA__SI_descr_.raw->forceomit);
  decoded_field_length = field_erroneousApplicationContainer.RAW_decode(Application__Container__IE__UTRA__SI_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 Application__Error__Container__UTRA__SI::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, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, LIN2__2a_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Application__Container__IE__UTRA__SI_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(LIN2__2a_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_uTRA__SI__cause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_erroneousApplicationContainer.RAW_encode(Application__Container__IE__UTRA__SI_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct Application__Error__Container__UTRA__SI_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_uTRA__SI__cause;
Application__Container__IE__UTRA__SI_template field_erroneousApplicationContainer;
};

void Application__Error__Container__UTRA__SI_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_uTRA__SI__cause = ANY_VALUE;
single_value->field_erroneousApplicationContainer = ANY_VALUE;
}
}
}

void Application__Error__Container__UTRA__SI_template::copy_value(const Application__Error__Container__UTRA__SI& 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.uTRA__SI__cause().is_bound()) {
  single_value->field_uTRA__SI__cause = other_value.uTRA__SI__cause();
} else {
  single_value->field_uTRA__SI__cause.clean_up();
}
if (other_value.erroneousApplicationContainer().is_bound()) {
  single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
  single_value->field_erroneousApplicationContainer.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Application__Error__Container__UTRA__SI_template::copy_template(const Application__Error__Container__UTRA__SI_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.uTRA__SI__cause().get_selection()) {
single_value->field_uTRA__SI__cause = other_value.uTRA__SI__cause();
} else {
single_value->field_uTRA__SI__cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.erroneousApplicationContainer().get_selection()) {
single_value->field_erroneousApplicationContainer = other_value.erroneousApplicationContainer();
} else {
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__UTRA__SI_template[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 Application__Error__Container__UTRA__SI_template(*other_value.implication_.precondition);
implication_.implied_template = new Application__Error__Container__UTRA__SI_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.Application_Error_Container_UTRA_SI.");
break;
}
set_selection(other_value);
}

Application__Error__Container__UTRA__SI_template::Application__Error__Container__UTRA__SI_template()
{
}

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

Application__Error__Container__UTRA__SI_template::Application__Error__Container__UTRA__SI_template(const Application__Error__Container__UTRA__SI& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Application__Error__Container__UTRA__SI_template::match(const Application__Error__Container__UTRA__SI& 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.uTRA__SI__cause().is_bound()) return FALSE;
if(!single_value->field_uTRA__SI__cause.match(other_value.uTRA__SI__cause(), legacy))return FALSE;
if(!other_value.erroneousApplicationContainer().is_bound()) return FALSE;
if(!single_value->field_erroneousApplicationContainer.match(other_value.erroneousApplicationContainer(), 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.Application_Error_Container_UTRA_SI.");
}
return FALSE;
}

boolean Application__Error__Container__UTRA__SI_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_uTRA__SI__cause.is_bound()
 || single_value->field_erroneousApplicationContainer.is_bound();
}

boolean Application__Error__Container__UTRA__SI_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_uTRA__SI__cause.is_value()
 && single_value->field_erroneousApplicationContainer.is_value();
}

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

Application__Error__Container__UTRA__SI Application__Error__Container__UTRA__SI_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.Application_Error_Container_UTRA_SI.");
Application__Error__Container__UTRA__SI 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_uTRA__SI__cause.is_bound()) {
ret_val.uTRA__SI__cause() = single_value->field_uTRA__SI__cause.valueof();
}
if (single_value->field_erroneousApplicationContainer.is_bound()) {
ret_val.erroneousApplicationContainer() = single_value->field_erroneousApplicationContainer.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

const LIN2__2a_template& Application__Error__Container__UTRA__SI_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Application_Error_Container_UTRA_SI.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Application__Error__Container__UTRA__SI_template::uTRA__SI__cause()
{
set_specific();
return single_value->field_uTRA__SI__cause;
}

const OCTETSTRING_template& Application__Error__Container__UTRA__SI_template::uTRA__SI__cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRA_SI_cause of a non-specific template of type @BSSGP_Types.Application_Error_Container_UTRA_SI.");
return single_value->field_uTRA__SI__cause;
}

Application__Container__IE__UTRA__SI_template& Application__Error__Container__UTRA__SI_template::erroneousApplicationContainer()
{
set_specific();
return single_value->field_erroneousApplicationContainer;
}

const Application__Container__IE__UTRA__SI_template& Application__Error__Container__UTRA__SI_template::erroneousApplicationContainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field erroneousApplicationContainer of a non-specific template of type @BSSGP_Types.Application_Error_Container_UTRA_SI.");
return single_value->field_erroneousApplicationContainer;
}

int Application__Error__Container__UTRA__SI_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Application_Error_Container_UTRA_SI 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.Application_Error_Container_UTRA_SI 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.Application_Error_Container_UTRA_SI 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.Application_Error_Container_UTRA_SI containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Application_Error_Container_UTRA_SI containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Application_Error_Container_UTRA_SI containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Application_Error_Container_UTRA_SI containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Application_Error_Container_UTRA_SI containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Application_Error_Container_UTRA_SI containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Application_Error_Container_UTRA_SI.");
  }
  return 0;
}

void Application__Error__Container__UTRA__SI_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(", uTRA_SI_cause := ");
single_value->field_uTRA__SI__cause.log();
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__UTRA__SI_template::log_match(const Application__Error__Container__UTRA__SI& 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_uTRA__SI__cause.match(match_value.uTRA__SI__cause(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRA_SI_cause");
single_value->field_uTRA__SI__cause.log_match(match_value.uTRA__SI__cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_erroneousApplicationContainer.match(match_value.erroneousApplicationContainer(), legacy)){
TTCN_Logger::log_logmatch_info(".erroneousApplicationContainer");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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(", uTRA_SI_cause := ");
single_value->field_uTRA__SI__cause.log_match(match_value.uTRA__SI__cause(), legacy);
TTCN_Logger::log_event_str(", erroneousApplicationContainer := ");
single_value->field_erroneousApplicationContainer.log_match(match_value.erroneousApplicationContainer(), 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 Application__Error__Container__UTRA__SI_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_uTRA__SI__cause.encode_text(text_buf);
single_value->field_erroneousApplicationContainer.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.Application_Error_Container_UTRA_SI.");
}
}

void Application__Error__Container__UTRA__SI_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_uTRA__SI__cause.decode_text(text_buf);
single_value->field_erroneousApplicationContainer.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 Application__Error__Container__UTRA__SI_template[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.Application_Error_Container_UTRA_SI.");
}
}

void Application__Error__Container__UTRA__SI_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: {
    Application__Error__Container__UTRA__SI_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.Application_Error_Container_UTRA_SI 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) uTRA__SI__cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) erroneousApplicationContainer().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(), "uTRA_SI_cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRA__SI__cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "erroneousApplicationContainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          erroneousApplicationContainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Application_Error_Container_UTRA_SI: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Application__Error__Container__UTRA__SI_template* precondition = new Application__Error__Container__UTRA__SI_template;
    precondition->set_param(*param.get_elem(0));
    Application__Error__Container__UTRA__SI_template* implied_template = new Application__Error__Container__UTRA__SI_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Application__Error__Container__UTRA__SI_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Application_Error_Container_UTRA_SI");
  }
  is_ifpresent = param.get_ifpresent();
}

void Application__Error__Container__UTRA__SI_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.Application_Error_Container_UTRA_SI");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_UTRA_SI");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_UTRA_SI");
single_value->field_uTRA__SI__cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_UTRA_SI");
single_value->field_erroneousApplicationContainer.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Application_Error_Container_UTRA_SI");
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.Application_Error_Container_UTRA_SI");
}

boolean Application__Error__Container__UTRA__SI_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Application__Error__Container__UTRA__SI_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 PFC PFCs::UNBOUND_ELEM;
PFCs::PFCs()
{
val_ptr = NULL;
}

PFCs::PFCs(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

PFCs::PFCs(const PFCs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PFCs.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

PFCs::~PFCs()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void PFCs::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.");
}
}

PFCs& PFCs::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;
}

PFCs& PFCs::operator=(const PFCs& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BSSGP_Types.PFCs.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean PFCs::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.PFCs.");
return val_ptr->n_elements == 0 ;
}

boolean PFCs::operator==(const PFCs& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.PFCs.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Types.PFCs.");
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;
}

PFC& PFCs::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.PFCs 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 = (PFC**)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 PFC(*(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 PFC;
}
return *val_ptr->value_elements[index_value];
}

PFC& PFCs::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.PFCs.");
return (*this)[(int)index_value];
}

const PFC& PFCs::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.PFCs.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.PFCs 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.PFCs: 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 PFC& PFCs::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.PFCs.");
return (*this)[(int)index_value];
}

PFCs PFCs::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

PFCs PFCs::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

PFCs PFCs::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

PFCs PFCs::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Types.PFCs.");
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;
PFCs 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 PFC(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

PFCs PFCs::operator+(const PFCs& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Types.PFCs concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
PFCs 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 PFC(*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 PFC(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

PFCs PFCs::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.PFCs.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.PFCs","element");
PFCs 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 PFC(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

PFCs PFCs::replace(int index, int len, const PFCs& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Types.PFCs.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Types.PFCs.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Types.PFCs","element");
PFCs 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 PFC(*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 PFC(*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 PFC(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

PFCs PFCs::replace(int index, int len, const PFCs_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 PFCs::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Types.PFCs.");
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 = (PFC**)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 PFC(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (PFC**)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.PFCs: %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 = (PFC**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean PFCs::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 PFCs::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Types.PFCs.");
return val_ptr->n_elements;
}

int PFCs::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Types.PFCs.");
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 PFCs::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 PFCs::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 PFCs::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.PFCs");
    }
    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.PFCs");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void PFCs::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Types.PFCs.");
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 PFCs::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.PFCs.");
val_ptr->value_elements = (PFC**)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 PFC;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void PFCs::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::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::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 PFCs::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 PFCs_template::copy_value(const PFCs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.PFCs with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (PFC_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 PFC_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new PFC_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void PFCs_template::copy_template(const PFCs_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 = (PFC_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 PFC_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new PFC_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 PFCs_template[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_template(*other_value.implication_.precondition);
implication_.implied_template = new PFCs_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.");
break;
}
set_selection(other_value);
}

boolean PFCs_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 PFCs_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const PFCs*)value_ptr)[value_index], legacy);
else return ((const PFCs_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

PFCs_template::PFCs_template()
{
}

PFCs_template::PFCs_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

PFCs_template::PFCs_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

PFCs_template::PFCs_template(const PFCs& other_value)
{
copy_value(other_value);
}

PFCs_template::PFCs_template(const OPTIONAL<PFCs>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFCs&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PFCs from an unbound optional field.");
}
}

PFCs_template::PFCs_template(PFCs_template* p_precondition, PFCs_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PFCs_template::PFCs_template(Dynamic_Match_Interface<PFCs>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PFCs>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PFCs_template::PFCs_template(const PFCs_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

PFCs_template::~PFCs_template()
{
clean_up();
}

void PFCs_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;
}

PFCs_template& PFCs_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PFCs_template& PFCs_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

PFCs_template& PFCs_template::operator=(const PFCs& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PFCs_template& PFCs_template::operator=(const OPTIONAL<PFCs>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFCs&)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.");
}
return *this;
}

PFCs_template& PFCs_template::operator=(const PFCs_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

PFC_template& PFCs_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.PFCs 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.PFCs.");
    break;
}
return *single_value.value_elements[index_value];
}

PFC_template& PFCs_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.PFCs.");
return (*this)[(int)index_value];
}

const PFC_template& PFCs_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.PFCs 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.PFCs.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.PFCs: 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 PFC_template& PFCs_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.PFCs.");
return (*this)[(int)index_value];
}

void PFCs_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.PFCs.");
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 = (PFC_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 PFC_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 PFC_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 = (PFC_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int PFCs_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 PFCs_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.PFCs 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.PFCs 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.PFCs 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.PFCs 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.PFCs 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.PFCs containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PFCs.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Types.PFCs");
}

boolean PFCs_template::match(const PFCs& 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.PFCs.");
}
return FALSE;
}

boolean PFCs_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;
}

PFCs PFCs_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.");
PFCs 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;
}

PFCs PFCs_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);
}

PFCs PFCs_template::replace(int index, int len, const PFCs_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());
}

PFCs PFCs_template::replace(int index, int len, const PFCs& 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 PFCs_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 PFCs_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BSSGP_Types.PFCs.");
}
set_selection(template_type);
}

PFCs_template& PFCs_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.PFCs.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BSSGP_Types.PFCs.");
return value_list.list_value[list_index];
}

void PFCs_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 PFCs_template::log_match(const PFCs& 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 PFCs_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.PFCs.");
}
}

void PFCs_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.PFCs.");
single_value.value_elements = (PFC_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 PFC_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 PFCs_template[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.PFCs.");
}
}

boolean PFCs_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PFCs_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 PFCs_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: {
    PFCs_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: {
    PFCs_template* precondition = new PFCs_template;
    precondition->set_param(*param.get_elem(0));
    PFCs_template* implied_template = new PFCs_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PFCs_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BSSGP_Types.PFCs");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void PFCs_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.PFCs");
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");
}

boolean PFCs_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);
}
}
PFC::PFC()
{
}

PFC::PFC(const BITSTRING& par_pFI__Value,
    const BITSTRING& par_spare,
    const OCTETSTRING& par_bmax__PFC,
    const OCTETSTRING& par_r__PFC,
    const OCTETSTRING& par_b__PFC)
  :   field_pFI__Value(par_pFI__Value),
  field_spare(par_spare),
  field_bmax__PFC(par_bmax__PFC),
  field_r__PFC(par_r__PFC),
  field_b__PFC(par_b__PFC)
{
}

PFC::PFC(const PFC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PFC.");
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();
if (other_value.bmax__PFC().is_bound()) field_bmax__PFC = other_value.bmax__PFC();
else field_bmax__PFC.clean_up();
if (other_value.r__PFC().is_bound()) field_r__PFC = other_value.r__PFC();
else field_r__PFC.clean_up();
if (other_value.b__PFC().is_bound()) field_b__PFC = other_value.b__PFC();
else field_b__PFC.clean_up();
}

void PFC::clean_up()
{
field_pFI__Value.clean_up();
field_spare.clean_up();
field_bmax__PFC.clean_up();
field_r__PFC.clean_up();
field_b__PFC.clean_up();
}

const TTCN_Typedescriptor_t* PFC::get_descriptor() const { return &PFC_descr_; }
PFC& PFC::operator=(const PFC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PFC.");
  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();
  if (other_value.bmax__PFC().is_bound()) field_bmax__PFC = other_value.bmax__PFC();
  else field_bmax__PFC.clean_up();
  if (other_value.r__PFC().is_bound()) field_r__PFC = other_value.r__PFC();
  else field_r__PFC.clean_up();
  if (other_value.b__PFC().is_bound()) field_b__PFC = other_value.b__PFC();
  else field_b__PFC.clean_up();
}
return *this;
}

boolean PFC::operator==(const PFC& other_value) const
{
return field_pFI__Value==other_value.field_pFI__Value
  && field_spare==other_value.field_spare
  && field_bmax__PFC==other_value.field_bmax__PFC
  && field_r__PFC==other_value.field_r__PFC
  && field_b__PFC==other_value.field_b__PFC;
}

boolean PFC::is_bound() const
{
return (field_pFI__Value.is_bound())
  || (field_spare.is_bound())
  || (field_bmax__PFC.is_bound())
  || (field_r__PFC.is_bound())
  || (field_b__PFC.is_bound());
}
boolean PFC::is_value() const
{
return field_pFI__Value.is_value()
  && field_spare.is_value()
  && field_bmax__PFC.is_value()
  && field_r__PFC.is_value()
  && field_b__PFC.is_value();
}
void PFC::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(", bmax_PFC := ");
field_bmax__PFC.log();
TTCN_Logger::log_event_str(", r_PFC := ");
field_r__PFC.log();
TTCN_Logger::log_event_str(", b_PFC := ");
field_b__PFC.log();
TTCN_Logger::log_event_str(" }");
}

void PFC::set_implicit_omit()
{
if (pFI__Value().is_bound()) pFI__Value().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (bmax__PFC().is_bound()) bmax__PFC().set_implicit_omit();
if (r__PFC().is_bound()) r__PFC().set_implicit_omit();
if (b__PFC().is_bound()) b__PFC().set_implicit_omit();
}

void PFC::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.PFC 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__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));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bmax__PFC().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) r__PFC().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) b__PFC().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_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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bmax_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bmax__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "r_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          r__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "b_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          b__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PFC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PFC");
  }
}

void PFC::encode_text(Text_Buf& text_buf) const
{
field_pFI__Value.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_bmax__PFC.encode_text(text_buf);
field_r__PFC.encode_text(text_buf);
field_b__PFC.encode_text(text_buf);
}

void PFC::decode_text(Text_Buf& text_buf)
{
field_pFI__Value.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_bmax__PFC.decode_text(text_buf);
field_r__PFC.decode_text(text_buf);
field_b__PFC.decode_text(text_buf);
}

void PFC::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 PFC::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 PFC::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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_bmax__PFC.RAW_decode(General__Types::OCT2_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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_r__PFC.RAW_decode(General__Types::OCT2_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_b__PFC.RAW_decode(General__Types::OCT1_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 PFC::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::BIT7_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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::OCT1_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]);
  encoded_length += field_bmax__PFC.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_r__PFC.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_b__PFC.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct PFC_template::single_value_struct {
BITSTRING_template field_pFI__Value;
BITSTRING_template field_spare;
OCTETSTRING_template field_bmax__PFC;
OCTETSTRING_template field_r__PFC;
OCTETSTRING_template field_b__PFC;
};

void PFC_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;
single_value->field_bmax__PFC = ANY_VALUE;
single_value->field_r__PFC = ANY_VALUE;
single_value->field_b__PFC = ANY_VALUE;
}
}
}

void PFC_template::copy_value(const PFC& 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();
}
if (other_value.bmax__PFC().is_bound()) {
  single_value->field_bmax__PFC = other_value.bmax__PFC();
} else {
  single_value->field_bmax__PFC.clean_up();
}
if (other_value.r__PFC().is_bound()) {
  single_value->field_r__PFC = other_value.r__PFC();
} else {
  single_value->field_r__PFC.clean_up();
}
if (other_value.b__PFC().is_bound()) {
  single_value->field_b__PFC = other_value.b__PFC();
} else {
  single_value->field_b__PFC.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PFC_template::copy_template(const PFC_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();
}
if (UNINITIALIZED_TEMPLATE != other_value.bmax__PFC().get_selection()) {
single_value->field_bmax__PFC = other_value.bmax__PFC();
} else {
single_value->field_bmax__PFC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.r__PFC().get_selection()) {
single_value->field_r__PFC = other_value.r__PFC();
} else {
single_value->field_r__PFC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.b__PFC().get_selection()) {
single_value->field_b__PFC = other_value.b__PFC();
} else {
single_value->field_b__PFC.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 PFC_template[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 PFC_template(*other_value.implication_.precondition);
implication_.implied_template = new PFC_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.PFC.");
break;
}
set_selection(other_value);
}

PFC_template::PFC_template()
{
}

PFC_template::PFC_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PFC_template::PFC_template(const PFC& other_value)
{
copy_value(other_value);
}

PFC_template::PFC_template(const OPTIONAL<PFC>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFC&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PFC from an unbound optional field.");
}
}

PFC_template::PFC_template(PFC_template* p_precondition, PFC_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PFC_template::PFC_template(Dynamic_Match_Interface<PFC>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PFC>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PFC_template::PFC_template(const PFC_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PFC_template::~PFC_template()
{
clean_up();
}

PFC_template& PFC_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PFC_template& PFC_template::operator=(const PFC& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PFC_template& PFC_template::operator=(const OPTIONAL<PFC>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFC&)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.PFC.");
}
return *this;
}

PFC_template& PFC_template::operator=(const PFC_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PFC_template::match(const PFC& 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;
if(!other_value.bmax__PFC().is_bound()) return FALSE;
if(!single_value->field_bmax__PFC.match(other_value.bmax__PFC(), legacy))return FALSE;
if(!other_value.r__PFC().is_bound()) return FALSE;
if(!single_value->field_r__PFC.match(other_value.r__PFC(), legacy))return FALSE;
if(!other_value.b__PFC().is_bound()) return FALSE;
if(!single_value->field_b__PFC.match(other_value.b__PFC(), 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.PFC.");
}
return FALSE;
}

boolean PFC_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()
 || single_value->field_bmax__PFC.is_bound()
 || single_value->field_r__PFC.is_bound()
 || single_value->field_b__PFC.is_bound();
}

boolean PFC_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()
 && single_value->field_bmax__PFC.is_value()
 && single_value->field_r__PFC.is_value()
 && single_value->field_b__PFC.is_value();
}

void PFC_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;
}

PFC PFC_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.PFC.");
PFC 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();
}
if (single_value->field_bmax__PFC.is_bound()) {
ret_val.bmax__PFC() = single_value->field_bmax__PFC.valueof();
}
if (single_value->field_r__PFC.is_bound()) {
ret_val.r__PFC() = single_value->field_r__PFC.valueof();
}
if (single_value->field_b__PFC.is_bound()) {
ret_val.b__PFC() = single_value->field_b__PFC.valueof();
}
return ret_val;
}

void PFC_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.PFC.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PFC_template[list_length];
}

PFC_template& PFC_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.PFC.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PFC.");
return value_list.list_value[list_index];
}

BITSTRING_template& PFC_template::pFI__Value()
{
set_specific();
return single_value->field_pFI__Value;
}

const BITSTRING_template& PFC_template::pFI__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI_Value of a non-specific template of type @BSSGP_Types.PFC.");
return single_value->field_pFI__Value;
}

BITSTRING_template& PFC_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PFC_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.PFC.");
return single_value->field_spare;
}

OCTETSTRING_template& PFC_template::bmax__PFC()
{
set_specific();
return single_value->field_bmax__PFC;
}

const OCTETSTRING_template& PFC_template::bmax__PFC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bmax_PFC of a non-specific template of type @BSSGP_Types.PFC.");
return single_value->field_bmax__PFC;
}

OCTETSTRING_template& PFC_template::r__PFC()
{
set_specific();
return single_value->field_r__PFC;
}

const OCTETSTRING_template& PFC_template::r__PFC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field r_PFC of a non-specific template of type @BSSGP_Types.PFC.");
return single_value->field_r__PFC;
}

OCTETSTRING_template& PFC_template::b__PFC()
{
set_specific();
return single_value->field_b__PFC;
}

const OCTETSTRING_template& PFC_template::b__PFC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field b_PFC of a non-specific template of type @BSSGP_Types.PFC.");
return single_value->field_b__PFC;
}

int PFC_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC 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.PFC 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.PFC 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.PFC containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PFC.");
  }
  return 0;
}

void PFC_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(", bmax_PFC := ");
single_value->field_bmax__PFC.log();
TTCN_Logger::log_event_str(", r_PFC := ");
single_value->field_r__PFC.log();
TTCN_Logger::log_event_str(", b_PFC := ");
single_value->field_b__PFC.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 PFC_template::log_match(const PFC& 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);
}
if(!single_value->field_bmax__PFC.match(match_value.bmax__PFC(), legacy)){
TTCN_Logger::log_logmatch_info(".bmax_PFC");
single_value->field_bmax__PFC.log_match(match_value.bmax__PFC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_r__PFC.match(match_value.r__PFC(), legacy)){
TTCN_Logger::log_logmatch_info(".r_PFC");
single_value->field_r__PFC.log_match(match_value.r__PFC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_b__PFC.match(match_value.b__PFC(), legacy)){
TTCN_Logger::log_logmatch_info(".b_PFC");
single_value->field_b__PFC.log_match(match_value.b__PFC(), 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(", bmax_PFC := ");
single_value->field_bmax__PFC.log_match(match_value.bmax__PFC(), legacy);
TTCN_Logger::log_event_str(", r_PFC := ");
single_value->field_r__PFC.log_match(match_value.r__PFC(), legacy);
TTCN_Logger::log_event_str(", b_PFC := ");
single_value->field_b__PFC.log_match(match_value.b__PFC(), 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 PFC_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);
single_value->field_bmax__PFC.encode_text(text_buf);
single_value->field_r__PFC.encode_text(text_buf);
single_value->field_b__PFC.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.PFC.");
}
}

void PFC_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);
single_value->field_bmax__PFC.decode_text(text_buf);
single_value->field_r__PFC.decode_text(text_buf);
single_value->field_b__PFC.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 PFC_template[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.PFC.");
}
}

void PFC_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: {
    PFC_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.PFC 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__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));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bmax__PFC().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) r__PFC().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) b__PFC().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_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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bmax_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bmax__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "r_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          r__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "b_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          b__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PFC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PFC_template* precondition = new PFC_template;
    precondition->set_param(*param.get_elem(0));
    PFC_template* implied_template = new PFC_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PFC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PFC");
  }
  is_ifpresent = param.get_ifpresent();
}

void PFC_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.PFC");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC");
single_value->field_bmax__PFC.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC");
single_value->field_r__PFC.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC");
single_value->field_b__PFC.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC");
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.PFC");
}

boolean PFC_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PFC_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;
}

PFC__flow__control__parameters::PFC__flow__control__parameters()
{
}

PFC__flow__control__parameters::PFC__flow__control__parameters(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const INTEGER& par_number__of__PFC,
    const PFCs& par_pFCs)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_number__of__PFC(par_number__of__PFC),
  field_pFCs(par_pFCs)
{
}

PFC__flow__control__parameters::PFC__flow__control__parameters(const PFC__flow__control__parameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PFC_flow_control_parameters.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.number__of__PFC().is_bound()) field_number__of__PFC = other_value.number__of__PFC();
else field_number__of__PFC.clean_up();
if (other_value.pFCs().is_bound()) field_pFCs = other_value.pFCs();
else field_pFCs.clean_up();
}

void PFC__flow__control__parameters::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_number__of__PFC.clean_up();
field_pFCs.clean_up();
}

const TTCN_Typedescriptor_t* PFC__flow__control__parameters::get_descriptor() const { return &PFC__flow__control__parameters_descr_; }
PFC__flow__control__parameters& PFC__flow__control__parameters::operator=(const PFC__flow__control__parameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PFC_flow_control_parameters.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.number__of__PFC().is_bound()) field_number__of__PFC = other_value.number__of__PFC();
  else field_number__of__PFC.clean_up();
  if (other_value.pFCs().is_bound()) field_pFCs = other_value.pFCs();
  else field_pFCs.clean_up();
}
return *this;
}

boolean PFC__flow__control__parameters::operator==(const PFC__flow__control__parameters& 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__PFC==other_value.field_number__of__PFC
  && field_pFCs==other_value.field_pFCs;
}

boolean PFC__flow__control__parameters::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_number__of__PFC.is_bound())
  || (field_pFCs.is_bound());
}
boolean PFC__flow__control__parameters::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_number__of__PFC.is_value()
  && field_pFCs.is_value();
}
void PFC__flow__control__parameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", number_of_PFC := ");
field_number__of__PFC.log();
TTCN_Logger::log_event_str(", pFCs := ");
field_pFCs.log();
TTCN_Logger::log_event_str(" }");
}

void PFC__flow__control__parameters::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (number__of__PFC().is_bound()) number__of__PFC().set_implicit_omit();
if (pFCs().is_bound()) pFCs().set_implicit_omit();
}

void PFC__flow__control__parameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PFC_flow_control_parameters has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) number__of__PFC().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_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.PFC_flow_control_parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PFC_flow_control_parameters");
  }
}

void PFC__flow__control__parameters::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_number__of__PFC.encode_text(text_buf);
field_pFCs.encode_text(text_buf);
}

void PFC__flow__control__parameters::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_number__of__PFC.decode_text(text_buf);
field_pFCs.decode_text(text_buf);
}

void PFC__flow__control__parameters::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PFC__flow__control__parameters::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PFC__flow__control__parameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  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, PFC__flow__control__parameters_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(PFC__flow__control__parameters_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFC__flow__control__parameters_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PFC__flow__control__parameters_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, PFC__flow__control__parameters_number__of__PFC_descr_.raw->forceomit);
  decoded_field_length = field_number__of__PFC.RAW_decode(PFC__flow__control__parameters_number__of__PFC_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__PFC.convert_to_Integer(PFC__flow__control__parameters_number__of__PFC_descr_);
  field_number__of__PFC = 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, PFCs_descr_.raw->forceomit);
  decoded_field_length = field_pFCs.RAW_decode(PFCs_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_64) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PFC__flow__control__parameters::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PFC__flow__control__parameters_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFC__flow__control__parameters_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PFC__flow__control__parameters_number__of__PFC_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PFCs_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(PFC__flow__control__parameters_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(PFC__flow__control__parameters_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 = &PFC__flow__control__parameters_number__of__PFC_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(PFCs_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(PFC__flow__control__parameters_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(PFC__flow__control__parameters_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_64) {
  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_64.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 PFC__flow__control__parameters_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
INTEGER_template field_number__of__PFC;
PFCs_template field_pFCs;
};

void PFC__flow__control__parameters_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_number__of__PFC = ANY_VALUE;
single_value->field_pFCs = ANY_VALUE;
}
}
}

void PFC__flow__control__parameters_template::copy_value(const PFC__flow__control__parameters& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.number__of__PFC().is_bound()) {
  single_value->field_number__of__PFC = other_value.number__of__PFC();
} else {
  single_value->field_number__of__PFC.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 PFC__flow__control__parameters_template::copy_template(const PFC__flow__control__parameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.number__of__PFC().get_selection()) {
single_value->field_number__of__PFC = other_value.number__of__PFC();
} else {
single_value->field_number__of__PFC.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 PFC__flow__control__parameters_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PFC__flow__control__parameters_template(*other_value.implication_.precondition);
implication_.implied_template = new PFC__flow__control__parameters_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PFC_flow_control_parameters.");
break;
}
set_selection(other_value);
}

PFC__flow__control__parameters_template::PFC__flow__control__parameters_template()
{
}

PFC__flow__control__parameters_template::PFC__flow__control__parameters_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PFC__flow__control__parameters_template::PFC__flow__control__parameters_template(const PFC__flow__control__parameters& other_value)
{
copy_value(other_value);
}

PFC__flow__control__parameters_template::PFC__flow__control__parameters_template(const OPTIONAL<PFC__flow__control__parameters>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFC__flow__control__parameters&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PFC_flow_control_parameters from an unbound optional field.");
}
}

PFC__flow__control__parameters_template::PFC__flow__control__parameters_template(PFC__flow__control__parameters_template* p_precondition, PFC__flow__control__parameters_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PFC__flow__control__parameters_template::PFC__flow__control__parameters_template(Dynamic_Match_Interface<PFC__flow__control__parameters>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PFC__flow__control__parameters>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PFC__flow__control__parameters_template::PFC__flow__control__parameters_template(const PFC__flow__control__parameters_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PFC__flow__control__parameters_template::~PFC__flow__control__parameters_template()
{
clean_up();
}

PFC__flow__control__parameters_template& PFC__flow__control__parameters_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PFC__flow__control__parameters_template& PFC__flow__control__parameters_template::operator=(const PFC__flow__control__parameters& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PFC__flow__control__parameters_template& PFC__flow__control__parameters_template::operator=(const OPTIONAL<PFC__flow__control__parameters>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFC__flow__control__parameters&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PFC_flow_control_parameters.");
}
return *this;
}

PFC__flow__control__parameters_template& PFC__flow__control__parameters_template::operator=(const PFC__flow__control__parameters_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PFC__flow__control__parameters_template::match(const PFC__flow__control__parameters& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.number__of__PFC().is_bound()) return FALSE;
if(!single_value->field_number__of__PFC.match(other_value.number__of__PFC(), 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.PFC_flow_control_parameters.");
}
return FALSE;
}

boolean PFC__flow__control__parameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_number__of__PFC.is_bound()
 || single_value->field_pFCs.is_bound();
}

boolean PFC__flow__control__parameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_number__of__PFC.is_value()
 && single_value->field_pFCs.is_value();
}

void PFC__flow__control__parameters_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PFC__flow__control__parameters PFC__flow__control__parameters_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PFC_flow_control_parameters.");
PFC__flow__control__parameters ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_number__of__PFC.is_bound()) {
ret_val.number__of__PFC() = single_value->field_number__of__PFC.valueof();
}
if (single_value->field_pFCs.is_bound()) {
ret_val.pFCs() = single_value->field_pFCs.valueof();
}
return ret_val;
}

void PFC__flow__control__parameters_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PFC_flow_control_parameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PFC__flow__control__parameters_template[list_length];
}

PFC__flow__control__parameters_template& PFC__flow__control__parameters_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PFC_flow_control_parameters.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PFC_flow_control_parameters.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PFC__flow__control__parameters_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& PFC__flow__control__parameters_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.PFC_flow_control_parameters.");
return single_value->field_iEI;
}

BITSTRING_template& PFC__flow__control__parameters_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& PFC__flow__control__parameters_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.PFC_flow_control_parameters.");
return single_value->field_ext;
}

LIN2__2a_template& PFC__flow__control__parameters_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& PFC__flow__control__parameters_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.PFC_flow_control_parameters.");
return single_value->field_lengthIndicator;
}

INTEGER_template& PFC__flow__control__parameters_template::number__of__PFC()
{
set_specific();
return single_value->field_number__of__PFC;
}

const INTEGER_template& PFC__flow__control__parameters_template::number__of__PFC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_PFC of a non-specific template of type @BSSGP_Types.PFC_flow_control_parameters.");
return single_value->field_number__of__PFC;
}

PFCs_template& PFC__flow__control__parameters_template::pFCs()
{
set_specific();
return single_value->field_pFCs;
}

const PFCs_template& PFC__flow__control__parameters_template::pFCs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFCs of a non-specific template of type @BSSGP_Types.PFC_flow_control_parameters.");
return single_value->field_pFCs;
}

int PFC__flow__control__parameters_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 5;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFC_flow_control_parameters containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PFC_flow_control_parameters.");
  }
  return 0;
}

void PFC__flow__control__parameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", number_of_PFC := ");
single_value->field_number__of__PFC.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 PFC__flow__control__parameters_template::log_match(const PFC__flow__control__parameters& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_number__of__PFC.match(match_value.number__of__PFC(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_PFC");
single_value->field_number__of__PFC.log_match(match_value.number__of__PFC(), 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_PFC := ");
single_value->field_number__of__PFC.log_match(match_value.number__of__PFC(), 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 PFC__flow__control__parameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_number__of__PFC.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.PFC_flow_control_parameters.");
}
}

void PFC__flow__control__parameters_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_number__of__PFC.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 PFC__flow__control__parameters_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PFC_flow_control_parameters.");
}
}

void PFC__flow__control__parameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PFC__flow__control__parameters_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PFC_flow_control_parameters has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) number__of__PFC().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_PFC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.PFC_flow_control_parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PFC__flow__control__parameters_template* precondition = new PFC__flow__control__parameters_template;
    precondition->set_param(*param.get_elem(0));
    PFC__flow__control__parameters_template* implied_template = new PFC__flow__control__parameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PFC__flow__control__parameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PFC_flow_control_parameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void PFC__flow__control__parameters_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC_flow_control_parameters");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC_flow_control_parameters");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC_flow_control_parameters");
single_value->field_number__of__PFC.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC_flow_control_parameters");
single_value->field_pFCs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFC_flow_control_parameters");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PFC_flow_control_parameters");
}

boolean PFC__flow__control__parameters_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PFC__flow__control__parameters_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Global__CN__Id__Value::Global__CN__Id__Value()
{
}

Global__CN__Id__Value::Global__CN__Id__Value(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_cN__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),
  field_cN__Id(par_cN__Id)
{
}

Global__CN__Id__Value::Global__CN__Id__Value(const Global__CN__Id__Value& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Global_CN_Id_Value.");
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.cN__Id().is_bound()) field_cN__Id = other_value.cN__Id();
else field_cN__Id.clean_up();
}

void Global__CN__Id__Value::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_cN__Id.clean_up();
}

const TTCN_Typedescriptor_t* Global__CN__Id__Value::get_descriptor() const { return &Global__CN__Id__Value_descr_; }
Global__CN__Id__Value& Global__CN__Id__Value::operator=(const Global__CN__Id__Value& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Global_CN_Id_Value.");
  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.cN__Id().is_bound()) field_cN__Id = other_value.cN__Id();
  else field_cN__Id.clean_up();
}
return *this;
}

boolean Global__CN__Id__Value::operator==(const Global__CN__Id__Value& 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_cN__Id==other_value.field_cN__Id;
}

boolean Global__CN__Id__Value::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_cN__Id.is_bound());
}
boolean Global__CN__Id__Value::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_cN__Id.is_value();
}
void Global__CN__Id__Value::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(", cN_Id := ");
field_cN__Id.log();
TTCN_Logger::log_event_str(" }");
}

void Global__CN__Id__Value::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 (cN__Id().is_bound()) cN__Id().set_implicit_omit();
}

void Global__CN__Id__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 (7<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Global_CN_Id_Value 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) cN__Id().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(), "cN_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cN__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Global_CN_Id_Value: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Global_CN_Id_Value");
  }
}

void Global__CN__Id__Value::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_cN__Id.encode_text(text_buf);
}

void Global__CN__Id__Value::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_cN__Id.decode_text(text_buf);
}

void Global__CN__Id__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 Global__CN__Id__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 Global__CN__Id__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::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_cN__Id.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 Global__CN__Id__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 = 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_cN__Id.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct Global__CN__Id__Value_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_cN__Id;
};

void Global__CN__Id__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_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_cN__Id = ANY_VALUE;
}
}
}

void Global__CN__Id__Value_template::copy_value(const Global__CN__Id__Value& 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.cN__Id().is_bound()) {
  single_value->field_cN__Id = other_value.cN__Id();
} else {
  single_value->field_cN__Id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Global__CN__Id__Value_template::copy_template(const Global__CN__Id__Value_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.cN__Id().get_selection()) {
single_value->field_cN__Id = other_value.cN__Id();
} else {
single_value->field_cN__Id.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Global__CN__Id__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 Global__CN__Id__Value_template(*other_value.implication_.precondition);
implication_.implied_template = new Global__CN__Id__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.Global_CN_Id_Value.");
break;
}
set_selection(other_value);
}

Global__CN__Id__Value_template::Global__CN__Id__Value_template()
{
}

Global__CN__Id__Value_template::Global__CN__Id__Value_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Global__CN__Id__Value_template::Global__CN__Id__Value_template(const Global__CN__Id__Value& other_value)
{
copy_value(other_value);
}

Global__CN__Id__Value_template::Global__CN__Id__Value_template(const OPTIONAL<Global__CN__Id__Value>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Global__CN__Id__Value&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Global_CN_Id_Value from an unbound optional field.");
}
}

Global__CN__Id__Value_template::Global__CN__Id__Value_template(Global__CN__Id__Value_template* p_precondition, Global__CN__Id__Value_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Global__CN__Id__Value_template::Global__CN__Id__Value_template(Dynamic_Match_Interface<Global__CN__Id__Value>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Global__CN__Id__Value>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Global__CN__Id__Value_template::Global__CN__Id__Value_template(const Global__CN__Id__Value_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Global__CN__Id__Value_template::~Global__CN__Id__Value_template()
{
clean_up();
}

Global__CN__Id__Value_template& Global__CN__Id__Value_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Global__CN__Id__Value_template& Global__CN__Id__Value_template::operator=(const Global__CN__Id__Value& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Global__CN__Id__Value_template& Global__CN__Id__Value_template::operator=(const OPTIONAL<Global__CN__Id__Value>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Global__CN__Id__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.Global_CN_Id_Value.");
}
return *this;
}

Global__CN__Id__Value_template& Global__CN__Id__Value_template::operator=(const Global__CN__Id__Value_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Global__CN__Id__Value_template::match(const Global__CN__Id__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.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.cN__Id().is_bound()) return FALSE;
if(!single_value->field_cN__Id.match(other_value.cN__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.Global_CN_Id_Value.");
}
return FALSE;
}

boolean Global__CN__Id__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_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_cN__Id.is_bound();
}

boolean Global__CN__Id__Value_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_cN__Id.is_value();
}

void Global__CN__Id__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;
}

Global__CN__Id__Value Global__CN__Id__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.Global_CN_Id_Value.");
Global__CN__Id__Value 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_cN__Id.is_bound()) {
ret_val.cN__Id() = single_value->field_cN__Id.valueof();
}
return ret_val;
}

void Global__CN__Id__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.Global_CN_Id_Value.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Global__CN__Id__Value_template[list_length];
}

Global__CN__Id__Value_template& Global__CN__Id__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.Global_CN_Id_Value.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Global_CN_Id_Value.");
return value_list.list_value[list_index];
}

HEXSTRING_template& Global__CN__Id__Value_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& Global__CN__Id__Value_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.Global_CN_Id_Value.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& Global__CN__Id__Value_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& Global__CN__Id__Value_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.Global_CN_Id_Value.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& Global__CN__Id__Value_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& Global__CN__Id__Value_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.Global_CN_Id_Value.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& Global__CN__Id__Value_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& Global__CN__Id__Value_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.Global_CN_Id_Value.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& Global__CN__Id__Value_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& Global__CN__Id__Value_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.Global_CN_Id_Value.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& Global__CN__Id__Value_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& Global__CN__Id__Value_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.Global_CN_Id_Value.");
return single_value->field_mncDigit2;
}

OCTETSTRING_template& Global__CN__Id__Value_template::cN__Id()
{
set_specific();
return single_value->field_cN__Id;
}

const OCTETSTRING_template& Global__CN__Id__Value_template::cN__Id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cN_Id of a non-specific template of type @BSSGP_Types.Global_CN_Id_Value.");
return single_value->field_cN__Id;
}

int Global__CN__Id__Value_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_Value 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.Global_CN_Id_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.Global_CN_Id_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.Global_CN_Id_Value containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_Value containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_Value containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_Value containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_Value containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_Value containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Global_CN_Id_Value.");
  }
  return 0;
}

void Global__CN__Id__Value_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(", cN_Id := ");
single_value->field_cN__Id.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Global__CN__Id__Value_template::log_match(const Global__CN__Id__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_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_cN__Id.match(match_value.cN__Id(), legacy)){
TTCN_Logger::log_logmatch_info(".cN_Id");
single_value->field_cN__Id.log_match(match_value.cN__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("{ 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(", cN_Id := ");
single_value->field_cN__Id.log_match(match_value.cN__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 Global__CN__Id__Value_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_cN__Id.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.Global_CN_Id_Value.");
}
}

void Global__CN__Id__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_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_cN__Id.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Global__CN__Id__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.Global_CN_Id_Value.");
}
}

void Global__CN__Id__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: {
    Global__CN__Id__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 (7<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Global_CN_Id_Value 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) cN__Id().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(), "cN_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cN__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Global_CN_Id_Value: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Global__CN__Id__Value_template* precondition = new Global__CN__Id__Value_template;
    precondition->set_param(*param.get_elem(0));
    Global__CN__Id__Value_template* implied_template = new Global__CN__Id__Value_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Global__CN__Id__Value_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Global_CN_Id_Value");
  }
  is_ifpresent = param.get_ifpresent();
}

void Global__CN__Id__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_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_Value");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_Value");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_Value");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_Value");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_Value");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_Value");
single_value->field_cN__Id.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_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.Global_CN_Id_Value");
}

boolean Global__CN__Id__Value_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Global__CN__Id__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;
}

Global__CN__Id__BSSGP::Global__CN__Id__BSSGP()
{
}

Global__CN__Id__BSSGP::Global__CN__Id__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Global__CN__Id__Value& par_global__CN__Id)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_global__CN__Id(par_global__CN__Id)
{
}

Global__CN__Id__BSSGP::Global__CN__Id__BSSGP(const Global__CN__Id__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Global_CN_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.global__CN__Id().is_bound()) field_global__CN__Id = other_value.global__CN__Id();
else field_global__CN__Id.clean_up();
}

void Global__CN__Id__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_global__CN__Id.clean_up();
}

const TTCN_Typedescriptor_t* Global__CN__Id__BSSGP::get_descriptor() const { return &Global__CN__Id__BSSGP_descr_; }
Global__CN__Id__BSSGP& Global__CN__Id__BSSGP::operator=(const Global__CN__Id__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Global_CN_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.global__CN__Id().is_bound()) field_global__CN__Id = other_value.global__CN__Id();
  else field_global__CN__Id.clean_up();
}
return *this;
}

boolean Global__CN__Id__BSSGP::operator==(const Global__CN__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_global__CN__Id==other_value.field_global__CN__Id;
}

boolean Global__CN__Id__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_global__CN__Id.is_bound());
}
boolean Global__CN__Id__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_global__CN__Id.is_value();
}
void Global__CN__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(", global_CN_Id := ");
field_global__CN__Id.log();
TTCN_Logger::log_event_str(" }");
}

void Global__CN__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 (global__CN__Id().is_bound()) global__CN__Id().set_implicit_omit();
}

void Global__CN__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 (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Global_CN_Id_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) global__CN__Id().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "global_CN_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__CN__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Global_CN_Id_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Global_CN_Id_BSSGP");
  }
}

void Global__CN__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_global__CN__Id.encode_text(text_buf);
}

void Global__CN__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_global__CN__Id.decode_text(text_buf);
}

void Global__CN__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 Global__CN__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 Global__CN__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, Global__CN__Id__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Global__CN__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, Global__CN__Id__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Global__CN__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, Global__CN__Id__Value_descr_.raw->forceomit);
  decoded_field_length = field_global__CN__Id.RAW_decode(Global__CN__Id__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_40) 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__CN__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 = 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, Global__CN__Id__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Global__CN__Id__BSSGP_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Global__CN__Id__Value_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Global__CN__Id__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Global__CN__Id__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_global__CN__Id.RAW_encode(Global__CN__Id__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(Global__CN__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(Global__CN__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_40) {
  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_40.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Global__CN__Id__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Global__CN__Id__Value_template field_global__CN__Id;
};

void Global__CN__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_global__CN__Id = ANY_VALUE;
}
}
}

void Global__CN__Id__BSSGP_template::copy_value(const Global__CN__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.global__CN__Id().is_bound()) {
  single_value->field_global__CN__Id = other_value.global__CN__Id();
} else {
  single_value->field_global__CN__Id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Global__CN__Id__BSSGP_template::copy_template(const Global__CN__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.global__CN__Id().get_selection()) {
single_value->field_global__CN__Id = other_value.global__CN__Id();
} else {
single_value->field_global__CN__Id.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Global__CN__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 Global__CN__Id__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Global__CN__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.Global_CN_Id_BSSGP.");
break;
}
set_selection(other_value);
}

Global__CN__Id__BSSGP_template::Global__CN__Id__BSSGP_template()
{
}

Global__CN__Id__BSSGP_template::Global__CN__Id__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Global__CN__Id__BSSGP_template::Global__CN__Id__BSSGP_template(const Global__CN__Id__BSSGP& other_value)
{
copy_value(other_value);
}

Global__CN__Id__BSSGP_template::Global__CN__Id__BSSGP_template(const OPTIONAL<Global__CN__Id__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Global__CN__Id__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Global_CN_Id_BSSGP from an unbound optional field.");
}
}

Global__CN__Id__BSSGP_template::Global__CN__Id__BSSGP_template(Global__CN__Id__BSSGP_template* p_precondition, Global__CN__Id__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Global__CN__Id__BSSGP_template::Global__CN__Id__BSSGP_template(Dynamic_Match_Interface<Global__CN__Id__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Global__CN__Id__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Global__CN__Id__BSSGP_template::Global__CN__Id__BSSGP_template(const Global__CN__Id__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Global__CN__Id__BSSGP_template::~Global__CN__Id__BSSGP_template()
{
clean_up();
}

Global__CN__Id__BSSGP_template& Global__CN__Id__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Global__CN__Id__BSSGP_template& Global__CN__Id__BSSGP_template::operator=(const Global__CN__Id__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Global__CN__Id__BSSGP_template& Global__CN__Id__BSSGP_template::operator=(const OPTIONAL<Global__CN__Id__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Global__CN__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.Global_CN_Id_BSSGP.");
}
return *this;
}

Global__CN__Id__BSSGP_template& Global__CN__Id__BSSGP_template::operator=(const Global__CN__Id__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Global__CN__Id__BSSGP_template::match(const Global__CN__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.global__CN__Id().is_bound()) return FALSE;
if(!single_value->field_global__CN__Id.match(other_value.global__CN__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.Global_CN_Id_BSSGP.");
}
return FALSE;
}

boolean Global__CN__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_global__CN__Id.is_bound();
}

boolean Global__CN__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_global__CN__Id.is_value();
}

void Global__CN__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;
}

Global__CN__Id__BSSGP Global__CN__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.Global_CN_Id_BSSGP.");
Global__CN__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_global__CN__Id.is_bound()) {
ret_val.global__CN__Id() = single_value->field_global__CN__Id.valueof();
}
return ret_val;
}

void Global__CN__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.Global_CN_Id_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Global__CN__Id__BSSGP_template[list_length];
}

Global__CN__Id__BSSGP_template& Global__CN__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.Global_CN_Id_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Global_CN_Id_BSSGP.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Global__CN__Id__BSSGP_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Global__CN__Id__BSSGP_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Global_CN_Id_BSSGP.");
return single_value->field_iEI;
}

BITSTRING_template& Global__CN__Id__BSSGP_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Global__CN__Id__BSSGP_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Global_CN_Id_BSSGP.");
return single_value->field_ext;
}

LIN2__2a_template& Global__CN__Id__BSSGP_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Global__CN__Id__BSSGP_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Global_CN_Id_BSSGP.");
return single_value->field_lengthIndicator;
}

Global__CN__Id__Value_template& Global__CN__Id__BSSGP_template::global__CN__Id()
{
set_specific();
return single_value->field_global__CN__Id;
}

const Global__CN__Id__Value_template& Global__CN__Id__BSSGP_template::global__CN__Id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field global_CN_Id of a non-specific template of type @BSSGP_Types.Global_CN_Id_BSSGP.");
return single_value->field_global__CN__Id;
}

int Global__CN__Id__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_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.Global_CN_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.Global_CN_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.Global_CN_Id_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Global_CN_Id_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Global_CN_Id_BSSGP.");
  }
  return 0;
}

void Global__CN__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(", global_CN_Id := ");
single_value->field_global__CN__Id.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Global__CN__Id__BSSGP_template::log_match(const Global__CN__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_global__CN__Id.match(match_value.global__CN__Id(), legacy)){
TTCN_Logger::log_logmatch_info(".global_CN_Id");
single_value->field_global__CN__Id.log_match(match_value.global__CN__Id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
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_CN_Id := ");
single_value->field_global__CN__Id.log_match(match_value.global__CN__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 Global__CN__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_global__CN__Id.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.Global_CN_Id_BSSGP.");
}
}

void Global__CN__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_global__CN__Id.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Global__CN__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.Global_CN_Id_BSSGP.");
}
}

void Global__CN__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: {
    Global__CN__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 (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Global_CN_Id_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) global__CN__Id().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "global_CN_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__CN__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Global_CN_Id_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Global__CN__Id__BSSGP_template* precondition = new Global__CN__Id__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Global__CN__Id__BSSGP_template* implied_template = new Global__CN__Id__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Global__CN__Id__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Global_CN_Id_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void Global__CN__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.Global_CN_Id_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_Id_BSSGP");
single_value->field_global__CN__Id.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Global_CN_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.Global_CN_Id_BSSGP");
}

boolean Global__CN__Id__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Global__CN__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;
}

void RIM__Routing__Address::copy_value(const RIM__Routing__Address& other_value)
{
switch (other_value.union_selection) {
case ALT_cell__Identifier:
field_cell__Identifier = new Cell__Identifier__V(*other_value.field_cell__Identifier);
break;
case ALT_globalRNCID:
field_globalRNCID = new GlobalRNC__ID__BSSGP(*other_value.field_globalRNCID);
break;
case ALT_eNB__Identifier:
field_eNB__Identifier = new ENB__Identifier__V(*other_value.field_eNB__Identifier);
break;
case ALT_eHRPD__SectorID:
field_eHRPD__SectorID = new OCTETSTRING(*other_value.field_eHRPD__SectorID);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.RIM_Routing_Address.");
}
union_selection = other_value.union_selection;
}

RIM__Routing__Address::RIM__Routing__Address()
{
union_selection = UNBOUND_VALUE;
}

RIM__Routing__Address::RIM__Routing__Address(const RIM__Routing__Address& other_value)
: Base_Type(){
copy_value(other_value);
}

RIM__Routing__Address::~RIM__Routing__Address()
{
clean_up();
}

RIM__Routing__Address& RIM__Routing__Address::operator=(const RIM__Routing__Address& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean RIM__Routing__Address::operator==(const RIM__Routing__Address& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.RIM_Routing_Address.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.RIM_Routing_Address.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_cell__Identifier:
return *field_cell__Identifier == *other_value.field_cell__Identifier;
case ALT_globalRNCID:
return *field_globalRNCID == *other_value.field_globalRNCID;
case ALT_eNB__Identifier:
return *field_eNB__Identifier == *other_value.field_eNB__Identifier;
case ALT_eHRPD__SectorID:
return *field_eHRPD__SectorID == *other_value.field_eHRPD__SectorID;
default:
return FALSE;
}
}

Cell__Identifier__V& RIM__Routing__Address::cell__Identifier()
{
if (union_selection != ALT_cell__Identifier) {
clean_up();
field_cell__Identifier = new Cell__Identifier__V;
union_selection = ALT_cell__Identifier;
}
return *field_cell__Identifier;
}

const Cell__Identifier__V& RIM__Routing__Address::cell__Identifier() const
{
if (union_selection != ALT_cell__Identifier) TTCN_error("Using non-selected field cell_Identifier in a value of union type @BSSGP_Types.RIM_Routing_Address.");
return *field_cell__Identifier;
}

GlobalRNC__ID__BSSGP& RIM__Routing__Address::globalRNCID()
{
if (union_selection != ALT_globalRNCID) {
clean_up();
field_globalRNCID = new GlobalRNC__ID__BSSGP;
union_selection = ALT_globalRNCID;
}
return *field_globalRNCID;
}

const GlobalRNC__ID__BSSGP& RIM__Routing__Address::globalRNCID() const
{
if (union_selection != ALT_globalRNCID) TTCN_error("Using non-selected field globalRNCID in a value of union type @BSSGP_Types.RIM_Routing_Address.");
return *field_globalRNCID;
}

ENB__Identifier__V& RIM__Routing__Address::eNB__Identifier()
{
if (union_selection != ALT_eNB__Identifier) {
clean_up();
field_eNB__Identifier = new ENB__Identifier__V;
union_selection = ALT_eNB__Identifier;
}
return *field_eNB__Identifier;
}

const ENB__Identifier__V& RIM__Routing__Address::eNB__Identifier() const
{
if (union_selection != ALT_eNB__Identifier) TTCN_error("Using non-selected field eNB_Identifier in a value of union type @BSSGP_Types.RIM_Routing_Address.");
return *field_eNB__Identifier;
}

OCTETSTRING& RIM__Routing__Address::eHRPD__SectorID()
{
if (union_selection != ALT_eHRPD__SectorID) {
clean_up();
field_eHRPD__SectorID = new OCTETSTRING;
union_selection = ALT_eHRPD__SectorID;
}
return *field_eHRPD__SectorID;
}

const OCTETSTRING& RIM__Routing__Address::eHRPD__SectorID() const
{
if (union_selection != ALT_eHRPD__SectorID) TTCN_error("Using non-selected field eHRPD_SectorID in a value of union type @BSSGP_Types.RIM_Routing_Address.");
return *field_eHRPD__SectorID;
}

boolean RIM__Routing__Address::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.RIM_Routing_Address.");
return union_selection == checked_selection;
}

boolean RIM__Routing__Address::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean RIM__Routing__Address::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_cell__Identifier: return field_cell__Identifier->is_value();
case ALT_globalRNCID: return field_globalRNCID->is_value();
case ALT_eNB__Identifier: return field_eNB__Identifier->is_value();
case ALT_eHRPD__SectorID: return field_eHRPD__SectorID->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void RIM__Routing__Address::clean_up()
{
switch (union_selection) {
case ALT_cell__Identifier:
  delete field_cell__Identifier;
  break;
case ALT_globalRNCID:
  delete field_globalRNCID;
  break;
case ALT_eNB__Identifier:
  delete field_eNB__Identifier;
  break;
case ALT_eHRPD__SectorID:
  delete field_eHRPD__SectorID;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void RIM__Routing__Address::log() const
{
switch (union_selection) {
case ALT_cell__Identifier:
TTCN_Logger::log_event_str("{ cell_Identifier := ");
field_cell__Identifier->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_globalRNCID:
TTCN_Logger::log_event_str("{ globalRNCID := ");
field_globalRNCID->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_eNB__Identifier:
TTCN_Logger::log_event_str("{ eNB_Identifier := ");
field_eNB__Identifier->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_eHRPD__SectorID:
TTCN_Logger::log_event_str("{ eHRPD_SectorID := ");
field_eHRPD__SectorID->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void RIM__Routing__Address::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "cell_Identifier")) {
    cell__Identifier().set_param(*mp_last);
    if (!cell__Identifier().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "globalRNCID")) {
    globalRNCID().set_param(*mp_last);
    if (!globalRNCID().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "eNB_Identifier")) {
    eNB__Identifier().set_param(*mp_last);
    if (!eNB__Identifier().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "eHRPD_SectorID")) {
    eHRPD__SectorID().set_param(*mp_last);
    if (!eHRPD__SectorID().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.RIM_Routing_Address.", last_name);
}

void RIM__Routing__Address::set_implicit_omit()
{
switch (union_selection) {
case ALT_cell__Identifier:
field_cell__Identifier->set_implicit_omit(); break;
case ALT_globalRNCID:
field_globalRNCID->set_implicit_omit(); break;
case ALT_eNB__Identifier:
field_eNB__Identifier->set_implicit_omit(); break;
case ALT_eHRPD__SectorID:
field_eHRPD__SectorID->set_implicit_omit(); break;
default: break;
}
}

void RIM__Routing__Address::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_cell__Identifier:
field_cell__Identifier->encode_text(text_buf);
break;
case ALT_globalRNCID:
field_globalRNCID->encode_text(text_buf);
break;
case ALT_eNB__Identifier:
field_eNB__Identifier->encode_text(text_buf);
break;
case ALT_eHRPD__SectorID:
field_eHRPD__SectorID->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.RIM_Routing_Address.");
}
}

void RIM__Routing__Address::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_cell__Identifier:
cell__Identifier().decode_text(text_buf);
break;
case ALT_globalRNCID:
globalRNCID().decode_text(text_buf);
break;
case ALT_eNB__Identifier:
eNB__Identifier().decode_text(text_buf);
break;
case ALT_eHRPD__SectorID:
eHRPD__SectorID().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.RIM_Routing_Address.");
}
}

void RIM__Routing__Address::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 RIM__Routing__Address::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 RIM__Routing__Address::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, Cell__Identifier__V_descr_.raw->forceomit);
      decoded_length = cell__Identifier().RAW_decode(Cell__Identifier__V_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, GlobalRNC__ID__BSSGP_descr_.raw->forceomit);
      decoded_length = globalRNCID().RAW_decode(GlobalRNC__ID__BSSGP_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, ENB__Identifier__V_descr_.raw->forceomit);
      decoded_length = eNB__Identifier().RAW_decode(ENB__Identifier__V_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = eHRPD__SectorID().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, Cell__Identifier__V_descr_.raw->forceomit);
      decoded_length = cell__Identifier().RAW_decode(Cell__Identifier__V_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, GlobalRNC__ID__BSSGP_descr_.raw->forceomit);
      decoded_length = globalRNCID().RAW_decode(GlobalRNC__ID__BSSGP_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, ENB__Identifier__V_descr_.raw->forceomit);
      decoded_length = eNB__Identifier().RAW_decode(ENB__Identifier__V_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = eHRPD__SectorID().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int RIM__Routing__Address::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  memset(myleaf.body.node.nodes, 0, 4 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_cell__Identifier:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, Cell__Identifier__V_descr_.raw);
    encoded_length = field_cell__Identifier->RAW_encode(Cell__Identifier__V_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &Cell__Identifier__V_descr_;
    break;
  case ALT_globalRNCID:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, GlobalRNC__ID__BSSGP_descr_.raw);
    encoded_length = field_globalRNCID->RAW_encode(GlobalRNC__ID__BSSGP_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &GlobalRNC__ID__BSSGP_descr_;
    break;
  case ALT_eNB__Identifier:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, ENB__Identifier__V_descr_.raw);
    encoded_length = field_eNB__Identifier->RAW_encode(ENB__Identifier__V_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &ENB__Identifier__V_descr_;
    break;
  case ALT_eHRPD__SectorID:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, OCTETSTRING_descr_.raw);
    encoded_length = field_eHRPD__SectorID->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &OCTETSTRING_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void RIM__Routing__Address_template::copy_value(const RIM__Routing__Address& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case RIM__Routing__Address::ALT_cell__Identifier:
single_value.field_cell__Identifier = new Cell__Identifier__V_template(other_value.cell__Identifier());
break;
case RIM__Routing__Address::ALT_globalRNCID:
single_value.field_globalRNCID = new GlobalRNC__ID__BSSGP_template(other_value.globalRNCID());
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
single_value.field_eNB__Identifier = new ENB__Identifier__V_template(other_value.eNB__Identifier());
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
single_value.field_eHRPD__SectorID = new OCTETSTRING_template(other_value.eHRPD__SectorID());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.RIM_Routing_Address.");
}
set_selection(SPECIFIC_VALUE);
}

void RIM__Routing__Address_template::copy_template(const RIM__Routing__Address_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 RIM__Routing__Address::ALT_cell__Identifier:
single_value.field_cell__Identifier = new Cell__Identifier__V_template(*other_value.single_value.field_cell__Identifier);
break;
case RIM__Routing__Address::ALT_globalRNCID:
single_value.field_globalRNCID = new GlobalRNC__ID__BSSGP_template(*other_value.single_value.field_globalRNCID);
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
single_value.field_eNB__Identifier = new ENB__Identifier__V_template(*other_value.single_value.field_eNB__Identifier);
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
single_value.field_eHRPD__SectorID = new OCTETSTRING_template(*other_value.single_value.field_eHRPD__SectorID);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.RIM_Routing_Address.");
}
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 RIM__Routing__Address_template[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 RIM__Routing__Address_template(*other_value.implication_.precondition);
implication_.implied_template = new RIM__Routing__Address_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.RIM_Routing_Address.");
}
set_selection(other_value);
}

RIM__Routing__Address_template::RIM__Routing__Address_template()
{
}

RIM__Routing__Address_template::RIM__Routing__Address_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RIM__Routing__Address_template::RIM__Routing__Address_template(const RIM__Routing__Address& other_value)
{
copy_value(other_value);
}

RIM__Routing__Address_template::RIM__Routing__Address_template(const OPTIONAL<RIM__Routing__Address>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RIM__Routing__Address&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @BSSGP_Types.RIM_Routing_Address from an unbound optional field.");
}
}

RIM__Routing__Address_template::RIM__Routing__Address_template(RIM__Routing__Address_template* p_precondition, RIM__Routing__Address_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RIM__Routing__Address_template::RIM__Routing__Address_template(Dynamic_Match_Interface<RIM__Routing__Address>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RIM__Routing__Address>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RIM__Routing__Address_template::RIM__Routing__Address_template(const RIM__Routing__Address_template& other_value)
: Base_Template(){
copy_template(other_value);
}

RIM__Routing__Address_template::~RIM__Routing__Address_template()
{
clean_up();
}

void RIM__Routing__Address_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RIM__Routing__Address::ALT_cell__Identifier:
delete single_value.field_cell__Identifier;
break;
case RIM__Routing__Address::ALT_globalRNCID:
delete single_value.field_globalRNCID;
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
delete single_value.field_eNB__Identifier;
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
delete single_value.field_eHRPD__SectorID;
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;
}

RIM__Routing__Address_template& RIM__Routing__Address_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RIM__Routing__Address_template& RIM__Routing__Address_template::operator=(const RIM__Routing__Address& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RIM__Routing__Address_template& RIM__Routing__Address_template::operator=(const OPTIONAL<RIM__Routing__Address>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RIM__Routing__Address&)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.RIM_Routing_Address.");
}
return *this;
}

RIM__Routing__Address_template& RIM__Routing__Address_template::operator=(const RIM__Routing__Address_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RIM__Routing__Address_template::match(const RIM__Routing__Address& 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:
{
RIM__Routing__Address::union_selection_type value_selection = other_value.get_selection();
if (value_selection == RIM__Routing__Address::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case RIM__Routing__Address::ALT_cell__Identifier:
return single_value.field_cell__Identifier->match(other_value.cell__Identifier(), legacy);
case RIM__Routing__Address::ALT_globalRNCID:
return single_value.field_globalRNCID->match(other_value.globalRNCID(), legacy);
case RIM__Routing__Address::ALT_eNB__Identifier:
return single_value.field_eNB__Identifier->match(other_value.eNB__Identifier(), legacy);
case RIM__Routing__Address::ALT_eHRPD__SectorID:
return single_value.field_eHRPD__SectorID->match(other_value.eHRPD__SectorID(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.RIM_Routing_Address.");
}
}
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.RIM_Routing_Address.");
}
return FALSE;
}

boolean RIM__Routing__Address_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case RIM__Routing__Address::ALT_cell__Identifier:
return single_value.field_cell__Identifier->is_value();
case RIM__Routing__Address::ALT_globalRNCID:
return single_value.field_globalRNCID->is_value();
case RIM__Routing__Address::ALT_eNB__Identifier:
return single_value.field_eNB__Identifier->is_value();
case RIM__Routing__Address::ALT_eHRPD__SectorID:
return single_value.field_eHRPD__SectorID->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.RIM_Routing_Address.");
}
}

RIM__Routing__Address RIM__Routing__Address_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.RIM_Routing_Address.");
RIM__Routing__Address ret_val;
switch (single_value.union_selection) {
case RIM__Routing__Address::ALT_cell__Identifier:
ret_val.cell__Identifier() = single_value.field_cell__Identifier->valueof();
break;
case RIM__Routing__Address::ALT_globalRNCID:
ret_val.globalRNCID() = single_value.field_globalRNCID->valueof();
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
ret_val.eNB__Identifier() = single_value.field_eNB__Identifier->valueof();
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
ret_val.eHRPD__SectorID() = single_value.field_eHRPD__SectorID->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.RIM_Routing_Address.");
}
return ret_val;
}

RIM__Routing__Address_template& RIM__Routing__Address_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.RIM_Routing_Address.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.RIM_Routing_Address.");
return value_list.list_value[list_index];
}
void RIM__Routing__Address_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.RIM_Routing_Address.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RIM__Routing__Address_template[list_length];
}

Cell__Identifier__V_template& RIM__Routing__Address_template::cell__Identifier()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RIM__Routing__Address::ALT_cell__Identifier) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cell__Identifier = new Cell__Identifier__V_template(ANY_VALUE);
else single_value.field_cell__Identifier = new Cell__Identifier__V_template;
single_value.union_selection = RIM__Routing__Address::ALT_cell__Identifier;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cell__Identifier;
}

const Cell__Identifier__V_template& RIM__Routing__Address_template::cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cell_Identifier in a non-specific template of union type @BSSGP_Types.RIM_Routing_Address.");
if (single_value.union_selection != RIM__Routing__Address::ALT_cell__Identifier) TTCN_error("Accessing non-selected field cell_Identifier in a template of union type @BSSGP_Types.RIM_Routing_Address.");
return *single_value.field_cell__Identifier;
}

GlobalRNC__ID__BSSGP_template& RIM__Routing__Address_template::globalRNCID()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RIM__Routing__Address::ALT_globalRNCID) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_globalRNCID = new GlobalRNC__ID__BSSGP_template(ANY_VALUE);
else single_value.field_globalRNCID = new GlobalRNC__ID__BSSGP_template;
single_value.union_selection = RIM__Routing__Address::ALT_globalRNCID;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_globalRNCID;
}

const GlobalRNC__ID__BSSGP_template& RIM__Routing__Address_template::globalRNCID() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field globalRNCID in a non-specific template of union type @BSSGP_Types.RIM_Routing_Address.");
if (single_value.union_selection != RIM__Routing__Address::ALT_globalRNCID) TTCN_error("Accessing non-selected field globalRNCID in a template of union type @BSSGP_Types.RIM_Routing_Address.");
return *single_value.field_globalRNCID;
}

ENB__Identifier__V_template& RIM__Routing__Address_template::eNB__Identifier()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RIM__Routing__Address::ALT_eNB__Identifier) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_eNB__Identifier = new ENB__Identifier__V_template(ANY_VALUE);
else single_value.field_eNB__Identifier = new ENB__Identifier__V_template;
single_value.union_selection = RIM__Routing__Address::ALT_eNB__Identifier;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_eNB__Identifier;
}

const ENB__Identifier__V_template& RIM__Routing__Address_template::eNB__Identifier() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eNB_Identifier in a non-specific template of union type @BSSGP_Types.RIM_Routing_Address.");
if (single_value.union_selection != RIM__Routing__Address::ALT_eNB__Identifier) TTCN_error("Accessing non-selected field eNB_Identifier in a template of union type @BSSGP_Types.RIM_Routing_Address.");
return *single_value.field_eNB__Identifier;
}

OCTETSTRING_template& RIM__Routing__Address_template::eHRPD__SectorID()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RIM__Routing__Address::ALT_eHRPD__SectorID) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_eHRPD__SectorID = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_eHRPD__SectorID = new OCTETSTRING_template;
single_value.union_selection = RIM__Routing__Address::ALT_eHRPD__SectorID;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_eHRPD__SectorID;
}

const OCTETSTRING_template& RIM__Routing__Address_template::eHRPD__SectorID() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eHRPD_SectorID in a non-specific template of union type @BSSGP_Types.RIM_Routing_Address.");
if (single_value.union_selection != RIM__Routing__Address::ALT_eHRPD__SectorID) TTCN_error("Accessing non-selected field eHRPD_SectorID in a template of union type @BSSGP_Types.RIM_Routing_Address.");
return *single_value.field_eHRPD__SectorID;
}

boolean RIM__Routing__Address_template::ischosen(RIM__Routing__Address::union_selection_type checked_selection) const
{
if (checked_selection == RIM__Routing__Address::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.RIM_Routing_Address.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == RIM__Routing__Address::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.RIM_Routing_Address.");
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.RIM_Routing_Address 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 RIM__Routing__Address_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RIM__Routing__Address::ALT_cell__Identifier:
TTCN_Logger::log_event_str("{ cell_Identifier := ");
single_value.field_cell__Identifier->log();
TTCN_Logger::log_event_str(" }");
break;
case RIM__Routing__Address::ALT_globalRNCID:
TTCN_Logger::log_event_str("{ globalRNCID := ");
single_value.field_globalRNCID->log();
TTCN_Logger::log_event_str(" }");
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
TTCN_Logger::log_event_str("{ eNB_Identifier := ");
single_value.field_eNB__Identifier->log();
TTCN_Logger::log_event_str(" }");
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
TTCN_Logger::log_event_str("{ eHRPD_SectorID := ");
single_value.field_eHRPD__SectorID->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 RIM__Routing__Address_template::log_match(const RIM__Routing__Address& 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 RIM__Routing__Address::ALT_cell__Identifier:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cell_Identifier");
single_value.field_cell__Identifier->log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cell_Identifier := ");
single_value.field_cell__Identifier->log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RIM__Routing__Address::ALT_globalRNCID:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".globalRNCID");
single_value.field_globalRNCID->log_match(match_value.globalRNCID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ globalRNCID := ");
single_value.field_globalRNCID->log_match(match_value.globalRNCID(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".eNB_Identifier");
single_value.field_eNB__Identifier->log_match(match_value.eNB__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ eNB_Identifier := ");
single_value.field_eNB__Identifier->log_match(match_value.eNB__Identifier(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".eHRPD_SectorID");
single_value.field_eHRPD__SectorID->log_match(match_value.eHRPD__SectorID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ eHRPD_SectorID := ");
single_value.field_eHRPD__SectorID->log_match(match_value.eHRPD__SectorID(), 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 RIM__Routing__Address_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 RIM__Routing__Address::ALT_cell__Identifier:
single_value.field_cell__Identifier->encode_text(text_buf);
break;
case RIM__Routing__Address::ALT_globalRNCID:
single_value.field_globalRNCID->encode_text(text_buf);
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
single_value.field_eNB__Identifier->encode_text(text_buf);
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
single_value.field_eHRPD__SectorID->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.RIM_Routing_Address.");
}
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.RIM_Routing_Address.");
}
}

void RIM__Routing__Address_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = RIM__Routing__Address::UNBOUND_VALUE;
RIM__Routing__Address::union_selection_type new_selection = (RIM__Routing__Address::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case RIM__Routing__Address::ALT_cell__Identifier:
single_value.field_cell__Identifier = new Cell__Identifier__V_template;
single_value.field_cell__Identifier->decode_text(text_buf);
break;
case RIM__Routing__Address::ALT_globalRNCID:
single_value.field_globalRNCID = new GlobalRNC__ID__BSSGP_template;
single_value.field_globalRNCID->decode_text(text_buf);
break;
case RIM__Routing__Address::ALT_eNB__Identifier:
single_value.field_eNB__Identifier = new ENB__Identifier__V_template;
single_value.field_eNB__Identifier->decode_text(text_buf);
break;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
single_value.field_eHRPD__SectorID = new OCTETSTRING_template;
single_value.field_eHRPD__SectorID->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.RIM_Routing_Address.");
}
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 RIM__Routing__Address_template[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.RIM_Routing_Address.");
}
}

boolean RIM__Routing__Address_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RIM__Routing__Address_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 RIM__Routing__Address_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.RIM_Routing_Address'");
    }
    if (strcmp("cell_Identifier", param_field) == 0) {
      cell__Identifier().set_param(param);
      return;
    } else if (strcmp("globalRNCID", param_field) == 0) {
      globalRNCID().set_param(param);
      return;
    } else if (strcmp("eNB_Identifier", param_field) == 0) {
      eNB__Identifier().set_param(param);
      return;
    } else if (strcmp("eHRPD_SectorID", param_field) == 0) {
      eHRPD__SectorID().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.RIM_Routing_Address'", 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: {
    RIM__Routing__Address_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.RIM_Routing_Address");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "cell_Identifier")) {
      cell__Identifier().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "globalRNCID")) {
      globalRNCID().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "eNB_Identifier")) {
      eNB__Identifier().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "eHRPD_SectorID")) {
      eHRPD__SectorID().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.RIM_Routing_Address.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    RIM__Routing__Address_template* precondition = new RIM__Routing__Address_template;
    precondition->set_param(*m_p->get_elem(0));
    RIM__Routing__Address_template* implied_template = new RIM__Routing__Address_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RIM__Routing__Address_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.RIM_Routing_Address");
  }
  is_ifpresent = param.get_ifpresent();
}

void RIM__Routing__Address_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 RIM__Routing__Address::ALT_cell__Identifier:
single_value.field_cell__Identifier->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Address");
return;
case RIM__Routing__Address::ALT_globalRNCID:
single_value.field_globalRNCID->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Address");
return;
case RIM__Routing__Address::ALT_eNB__Identifier:
single_value.field_eNB__Identifier->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Address");
return;
case RIM__Routing__Address::ALT_eHRPD__SectorID:
single_value.field_eHRPD__SectorID->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Address");
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.RIM_Routing_Address.");
}
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.RIM_Routing_Address");
}

GlobalRNC__ID__BSSGP::GlobalRNC__ID__BSSGP()
{
}

GlobalRNC__ID__BSSGP::GlobalRNC__ID__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_lac,
    const OCTETSTRING& par_rac,
    const HEXSTRING& par_spare,
    const INTEGER& par_rNC__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),
  field_lac(par_lac),
  field_rac(par_rac),
  field_spare(par_spare),
  field_rNC__ID(par_rNC__ID)
{
}

GlobalRNC__ID__BSSGP::GlobalRNC__ID__BSSGP(const GlobalRNC__ID__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.GlobalRNC_ID_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.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.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.rNC__ID().is_bound()) field_rNC__ID = other_value.rNC__ID();
else field_rNC__ID.clean_up();
}

void GlobalRNC__ID__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_lac.clean_up();
field_rac.clean_up();
field_spare.clean_up();
field_rNC__ID.clean_up();
}

const TTCN_Typedescriptor_t* GlobalRNC__ID__BSSGP::get_descriptor() const { return &GlobalRNC__ID__BSSGP_descr_; }
GlobalRNC__ID__BSSGP& GlobalRNC__ID__BSSGP::operator=(const GlobalRNC__ID__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.GlobalRNC_ID_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.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.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.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 GlobalRNC__ID__BSSGP::operator==(const GlobalRNC__ID__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_lac==other_value.field_lac
  && field_rac==other_value.field_rac
  && field_spare==other_value.field_spare
  && field_rNC__ID==other_value.field_rNC__ID;
}

boolean GlobalRNC__ID__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_lac.is_bound())
  || (field_rac.is_bound())
  || (field_spare.is_bound())
  || (field_rNC__ID.is_bound());
}
boolean GlobalRNC__ID__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_lac.is_value()
  && field_rac.is_value()
  && field_spare.is_value()
  && field_rNC__ID.is_value();
}
void GlobalRNC__ID__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(", lac := ");
field_lac.log();
TTCN_Logger::log_event_str(", rac := ");
field_rac.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", rNC_ID := ");
field_rNC__ID.log();
TTCN_Logger::log_event_str(" }");
}

void GlobalRNC__ID__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 (lac().is_bound()) lac().set_implicit_omit();
if (rac().is_bound()) rac().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (rNC__ID().is_bound()) rNC__ID().set_implicit_omit();
}

void GlobalRNC__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 (10<param.get_size()) {
      param.error("record value of type @BSSGP_Types.GlobalRNC_ID_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) 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) lac().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) rNC__ID().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(), "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(), "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(), "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.GlobalRNC_ID_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.GlobalRNC_ID_BSSGP");
  }
}

void GlobalRNC__ID__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_lac.encode_text(text_buf);
field_rac.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_rNC__ID.encode_text(text_buf);
}

void GlobalRNC__ID__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_lac.decode_text(text_buf);
field_rac.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_rNC__ID.decode_text(text_buf);
}

void GlobalRNC__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 GlobalRNC__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 GlobalRNC__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;
  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_lac.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());
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rac.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, GlobalRNC__ID__BSSGP_spare_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(GlobalRNC__ID__BSSGP_spare_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_9_force_omit(9, force_omit, GlobalRNC__ID__BSSGP_rNC__ID_descr_.raw->forceomit);
  decoded_field_length = field_rNC__ID.RAW_decode(GlobalRNC__ID__BSSGP_rNC__ID_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GlobalRNC__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 = 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::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);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, GlobalRNC__ID__BSSGP_spare_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, GlobalRNC__ID__BSSGP_rNC__ID_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_lac.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_rac.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_spare.RAW_encode(GlobalRNC__ID__BSSGP_spare_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_rNC__ID.RAW_encode(GlobalRNC__ID__BSSGP_rNC__ID_descr_, *myleaf.body.node.nodes[9]);
  return myleaf.length = encoded_length;
}

struct GlobalRNC__ID__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_lac;
OCTETSTRING_template field_rac;
HEXSTRING_template field_spare;
INTEGER_template field_rNC__ID;
};

void GlobalRNC__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_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_spare = ANY_VALUE;
single_value->field_rNC__ID = ANY_VALUE;
}
}
}

void GlobalRNC__ID__BSSGP_template::copy_value(const GlobalRNC__ID__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.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.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.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 GlobalRNC__ID__BSSGP_template::copy_template(const GlobalRNC__ID__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.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.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.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 GlobalRNC__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 GlobalRNC__ID__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new GlobalRNC__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.GlobalRNC_ID_BSSGP.");
break;
}
set_selection(other_value);
}

GlobalRNC__ID__BSSGP_template::GlobalRNC__ID__BSSGP_template()
{
}

GlobalRNC__ID__BSSGP_template::GlobalRNC__ID__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

GlobalRNC__ID__BSSGP_template::GlobalRNC__ID__BSSGP_template(const GlobalRNC__ID__BSSGP& other_value)
{
copy_value(other_value);
}

GlobalRNC__ID__BSSGP_template::GlobalRNC__ID__BSSGP_template(const OPTIONAL<GlobalRNC__ID__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GlobalRNC__ID__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.GlobalRNC_ID_BSSGP from an unbound optional field.");
}
}

GlobalRNC__ID__BSSGP_template::GlobalRNC__ID__BSSGP_template(GlobalRNC__ID__BSSGP_template* p_precondition, GlobalRNC__ID__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

GlobalRNC__ID__BSSGP_template::GlobalRNC__ID__BSSGP_template(Dynamic_Match_Interface<GlobalRNC__ID__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<GlobalRNC__ID__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

GlobalRNC__ID__BSSGP_template::GlobalRNC__ID__BSSGP_template(const GlobalRNC__ID__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

GlobalRNC__ID__BSSGP_template::~GlobalRNC__ID__BSSGP_template()
{
clean_up();
}

GlobalRNC__ID__BSSGP_template& GlobalRNC__ID__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

GlobalRNC__ID__BSSGP_template& GlobalRNC__ID__BSSGP_template::operator=(const GlobalRNC__ID__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

GlobalRNC__ID__BSSGP_template& GlobalRNC__ID__BSSGP_template::operator=(const OPTIONAL<GlobalRNC__ID__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GlobalRNC__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.GlobalRNC_ID_BSSGP.");
}
return *this;
}

GlobalRNC__ID__BSSGP_template& GlobalRNC__ID__BSSGP_template::operator=(const GlobalRNC__ID__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean GlobalRNC__ID__BSSGP_template::match(const GlobalRNC__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.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.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), 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.GlobalRNC_ID_BSSGP.");
}
return FALSE;
}

boolean GlobalRNC__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_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_spare.is_bound()
 || single_value->field_rNC__ID.is_bound();
}

boolean GlobalRNC__ID__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_lac.is_value()
 && single_value->field_rac.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_rNC__ID.is_value();
}

void GlobalRNC__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;
}

GlobalRNC__ID__BSSGP GlobalRNC__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.GlobalRNC_ID_BSSGP.");
GlobalRNC__ID__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_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_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_rNC__ID.is_bound()) {
ret_val.rNC__ID() = single_value->field_rNC__ID.valueof();
}
return ret_val;
}

void GlobalRNC__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.GlobalRNC_ID_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GlobalRNC__ID__BSSGP_template[list_length];
}

GlobalRNC__ID__BSSGP_template& GlobalRNC__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.GlobalRNC_ID_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return value_list.list_value[list_index];
}

HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& GlobalRNC__ID__BSSGP_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_mncDigit2;
}

OCTETSTRING_template& GlobalRNC__ID__BSSGP_template::lac()
{
set_specific();
return single_value->field_lac;
}

const OCTETSTRING_template& GlobalRNC__ID__BSSGP_template::lac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lac of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_lac;
}

OCTETSTRING_template& GlobalRNC__ID__BSSGP_template::rac()
{
set_specific();
return single_value->field_rac;
}

const OCTETSTRING_template& GlobalRNC__ID__BSSGP_template::rac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rac of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_rac;
}

HEXSTRING_template& GlobalRNC__ID__BSSGP_template::spare()
{
set_specific();
return single_value->field_spare;
}

const HEXSTRING_template& GlobalRNC__ID__BSSGP_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
return single_value->field_spare;
}

INTEGER_template& GlobalRNC__ID__BSSGP_template::rNC__ID()
{
set_specific();
return single_value->field_rNC__ID;
}

const INTEGER_template& GlobalRNC__ID__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.GlobalRNC_ID_BSSGP.");
return single_value->field_rNC__ID;
}

int GlobalRNC__ID__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GlobalRNC_ID_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.GlobalRNC_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.GlobalRNC_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.GlobalRNC_ID_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GlobalRNC_ID_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GlobalRNC_ID_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GlobalRNC_ID_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GlobalRNC_ID_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GlobalRNC_ID_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.GlobalRNC_ID_BSSGP.");
  }
  return 0;
}

void GlobalRNC__ID__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(", lac := ");
single_value->field_lac.log();
TTCN_Logger::log_event_str(", rac := ");
single_value->field_rac.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.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 GlobalRNC__ID__BSSGP_template::log_match(const GlobalRNC__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_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_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_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("{ 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(", spare := ");
single_value->field_spare.log_match(match_value.spare(), 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 GlobalRNC__ID__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_lac.encode_text(text_buf);
single_value->field_rac.encode_text(text_buf);
single_value->field_spare.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.GlobalRNC_ID_BSSGP.");
}
}

void GlobalRNC__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_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_spare.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 GlobalRNC__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.GlobalRNC_ID_BSSGP.");
}
}

void GlobalRNC__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: {
    GlobalRNC__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 (10<param.get_size()) {
      param.error("record template of type @BSSGP_Types.GlobalRNC_ID_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) 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) lac().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) rNC__ID().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(), "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(), "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(), "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.GlobalRNC_ID_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    GlobalRNC__ID__BSSGP_template* precondition = new GlobalRNC__ID__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    GlobalRNC__ID__BSSGP_template* implied_template = new GlobalRNC__ID__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GlobalRNC__ID__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.GlobalRNC_ID_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void GlobalRNC__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_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_lac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_rac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_ID_BSSGP");
single_value->field_rNC__ID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GlobalRNC_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.GlobalRNC_ID_BSSGP");
}

boolean GlobalRNC__ID__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean GlobalRNC__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;
}

ENB__Identifier__V::ENB__Identifier__V()
{
}

ENB__Identifier__V::ENB__Identifier__V(const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2,
    const OCTETSTRING& par_tac,
    const OCTETSTRING& par_globaleNBID)
  :   field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2),
  field_tac(par_tac),
  field_globaleNBID(par_globaleNBID)
{
}

ENB__Identifier__V::ENB__Identifier__V(const ENB__Identifier__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.ENB_Identifier_V.");
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
if (other_value.tac().is_bound()) field_tac = other_value.tac();
else field_tac.clean_up();
if (other_value.globaleNBID().is_bound()) field_globaleNBID = other_value.globaleNBID();
else field_globaleNBID.clean_up();
}

void ENB__Identifier__V::clean_up()
{
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
field_tac.clean_up();
field_globaleNBID.clean_up();
}

const TTCN_Typedescriptor_t* ENB__Identifier__V::get_descriptor() const { return &ENB__Identifier__V_descr_; }
ENB__Identifier__V& ENB__Identifier__V::operator=(const ENB__Identifier__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.ENB_Identifier_V.");
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
  if (other_value.tac().is_bound()) field_tac = other_value.tac();
  else field_tac.clean_up();
  if (other_value.globaleNBID().is_bound()) field_globaleNBID = other_value.globaleNBID();
  else field_globaleNBID.clean_up();
}
return *this;
}

boolean ENB__Identifier__V::operator==(const ENB__Identifier__V& 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
  && field_globaleNBID==other_value.field_globaleNBID;
}

boolean ENB__Identifier__V::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())
  || (field_globaleNBID.is_bound());
}
boolean ENB__Identifier__V::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()
  && field_globaleNBID.is_value();
}
void ENB__Identifier__V::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(", globaleNBID := ");
field_globaleNBID.log();
TTCN_Logger::log_event_str(" }");
}

void ENB__Identifier__V::set_implicit_omit()
{
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
if (tac().is_bound()) tac().set_implicit_omit();
if (globaleNBID().is_bound()) globaleNBID().set_implicit_omit();
}

void ENB__Identifier__V::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @BSSGP_Types.ENB_Identifier_V 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) tac().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) globaleNBID().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(), "tac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globaleNBID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globaleNBID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.ENB_Identifier_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.ENB_Identifier_V");
  }
}

void ENB__Identifier__V::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);
field_globaleNBID.encode_text(text_buf);
}

void ENB__Identifier__V::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);
field_globaleNBID.decode_text(text_buf);
}

void ENB__Identifier__V::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ENB__Identifier__V::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ENB__Identifier__V::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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());
  RAW_Force_Omit field_7_force_omit(7, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_globaleNBID.RAW_decode(OCTETSTRING_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 ENB__Identifier__V::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, OCTETSTRING_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]);
  encoded_length += field_globaleNBID.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct ENB__Identifier__V_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;
OCTETSTRING_template field_globaleNBID;
};

void ENB__Identifier__V_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
single_value->field_tac = ANY_VALUE;
single_value->field_globaleNBID = ANY_VALUE;
}
}
}

void ENB__Identifier__V_template::copy_value(const ENB__Identifier__V& 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();
}
if (other_value.globaleNBID().is_bound()) {
  single_value->field_globaleNBID = other_value.globaleNBID();
} else {
  single_value->field_globaleNBID.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ENB__Identifier__V_template::copy_template(const ENB__Identifier__V_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();
}
if (UNINITIALIZED_TEMPLATE != other_value.globaleNBID().get_selection()) {
single_value->field_globaleNBID = other_value.globaleNBID();
} else {
single_value->field_globaleNBID.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ENB__Identifier__V_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new ENB__Identifier__V_template(*other_value.implication_.precondition);
implication_.implied_template = new ENB__Identifier__V_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.ENB_Identifier_V.");
break;
}
set_selection(other_value);
}

ENB__Identifier__V_template::ENB__Identifier__V_template()
{
}

ENB__Identifier__V_template::ENB__Identifier__V_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

ENB__Identifier__V_template::ENB__Identifier__V_template(const ENB__Identifier__V& other_value)
{
copy_value(other_value);
}

ENB__Identifier__V_template::ENB__Identifier__V_template(const OPTIONAL<ENB__Identifier__V>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ENB__Identifier__V&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.ENB_Identifier_V from an unbound optional field.");
}
}

ENB__Identifier__V_template::ENB__Identifier__V_template(ENB__Identifier__V_template* p_precondition, ENB__Identifier__V_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

ENB__Identifier__V_template::ENB__Identifier__V_template(Dynamic_Match_Interface<ENB__Identifier__V>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<ENB__Identifier__V>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

ENB__Identifier__V_template::ENB__Identifier__V_template(const ENB__Identifier__V_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

ENB__Identifier__V_template::~ENB__Identifier__V_template()
{
clean_up();
}

ENB__Identifier__V_template& ENB__Identifier__V_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

ENB__Identifier__V_template& ENB__Identifier__V_template::operator=(const ENB__Identifier__V& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ENB__Identifier__V_template& ENB__Identifier__V_template::operator=(const OPTIONAL<ENB__Identifier__V>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ENB__Identifier__V&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.ENB_Identifier_V.");
}
return *this;
}

ENB__Identifier__V_template& ENB__Identifier__V_template::operator=(const ENB__Identifier__V_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean ENB__Identifier__V_template::match(const ENB__Identifier__V& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), legacy))return FALSE;
if(!other_value.tac().is_bound()) return FALSE;
if(!single_value->field_tac.match(other_value.tac(), legacy))return FALSE;
if(!other_value.globaleNBID().is_bound()) return FALSE;
if(!single_value->field_globaleNBID.match(other_value.globaleNBID(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.ENB_Identifier_V.");
}
return FALSE;
}

boolean ENB__Identifier__V_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_mccDigit1.is_bound()
 || single_value->field_mccDigit2.is_bound()
 || single_value->field_mccDigit3.is_bound()
 || single_value->field_mncDigit3.is_bound()
 || single_value->field_mncDigit1.is_bound()
 || single_value->field_mncDigit2.is_bound()
 || single_value->field_tac.is_bound()
 || single_value->field_globaleNBID.is_bound();
}

boolean ENB__Identifier__V_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()
 && single_value->field_globaleNBID.is_value();
}

void ENB__Identifier__V_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

ENB__Identifier__V ENB__Identifier__V_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
ENB__Identifier__V 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();
}
if (single_value->field_globaleNBID.is_bound()) {
ret_val.globaleNBID() = single_value->field_globaleNBID.valueof();
}
return ret_val;
}

void ENB__Identifier__V_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.ENB_Identifier_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ENB__Identifier__V_template[list_length];
}

ENB__Identifier__V_template& ENB__Identifier__V_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.ENB_Identifier_V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.ENB_Identifier_V.");
return value_list.list_value[list_index];
}

HEXSTRING_template& ENB__Identifier__V_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& ENB__Identifier__V_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& ENB__Identifier__V_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& ENB__Identifier__V_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& ENB__Identifier__V_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& ENB__Identifier__V_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& ENB__Identifier__V_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& ENB__Identifier__V_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& ENB__Identifier__V_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& ENB__Identifier__V_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& ENB__Identifier__V_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& ENB__Identifier__V_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_mncDigit2;
}

OCTETSTRING_template& ENB__Identifier__V_template::tac()
{
set_specific();
return single_value->field_tac;
}

const OCTETSTRING_template& ENB__Identifier__V_template::tac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tac of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_tac;
}

OCTETSTRING_template& ENB__Identifier__V_template::globaleNBID()
{
set_specific();
return single_value->field_globaleNBID;
}

const OCTETSTRING_template& ENB__Identifier__V_template::globaleNBID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globaleNBID of a non-specific template of type @BSSGP_Types.ENB_Identifier_V.");
return single_value->field_globaleNBID;
}

int ENB__Identifier__V_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V 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.ENB_Identifier_V containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ENB_Identifier_V containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.ENB_Identifier_V.");
  }
  return 0;
}

void ENB__Identifier__V_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(", globaleNBID := ");
single_value->field_globaleNBID.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void ENB__Identifier__V_template::log_match(const ENB__Identifier__V& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tac.match(match_value.tac(), legacy)){
TTCN_Logger::log_logmatch_info(".tac");
single_value->field_tac.log_match(match_value.tac(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_globaleNBID.match(match_value.globaleNBID(), legacy)){
TTCN_Logger::log_logmatch_info(".globaleNBID");
single_value->field_globaleNBID.log_match(match_value.globaleNBID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::log_event_str(", tac := ");
single_value->field_tac.log_match(match_value.tac(), legacy);
TTCN_Logger::log_event_str(", globaleNBID := ");
single_value->field_globaleNBID.log_match(match_value.globaleNBID(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ENB__Identifier__V_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);
single_value->field_globaleNBID.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.ENB_Identifier_V.");
}
}

void ENB__Identifier__V_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.decode_text(text_buf);
single_value->field_tac.decode_text(text_buf);
single_value->field_globaleNBID.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ENB__Identifier__V_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.ENB_Identifier_V.");
}
}

void ENB__Identifier__V_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ENB__Identifier__V_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @BSSGP_Types.ENB_Identifier_V 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) tac().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) globaleNBID().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(), "tac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globaleNBID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globaleNBID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.ENB_Identifier_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ENB__Identifier__V_template* precondition = new ENB__Identifier__V_template;
    precondition->set_param(*param.get_elem(0));
    ENB__Identifier__V_template* implied_template = new ENB__Identifier__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ENB__Identifier__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.ENB_Identifier_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void ENB__Identifier__V_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
single_value->field_tac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
single_value->field_globaleNBID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.ENB_Identifier_V");
}

boolean ENB__Identifier__V_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean ENB__Identifier__V_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

RIM__Routing__Information::RIM__Routing__Information()
{
}

RIM__Routing__Information::RIM__Routing__Information(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_rIMRoutingAddressDiscriminator,
    const HEXSTRING& par_spare,
    const RIM__Routing__Address& par_rIM__Routing__Address)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_rIMRoutingAddressDiscriminator(par_rIMRoutingAddressDiscriminator),
  field_spare(par_spare),
  field_rIM__Routing__Address(par_rIM__Routing__Address)
{
}

RIM__Routing__Information::RIM__Routing__Information(const RIM__Routing__Information& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RIM_Routing_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.rIMRoutingAddressDiscriminator().is_bound()) field_rIMRoutingAddressDiscriminator = other_value.rIMRoutingAddressDiscriminator();
else field_rIMRoutingAddressDiscriminator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.rIM__Routing__Address().is_bound()) field_rIM__Routing__Address = other_value.rIM__Routing__Address();
else field_rIM__Routing__Address.clean_up();
}

void RIM__Routing__Information::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_rIMRoutingAddressDiscriminator.clean_up();
field_spare.clean_up();
field_rIM__Routing__Address.clean_up();
}

const TTCN_Typedescriptor_t* RIM__Routing__Information::get_descriptor() const { return &RIM__Routing__Information_descr_; }
RIM__Routing__Information& RIM__Routing__Information::operator=(const RIM__Routing__Information& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RIM_Routing_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.rIMRoutingAddressDiscriminator().is_bound()) field_rIMRoutingAddressDiscriminator = other_value.rIMRoutingAddressDiscriminator();
  else field_rIMRoutingAddressDiscriminator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.rIM__Routing__Address().is_bound()) field_rIM__Routing__Address = other_value.rIM__Routing__Address();
  else field_rIM__Routing__Address.clean_up();
}
return *this;
}

boolean RIM__Routing__Information::operator==(const RIM__Routing__Information& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_rIMRoutingAddressDiscriminator==other_value.field_rIMRoutingAddressDiscriminator
  && field_spare==other_value.field_spare
  && field_rIM__Routing__Address==other_value.field_rIM__Routing__Address;
}

boolean RIM__Routing__Information::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_rIMRoutingAddressDiscriminator.is_bound())
  || (field_spare.is_bound())
  || (field_rIM__Routing__Address.is_bound());
}
boolean RIM__Routing__Information::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_rIMRoutingAddressDiscriminator.is_value()
  && field_spare.is_value()
  && field_rIM__Routing__Address.is_value();
}
void RIM__Routing__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(", rIMRoutingAddressDiscriminator := ");
field_rIMRoutingAddressDiscriminator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", rIM_Routing_Address := ");
field_rIM__Routing__Address.log();
TTCN_Logger::log_event_str(" }");
}

void RIM__Routing__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 (rIMRoutingAddressDiscriminator().is_bound()) rIMRoutingAddressDiscriminator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (rIM__Routing__Address().is_bound()) rIM__Routing__Address().set_implicit_omit();
}

void RIM__Routing__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 (6<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RIM_Routing_Information 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) rIMRoutingAddressDiscriminator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__Routing__Address().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(), "rIMRoutingAddressDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIMRoutingAddressDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "rIM_Routing_Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Routing__Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RIM_Routing_Information: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RIM_Routing_Information");
  }
}

void RIM__Routing__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_rIMRoutingAddressDiscriminator.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_rIM__Routing__Address.encode_text(text_buf);
}

void RIM__Routing__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_rIMRoutingAddressDiscriminator.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_rIM__Routing__Address.decode_text(text_buf);
}

void RIM__Routing__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 RIM__Routing__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 RIM__Routing__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, RIM__Routing__Information_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RIM__Routing__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, RIM__Routing__Information_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RIM__Routing__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::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_rIMRoutingAddressDiscriminator.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_rIMRoutingAddressDiscriminator ==  hs_0) selected_field = 0;
  else if (field_rIMRoutingAddressDiscriminator ==  hs_1) selected_field = 1;
  else if (field_rIMRoutingAddressDiscriminator ==  hs_2) selected_field = 2;
  else if (field_rIMRoutingAddressDiscriminator ==  hs_3) selected_field = 3;
  else selected_field = -1;
  RAW_Force_Omit field_5_force_omit(5, force_omit, RIM__Routing__Information_rIM__Routing__Address_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Routing__Address.RAW_decode(RIM__Routing__Information_rIM__Routing__Address_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, selected_field, 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_79) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RIM__Routing__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 = 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, RIM__Routing__Information_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RIM__Routing__Information_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, RIM__Routing__Information_rIM__Routing__Address_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RIM__Routing__Information_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RIM__Routing__Information_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rIMRoutingAddressDiscriminator.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]);
  encoded_length += field_rIM__Routing__Address.RAW_encode(RIM__Routing__Information_rIM__Routing__Address_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(RIM__Routing__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(RIM__Routing__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:;
  }
  switch (field_rIM__Routing__Address.get_selection()) {
  case RIM__Routing__Address::ALT_cell__Identifier:
  if (field_rIMRoutingAddressDiscriminator !=  hs_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)
     hs_0.RAW_encode(General__Types::HEX1_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 RIM__Routing__Address::ALT_globalRNCID:
  if (field_rIMRoutingAddressDiscriminator !=  hs_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)
     hs_1.RAW_encode(General__Types::HEX1_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 RIM__Routing__Address::ALT_eNB__Identifier:
  if (field_rIMRoutingAddressDiscriminator !=  hs_2) {
  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)
     hs_2.RAW_encode(General__Types::HEX1_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 RIM__Routing__Address::ALT_eHRPD__SectorID:
  if (field_rIMRoutingAddressDiscriminator !=  hs_3) {
  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)
     hs_3.RAW_encode(General__Types::HEX1_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_79) {
  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_79.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 RIM__Routing__Information_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_rIMRoutingAddressDiscriminator;
HEXSTRING_template field_spare;
RIM__Routing__Address_template field_rIM__Routing__Address;
};

void RIM__Routing__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_rIMRoutingAddressDiscriminator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_rIM__Routing__Address = ANY_VALUE;
}
}
}

void RIM__Routing__Information_template::copy_value(const RIM__Routing__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.rIMRoutingAddressDiscriminator().is_bound()) {
  single_value->field_rIMRoutingAddressDiscriminator = other_value.rIMRoutingAddressDiscriminator();
} else {
  single_value->field_rIMRoutingAddressDiscriminator.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.rIM__Routing__Address().is_bound()) {
  single_value->field_rIM__Routing__Address = other_value.rIM__Routing__Address();
} else {
  single_value->field_rIM__Routing__Address.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RIM__Routing__Information_template::copy_template(const RIM__Routing__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.rIMRoutingAddressDiscriminator().get_selection()) {
single_value->field_rIMRoutingAddressDiscriminator = other_value.rIMRoutingAddressDiscriminator();
} else {
single_value->field_rIMRoutingAddressDiscriminator.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.rIM__Routing__Address().get_selection()) {
single_value->field_rIM__Routing__Address = other_value.rIM__Routing__Address();
} else {
single_value->field_rIM__Routing__Address.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 RIM__Routing__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 RIM__Routing__Information_template(*other_value.implication_.precondition);
implication_.implied_template = new RIM__Routing__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.RIM_Routing_Information.");
break;
}
set_selection(other_value);
}

RIM__Routing__Information_template::RIM__Routing__Information_template()
{
}

RIM__Routing__Information_template::RIM__Routing__Information_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RIM__Routing__Information_template::RIM__Routing__Information_template(const RIM__Routing__Information& other_value)
{
copy_value(other_value);
}

RIM__Routing__Information_template::RIM__Routing__Information_template(const OPTIONAL<RIM__Routing__Information>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RIM__Routing__Information&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.RIM_Routing_Information from an unbound optional field.");
}
}

RIM__Routing__Information_template::RIM__Routing__Information_template(RIM__Routing__Information_template* p_precondition, RIM__Routing__Information_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RIM__Routing__Information_template::RIM__Routing__Information_template(Dynamic_Match_Interface<RIM__Routing__Information>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RIM__Routing__Information>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RIM__Routing__Information_template::RIM__Routing__Information_template(const RIM__Routing__Information_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RIM__Routing__Information_template::~RIM__Routing__Information_template()
{
clean_up();
}

RIM__Routing__Information_template& RIM__Routing__Information_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RIM__Routing__Information_template& RIM__Routing__Information_template::operator=(const RIM__Routing__Information& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RIM__Routing__Information_template& RIM__Routing__Information_template::operator=(const OPTIONAL<RIM__Routing__Information>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RIM__Routing__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.RIM_Routing_Information.");
}
return *this;
}

RIM__Routing__Information_template& RIM__Routing__Information_template::operator=(const RIM__Routing__Information_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RIM__Routing__Information_template::match(const RIM__Routing__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.rIMRoutingAddressDiscriminator().is_bound()) return FALSE;
if(!single_value->field_rIMRoutingAddressDiscriminator.match(other_value.rIMRoutingAddressDiscriminator(), 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.rIM__Routing__Address().is_bound()) return FALSE;
if(!single_value->field_rIM__Routing__Address.match(other_value.rIM__Routing__Address(), 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.RIM_Routing_Information.");
}
return FALSE;
}

boolean RIM__Routing__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_rIMRoutingAddressDiscriminator.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_rIM__Routing__Address.is_bound();
}

boolean RIM__Routing__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_rIMRoutingAddressDiscriminator.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_rIM__Routing__Address.is_value();
}

void RIM__Routing__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;
}

RIM__Routing__Information RIM__Routing__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.RIM_Routing_Information.");
RIM__Routing__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_rIMRoutingAddressDiscriminator.is_bound()) {
ret_val.rIMRoutingAddressDiscriminator() = single_value->field_rIMRoutingAddressDiscriminator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_rIM__Routing__Address.is_bound()) {
ret_val.rIM__Routing__Address() = single_value->field_rIM__Routing__Address.valueof();
}
return ret_val;
}

void RIM__Routing__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.RIM_Routing_Information.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RIM__Routing__Information_template[list_length];
}

RIM__Routing__Information_template& RIM__Routing__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.RIM_Routing_Information.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.RIM_Routing_Information.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& RIM__Routing__Information_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& RIM__Routing__Information_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.RIM_Routing_Information.");
return single_value->field_iEI;
}

BITSTRING_template& RIM__Routing__Information_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& RIM__Routing__Information_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.RIM_Routing_Information.");
return single_value->field_ext;
}

LIN2__2a_template& RIM__Routing__Information_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& RIM__Routing__Information_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.RIM_Routing_Information.");
return single_value->field_lengthIndicator;
}

HEXSTRING_template& RIM__Routing__Information_template::rIMRoutingAddressDiscriminator()
{
set_specific();
return single_value->field_rIMRoutingAddressDiscriminator;
}

const HEXSTRING_template& RIM__Routing__Information_template::rIMRoutingAddressDiscriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIMRoutingAddressDiscriminator of a non-specific template of type @BSSGP_Types.RIM_Routing_Information.");
return single_value->field_rIMRoutingAddressDiscriminator;
}

HEXSTRING_template& RIM__Routing__Information_template::spare()
{
set_specific();
return single_value->field_spare;
}

const HEXSTRING_template& RIM__Routing__Information_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.RIM_Routing_Information.");
return single_value->field_spare;
}

RIM__Routing__Address_template& RIM__Routing__Information_template::rIM__Routing__Address()
{
set_specific();
return single_value->field_rIM__Routing__Address;
}

const RIM__Routing__Address_template& RIM__Routing__Information_template::rIM__Routing__Address() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Routing_Address of a non-specific template of type @BSSGP_Types.RIM_Routing_Information.");
return single_value->field_rIM__Routing__Address;
}

int RIM__Routing__Information_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RIM_Routing_Information 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.RIM_Routing_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.RIM_Routing_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.RIM_Routing_Information containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RIM_Routing_Information containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RIM_Routing_Information containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RIM_Routing_Information containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RIM_Routing_Information containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RIM_Routing_Information containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.RIM_Routing_Information.");
  }
  return 0;
}

void RIM__Routing__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(", rIMRoutingAddressDiscriminator := ");
single_value->field_rIMRoutingAddressDiscriminator.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", rIM_Routing_Address := ");
single_value->field_rIM__Routing__Address.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 RIM__Routing__Information_template::log_match(const RIM__Routing__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_rIMRoutingAddressDiscriminator.match(match_value.rIMRoutingAddressDiscriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".rIMRoutingAddressDiscriminator");
single_value->field_rIMRoutingAddressDiscriminator.log_match(match_value.rIMRoutingAddressDiscriminator(), 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_rIM__Routing__Address.match(match_value.rIM__Routing__Address(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Routing_Address");
single_value->field_rIM__Routing__Address.log_match(match_value.rIM__Routing__Address(), 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(", rIMRoutingAddressDiscriminator := ");
single_value->field_rIMRoutingAddressDiscriminator.log_match(match_value.rIMRoutingAddressDiscriminator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", rIM_Routing_Address := ");
single_value->field_rIM__Routing__Address.log_match(match_value.rIM__Routing__Address(), 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 RIM__Routing__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_rIMRoutingAddressDiscriminator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_rIM__Routing__Address.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.RIM_Routing_Information.");
}
}

void RIM__Routing__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_rIMRoutingAddressDiscriminator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_rIM__Routing__Address.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 RIM__Routing__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.RIM_Routing_Information.");
}
}

void RIM__Routing__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: {
    RIM__Routing__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 (6<param.get_size()) {
      param.error("record template of type @BSSGP_Types.RIM_Routing_Information 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) rIMRoutingAddressDiscriminator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rIM__Routing__Address().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(), "rIMRoutingAddressDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIMRoutingAddressDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "rIM_Routing_Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__Routing__Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.RIM_Routing_Information: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RIM__Routing__Information_template* precondition = new RIM__Routing__Information_template;
    precondition->set_param(*param.get_elem(0));
    RIM__Routing__Information_template* implied_template = new RIM__Routing__Information_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RIM__Routing__Information_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RIM_Routing_Information");
  }
  is_ifpresent = param.get_ifpresent();
}

void RIM__Routing__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.RIM_Routing_Information");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Information");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Information");
single_value->field_rIMRoutingAddressDiscriminator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Information");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_Information");
single_value->field_rIM__Routing__Address.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RIM_Routing_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.RIM_Routing_Information");
}

boolean RIM__Routing__Information_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RIM__Routing__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;
}

MBMS__Session__Identity::MBMS__Session__Identity()
{
}

MBMS__Session__Identity::MBMS__Session__Identity(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_mBMS__Session__Identifier__Value)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mBMS__Session__Identifier__Value(par_mBMS__Session__Identifier__Value)
{
}

MBMS__Session__Identity::MBMS__Session__Identity(const MBMS__Session__Identity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Session_Identity.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mBMS__Session__Identifier__Value().is_bound()) field_mBMS__Session__Identifier__Value = other_value.mBMS__Session__Identifier__Value();
else field_mBMS__Session__Identifier__Value.clean_up();
}

void MBMS__Session__Identity::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mBMS__Session__Identifier__Value.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__Session__Identity::get_descriptor() const { return &MBMS__Session__Identity_descr_; }
MBMS__Session__Identity& MBMS__Session__Identity::operator=(const MBMS__Session__Identity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Session_Identity.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mBMS__Session__Identifier__Value().is_bound()) field_mBMS__Session__Identifier__Value = other_value.mBMS__Session__Identifier__Value();
  else field_mBMS__Session__Identifier__Value.clean_up();
}
return *this;
}

boolean MBMS__Session__Identity::operator==(const MBMS__Session__Identity& 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__Identifier__Value==other_value.field_mBMS__Session__Identifier__Value;
}

boolean MBMS__Session__Identity::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mBMS__Session__Identifier__Value.is_bound());
}
boolean MBMS__Session__Identity::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mBMS__Session__Identifier__Value.is_value();
}
void MBMS__Session__Identity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mBMS_Session_Identifier_Value := ");
field_mBMS__Session__Identifier__Value.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Session__Identity::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mBMS__Session__Identifier__Value().is_bound()) mBMS__Session__Identifier__Value().set_implicit_omit();
}

void MBMS__Session__Identity::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.MBMS_Session_Identity 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__Identifier__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_Identifier_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Identifier__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_Identity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.MBMS_Session_Identity");
  }
}

void MBMS__Session__Identity::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mBMS__Session__Identifier__Value.encode_text(text_buf);
}

void MBMS__Session__Identity::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mBMS__Session__Identifier__Value.decode_text(text_buf);
}

void MBMS__Session__Identity::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MBMS__Session__Identity::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MBMS__Session__Identity::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MBMS__Session__Identity_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Session__Identity_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, MBMS__Session__Identity_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Session__Identity_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__Session__Identifier__Value.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_29) 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__Identity::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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__Identity_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Session__Identity_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(MBMS__Session__Identity_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Session__Identity_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mBMS__Session__Identifier__Value.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(MBMS__Session__Identity_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(MBMS__Session__Identity_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_29) {
  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_29.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Session__Identity_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_mBMS__Session__Identifier__Value;
};

void MBMS__Session__Identity_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mBMS__Session__Identifier__Value = ANY_VALUE;
}
}
}

void MBMS__Session__Identity_template::copy_value(const MBMS__Session__Identity& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mBMS__Session__Identifier__Value().is_bound()) {
  single_value->field_mBMS__Session__Identifier__Value = other_value.mBMS__Session__Identifier__Value();
} else {
  single_value->field_mBMS__Session__Identifier__Value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__Session__Identity_template::copy_template(const MBMS__Session__Identity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__Session__Identifier__Value().get_selection()) {
single_value->field_mBMS__Session__Identifier__Value = other_value.mBMS__Session__Identifier__Value();
} else {
single_value->field_mBMS__Session__Identifier__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__Identity_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Session__Identity_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Session__Identity_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.MBMS_Session_Identity.");
break;
}
set_selection(other_value);
}

MBMS__Session__Identity_template::MBMS__Session__Identity_template()
{
}

MBMS__Session__Identity_template::MBMS__Session__Identity_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

MBMS__Session__Identity_template::MBMS__Session__Identity_template(const MBMS__Session__Identity& other_value)
{
copy_value(other_value);
}

MBMS__Session__Identity_template::MBMS__Session__Identity_template(const OPTIONAL<MBMS__Session__Identity>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MBMS__Session__Identity&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.MBMS_Session_Identity from an unbound optional field.");
}
}

MBMS__Session__Identity_template::MBMS__Session__Identity_template(MBMS__Session__Identity_template* p_precondition, MBMS__Session__Identity_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

MBMS__Session__Identity_template::MBMS__Session__Identity_template(Dynamic_Match_Interface<MBMS__Session__Identity>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<MBMS__Session__Identity>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

MBMS__Session__Identity_template::MBMS__Session__Identity_template(const MBMS__Session__Identity_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

MBMS__Session__Identity_template::~MBMS__Session__Identity_template()
{
clean_up();
}

MBMS__Session__Identity_template& MBMS__Session__Identity_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

MBMS__Session__Identity_template& MBMS__Session__Identity_template::operator=(const MBMS__Session__Identity& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MBMS__Session__Identity_template& MBMS__Session__Identity_template::operator=(const OPTIONAL<MBMS__Session__Identity>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MBMS__Session__Identity&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.MBMS_Session_Identity.");
}
return *this;
}

MBMS__Session__Identity_template& MBMS__Session__Identity_template::operator=(const MBMS__Session__Identity_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean MBMS__Session__Identity_template::match(const MBMS__Session__Identity& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.mBMS__Session__Identifier__Value().is_bound()) return FALSE;
if(!single_value->field_mBMS__Session__Identifier__Value.match(other_value.mBMS__Session__Identifier__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_Identity.");
}
return FALSE;
}

boolean MBMS__Session__Identity_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_mBMS__Session__Identifier__Value.is_bound();
}

boolean MBMS__Session__Identity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_mBMS__Session__Identifier__Value.is_value();
}

void MBMS__Session__Identity_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

MBMS__Session__Identity MBMS__Session__Identity_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.MBMS_Session_Identity.");
MBMS__Session__Identity ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mBMS__Session__Identifier__Value.is_bound()) {
ret_val.mBMS__Session__Identifier__Value() = single_value->field_mBMS__Session__Identifier__Value.valueof();
}
return ret_val;
}

void MBMS__Session__Identity_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.MBMS_Session_Identity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MBMS__Session__Identity_template[list_length];
}

MBMS__Session__Identity_template& MBMS__Session__Identity_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.MBMS_Session_Identity.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MBMS_Session_Identity.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& MBMS__Session__Identity_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& MBMS__Session__Identity_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.MBMS_Session_Identity.");
return single_value->field_iEI;
}

BITSTRING_template& MBMS__Session__Identity_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& MBMS__Session__Identity_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.MBMS_Session_Identity.");
return single_value->field_ext;
}

LIN2__2a_template& MBMS__Session__Identity_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& MBMS__Session__Identity_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.MBMS_Session_Identity.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& MBMS__Session__Identity_template::mBMS__Session__Identifier__Value()
{
set_specific();
return single_value->field_mBMS__Session__Identifier__Value;
}

const OCTETSTRING_template& MBMS__Session__Identity_template::mBMS__Session__Identifier__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Session_Identifier_Value of a non-specific template of type @BSSGP_Types.MBMS_Session_Identity.");
return single_value->field_mBMS__Session__Identifier__Value;
}

int MBMS__Session__Identity_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity 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_Identity containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Identity containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MBMS_Session_Identity.");
  }
  return 0;
}

void MBMS__Session__Identity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mBMS_Session_Identifier_Value := ");
single_value->field_mBMS__Session__Identifier__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__Identity_template::log_match(const MBMS__Session__Identity& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS__Session__Identifier__Value.match(match_value.mBMS__Session__Identifier__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Session_Identifier_Value");
single_value->field_mBMS__Session__Identifier__Value.log_match(match_value.mBMS__Session__Identifier__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_Identifier_Value := ");
single_value->field_mBMS__Session__Identifier__Value.log_match(match_value.mBMS__Session__Identifier__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__Identity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mBMS__Session__Identifier__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_Identity.");
}
}

void MBMS__Session__Identity_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mBMS__Session__Identifier__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__Identity_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.MBMS_Session_Identity.");
}
}

void MBMS__Session__Identity_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Session__Identity_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.MBMS_Session_Identity 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__Identifier__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_Identifier_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Identifier__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_Identity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Session__Identity_template* precondition = new MBMS__Session__Identity_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Session__Identity_template* implied_template = new MBMS__Session__Identity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Session__Identity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Session_Identity");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMS__Session__Identity_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Identity");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Identity");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Identity");
single_value->field_mBMS__Session__Identifier__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Identity");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.MBMS_Session_Identity");
}

boolean MBMS__Session__Identity_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean MBMS__Session__Identity_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


} /* end of namespace */
