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

PDU__BSSGP__RESUME__NACK::PDU__BSSGP__RESUME__NACK()
{
}

PDU__BSSGP__RESUME__NACK::PDU__BSSGP__RESUME__NACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Routeing__Area& par_routeing__Area,
    const OPTIONAL< Cause__BSSGP >& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_routeing__Area(par_routeing__Area),
  field_cause(par_cause)
{
}

PDU__BSSGP__RESUME__NACK::PDU__BSSGP__RESUME__NACK(const PDU__BSSGP__RESUME__NACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
else field_routeing__Area.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__RESUME__NACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_routeing__Area.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RESUME__NACK::get_descriptor() const { return &PDU__BSSGP__RESUME__NACK_descr_; }
PDU__BSSGP__RESUME__NACK& PDU__BSSGP__RESUME__NACK::operator=(const PDU__BSSGP__RESUME__NACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
  else field_routeing__Area.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RESUME__NACK::operator==(const PDU__BSSGP__RESUME__NACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_routeing__Area==other_value.field_routeing__Area
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__RESUME__NACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routeing__Area.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound());
}
boolean PDU__BSSGP__RESUME__NACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_routeing__Area.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value());
}
int PDU__BSSGP__RESUME__NACK::size_of() const
{
  int ret_val = 3;
  if (field_cause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__RESUME__NACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
field_routeing__Area.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RESUME__NACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routeing__Area().is_bound()) routeing__Area().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
}

void PDU__BSSGP__RESUME__NACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RESUME_NACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RESUME_NACK");
  }
}

void PDU__BSSGP__RESUME__NACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_routeing__Area.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__RESUME__NACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_routeing__Area.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

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

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

int PDU__BSSGP__RESUME__NACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Routeing__Area_descr_.raw->forceomit);
  decoded_field_length = field_routeing__Area.RAW_decode(Routeing__Area_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cause=OMIT_VALUE;
  if (field_bssgpPduType !=  os_32) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RESUME__NACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Routeing__Area_descr_.raw);
  if (field_cause.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cause__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routeing__Area.RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
  if (field_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bssgpPduType !=  os_32) {
  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_32.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RESUME__NACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Routeing__Area_template field_routeing__Area;
Cause__BSSGP_template field_cause;
};

void PDU__BSSGP__RESUME__NACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_routeing__Area = ANY_VALUE;
single_value->field_cause = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__RESUME__NACK_template::copy_value(const PDU__BSSGP__RESUME__NACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.routeing__Area().is_bound()) {
  single_value->field_routeing__Area = other_value.routeing__Area();
} else {
  single_value->field_routeing__Area.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RESUME__NACK_template::copy_template(const PDU__BSSGP__RESUME__NACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routeing__Area().get_selection()) {
single_value->field_routeing__Area = other_value.routeing__Area();
} else {
single_value->field_routeing__Area.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__RESUME__NACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RESUME__NACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RESUME__NACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RESUME__NACK_template::PDU__BSSGP__RESUME__NACK_template()
{
}

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

PDU__BSSGP__RESUME__NACK_template::PDU__BSSGP__RESUME__NACK_template(const PDU__BSSGP__RESUME__NACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__RESUME__NACK_template::match(const PDU__BSSGP__RESUME__NACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.routeing__Area().is_bound()) return FALSE;
if(!single_value->field_routeing__Area.match(other_value.routeing__Area(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const Cause__BSSGP&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
}
return FALSE;
}

boolean PDU__BSSGP__RESUME__NACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_routeing__Area.is_bound()
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound());
}

boolean PDU__BSSGP__RESUME__NACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_routeing__Area.is_value()
 && (single_value->field_cause.is_omit() || single_value->field_cause.is_value());
}

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

PDU__BSSGP__RESUME__NACK PDU__BSSGP__RESUME__NACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
PDU__BSSGP__RESUME__NACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_routeing__Area.is_bound()) {
ret_val.routeing__Area() = single_value->field_routeing__Area.valueof();
}
if (single_value->field_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__RESUME__NACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RESUME__NACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__RESUME__NACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__RESUME__NACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
return single_value->field_tLLI;
}

Routeing__Area_template& PDU__BSSGP__RESUME__NACK_template::routeing__Area()
{
set_specific();
return single_value->field_routeing__Area;
}

const Routeing__Area_template& PDU__BSSGP__RESUME__NACK_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routeing_Area of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
return single_value->field_routeing__Area;
}

Cause__BSSGP_template& PDU__BSSGP__RESUME__NACK_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__RESUME__NACK_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_NACK.");
return single_value->field_cause;
}

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

void PDU__BSSGP__RESUME__NACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__RESUME__NACK_template::log_match(const PDU__BSSGP__RESUME__NACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routeing__Area.match(match_value.routeing__Area(), legacy)){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::log_event_str(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__PAGING__PS__REJECT::PDU__BSSGP__PAGING__PS__REJECT()
{
}

PDU__BSSGP__PAGING__PS__REJECT::PDU__BSSGP__PAGING__PS__REJECT(const OCTETSTRING& par_bssgpPduType,
    const IMSI__BSSGP& par_iMSI,
    const OPTIONAL< TMSI__BSSGP >& par_pTMSI,
    const Time__Until__Next__Paging__Occasion& par_time__Until__Next__Paging__Occasion)
  :   field_bssgpPduType(par_bssgpPduType),
  field_iMSI(par_iMSI),
  field_pTMSI(par_pTMSI),
  field_time__Until__Next__Paging__Occasion(par_time__Until__Next__Paging__Occasion)
{
}

PDU__BSSGP__PAGING__PS__REJECT::PDU__BSSGP__PAGING__PS__REJECT(const PDU__BSSGP__PAGING__PS__REJECT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.pTMSI().is_bound()) field_pTMSI = other_value.pTMSI();
else field_pTMSI.clean_up();
if (other_value.time__Until__Next__Paging__Occasion().is_bound()) field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
else field_time__Until__Next__Paging__Occasion.clean_up();
}

void PDU__BSSGP__PAGING__PS__REJECT::clean_up()
{
field_bssgpPduType.clean_up();
field_iMSI.clean_up();
field_pTMSI.clean_up();
field_time__Until__Next__Paging__Occasion.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PAGING__PS__REJECT::get_descriptor() const { return &PDU__BSSGP__PAGING__PS__REJECT_descr_; }
PDU__BSSGP__PAGING__PS__REJECT& PDU__BSSGP__PAGING__PS__REJECT::operator=(const PDU__BSSGP__PAGING__PS__REJECT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.pTMSI().is_bound()) field_pTMSI = other_value.pTMSI();
  else field_pTMSI.clean_up();
  if (other_value.time__Until__Next__Paging__Occasion().is_bound()) field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
  else field_time__Until__Next__Paging__Occasion.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PAGING__PS__REJECT::operator==(const PDU__BSSGP__PAGING__PS__REJECT& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_iMSI==other_value.field_iMSI
  && field_pTMSI==other_value.field_pTMSI
  && field_time__Until__Next__Paging__Occasion==other_value.field_time__Until__Next__Paging__Occasion;
}

boolean PDU__BSSGP__PAGING__PS__REJECT::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_pTMSI.get_selection() || field_pTMSI.is_bound())
  || (field_time__Until__Next__Paging__Occasion.is_bound());
}
boolean PDU__BSSGP__PAGING__PS__REJECT::is_value() const
{
return field_bssgpPduType.is_value()
  && field_iMSI.is_value()
  && (OPTIONAL_OMIT == field_pTMSI.get_selection() || field_pTMSI.is_value())
  && field_time__Until__Next__Paging__Occasion.is_value();
}
int PDU__BSSGP__PAGING__PS__REJECT::size_of() const
{
  int ret_val = 3;
  if (field_pTMSI.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PAGING__PS__REJECT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", pTMSI := ");
field_pTMSI.log();
TTCN_Logger::log_event_str(", time_Until_Next_Paging_Occasion := ");
field_time__Until__Next__Paging__Occasion.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PAGING__PS__REJECT::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (!pTMSI().is_bound()) pTMSI() = OMIT_VALUE;
else pTMSI().set_implicit_omit();
if (time__Until__Next__Paging__Occasion().is_bound()) time__Until__Next__Paging__Occasion().set_implicit_omit();
}

void PDU__BSSGP__PAGING__PS__REJECT::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pTMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) time__Until__Next__Paging__Occasion().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "time_Until_Next_Paging_Occasion")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          time__Until__Next__Paging__Occasion().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT");
  }
}

void PDU__BSSGP__PAGING__PS__REJECT::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_pTMSI.encode_text(text_buf);
field_time__Until__Next__Paging__Occasion.encode_text(text_buf);
}

void PDU__BSSGP__PAGING__PS__REJECT::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_pTMSI.decode_text(text_buf);
field_time__Until__Next__Paging__Occasion.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PAGING__PS__REJECT::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_pTMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, TMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_pTMSI().RAW_decode(TMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_pTMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pTMSI=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, Time__Until__Next__Paging__Occasion_descr_.raw->forceomit);
  decoded_field_length = field_time__Until__Next__Paging__Occasion.RAW_decode(Time__Until__Next__Paging__Occasion_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_49) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PAGING__PS__REJECT::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, IMSI__BSSGP_descr_.raw);
  if (field_pTMSI.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, TMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Time__Until__Next__Paging__Occasion_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_pTMSI.ispresent()) {
  encoded_length += field_pTMSI().RAW_encode(TMSI__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_time__Until__Next__Paging__Occasion.RAW_encode(Time__Until__Next__Paging__Occasion_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  os_49) {
  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_49.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PAGING__PS__REJECT_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
IMSI__BSSGP_template field_iMSI;
TMSI__BSSGP_template field_pTMSI;
Time__Until__Next__Paging__Occasion_template field_time__Until__Next__Paging__Occasion;
};

void PDU__BSSGP__PAGING__PS__REJECT_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_pTMSI = ANY_OR_OMIT;
single_value->field_time__Until__Next__Paging__Occasion = ANY_VALUE;
}
}
}

void PDU__BSSGP__PAGING__PS__REJECT_template::copy_value(const PDU__BSSGP__PAGING__PS__REJECT& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.pTMSI().is_bound()) {
  if (other_value.pTMSI().ispresent()) single_value->field_pTMSI = other_value.pTMSI()();
  else single_value->field_pTMSI = OMIT_VALUE;
} else {
  single_value->field_pTMSI.clean_up();
}
if (other_value.time__Until__Next__Paging__Occasion().is_bound()) {
  single_value->field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
} else {
  single_value->field_time__Until__Next__Paging__Occasion.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PAGING__PS__REJECT_template::copy_template(const PDU__BSSGP__PAGING__PS__REJECT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pTMSI().get_selection()) {
single_value->field_pTMSI = other_value.pTMSI();
} else {
single_value->field_pTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.time__Until__Next__Paging__Occasion().get_selection()) {
single_value->field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
} else {
single_value->field_time__Until__Next__Paging__Occasion.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PAGING__PS__REJECT_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PAGING__PS__REJECT_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PAGING__PS__REJECT_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PAGING__PS__REJECT_template::PDU__BSSGP__PAGING__PS__REJECT_template()
{
}

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

PDU__BSSGP__PAGING__PS__REJECT_template::PDU__BSSGP__PAGING__PS__REJECT_template(const PDU__BSSGP__PAGING__PS__REJECT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__PAGING__PS__REJECT_template::match(const PDU__BSSGP__PAGING__PS__REJECT& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.pTMSI().is_bound()) return FALSE;
if((other_value.pTMSI().ispresent() ? !single_value->field_pTMSI.match((const TMSI__BSSGP&)other_value.pTMSI(), legacy) : !single_value->field_pTMSI.match_omit(legacy)))return FALSE;
if(!other_value.time__Until__Next__Paging__Occasion().is_bound()) return FALSE;
if(!single_value->field_time__Until__Next__Paging__Occasion.match(other_value.time__Until__Next__Paging__Occasion(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
}
return FALSE;
}

boolean PDU__BSSGP__PAGING__PS__REJECT_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_iMSI.is_bound()
 || (single_value->field_pTMSI.is_omit() || single_value->field_pTMSI.is_bound())
 || single_value->field_time__Until__Next__Paging__Occasion.is_bound();
}

boolean PDU__BSSGP__PAGING__PS__REJECT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_iMSI.is_value()
 && (single_value->field_pTMSI.is_omit() || single_value->field_pTMSI.is_value())
 && single_value->field_time__Until__Next__Paging__Occasion.is_value();
}

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

PDU__BSSGP__PAGING__PS__REJECT PDU__BSSGP__PAGING__PS__REJECT_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
PDU__BSSGP__PAGING__PS__REJECT ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_pTMSI.is_omit()) ret_val.pTMSI() = OMIT_VALUE;
else if (single_value->field_pTMSI.is_bound()) {
ret_val.pTMSI() = single_value->field_pTMSI.valueof();
}
if (single_value->field_time__Until__Next__Paging__Occasion.is_bound()) {
ret_val.time__Until__Next__Paging__Occasion() = single_value->field_time__Until__Next__Paging__Occasion.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__PAGING__PS__REJECT_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PAGING__PS__REJECT_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
return single_value->field_bssgpPduType;
}

IMSI__BSSGP_template& PDU__BSSGP__PAGING__PS__REJECT_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__PAGING__PS__REJECT_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
return single_value->field_iMSI;
}

TMSI__BSSGP_template& PDU__BSSGP__PAGING__PS__REJECT_template::pTMSI()
{
set_specific();
return single_value->field_pTMSI;
}

const TMSI__BSSGP_template& PDU__BSSGP__PAGING__PS__REJECT_template::pTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pTMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
return single_value->field_pTMSI;
}

Time__Until__Next__Paging__Occasion_template& PDU__BSSGP__PAGING__PS__REJECT_template::time__Until__Next__Paging__Occasion()
{
set_specific();
return single_value->field_time__Until__Next__Paging__Occasion;
}

const Time__Until__Next__Paging__Occasion_template& PDU__BSSGP__PAGING__PS__REJECT_template::time__Until__Next__Paging__Occasion() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field time_Until_Next_Paging_Occasion of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS_REJECT.");
return single_value->field_time__Until__Next__Paging__Occasion;
}

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

void PDU__BSSGP__PAGING__PS__REJECT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", pTMSI := ");
single_value->field_pTMSI.log();
TTCN_Logger::log_event_str(", time_Until_Next_Paging_Occasion := ");
single_value->field_time__Until__Next__Paging__Occasion.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PAGING__PS__REJECT_template::log_match(const PDU__BSSGP__PAGING__PS__REJECT& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pTMSI().ispresent()){
if(!single_value->field_pTMSI.match(match_value.pTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".pTMSI");
single_value->field_pTMSI.log_match(match_value.pTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pTMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pTMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pTMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_time__Until__Next__Paging__Occasion.match(match_value.time__Until__Next__Paging__Occasion(), legacy)){
TTCN_Logger::log_logmatch_info(".time_Until_Next_Paging_Occasion");
single_value->field_time__Until__Next__Paging__Occasion.log_match(match_value.time__Until__Next__Paging__Occasion(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", pTMSI := ");
if (match_value.pTMSI().ispresent()) {
single_value->field_pTMSI.log_match(match_value.pTMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pTMSI.log();
if (single_value->field_pTMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", time_Until_Next_Paging_Occasion := ");
single_value->field_time__Until__Next__Paging__Occasion.log_match(match_value.time__Until__Next__Paging__Occasion(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__DUMMY__PAGING__PS::PDU__BSSGP__DUMMY__PAGING__PS()
{
}

PDU__BSSGP__DUMMY__PAGING__PS::PDU__BSSGP__DUMMY__PAGING__PS(const OCTETSTRING& par_bssgpPduType,
    const IMSI__BSSGP& par_iMSI,
    const OPTIONAL< Routeing__Area >& par_routeing__Area,
    const OPTIONAL< EDRX__Parameters >& par_eDRX__Paremeters)
  :   field_bssgpPduType(par_bssgpPduType),
  field_iMSI(par_iMSI),
  field_routeing__Area(par_routeing__Area),
  field_eDRX__Paremeters(par_eDRX__Paremeters)
{
}

PDU__BSSGP__DUMMY__PAGING__PS::PDU__BSSGP__DUMMY__PAGING__PS(const PDU__BSSGP__DUMMY__PAGING__PS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
else field_routeing__Area.clean_up();
if (other_value.eDRX__Paremeters().is_bound()) field_eDRX__Paremeters = other_value.eDRX__Paremeters();
else field_eDRX__Paremeters.clean_up();
}

void PDU__BSSGP__DUMMY__PAGING__PS::clean_up()
{
field_bssgpPduType.clean_up();
field_iMSI.clean_up();
field_routeing__Area.clean_up();
field_eDRX__Paremeters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DUMMY__PAGING__PS::get_descriptor() const { return &PDU__BSSGP__DUMMY__PAGING__PS_descr_; }
PDU__BSSGP__DUMMY__PAGING__PS& PDU__BSSGP__DUMMY__PAGING__PS::operator=(const PDU__BSSGP__DUMMY__PAGING__PS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
  else field_routeing__Area.clean_up();
  if (other_value.eDRX__Paremeters().is_bound()) field_eDRX__Paremeters = other_value.eDRX__Paremeters();
  else field_eDRX__Paremeters.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DUMMY__PAGING__PS::operator==(const PDU__BSSGP__DUMMY__PAGING__PS& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_iMSI==other_value.field_iMSI
  && field_routeing__Area==other_value.field_routeing__Area
  && field_eDRX__Paremeters==other_value.field_eDRX__Paremeters;
}

boolean PDU__BSSGP__DUMMY__PAGING__PS::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_routeing__Area.get_selection() || field_routeing__Area.is_bound())
  || (OPTIONAL_OMIT == field_eDRX__Paremeters.get_selection() || field_eDRX__Paremeters.is_bound());
}
boolean PDU__BSSGP__DUMMY__PAGING__PS::is_value() const
{
return field_bssgpPduType.is_value()
  && field_iMSI.is_value()
  && (OPTIONAL_OMIT == field_routeing__Area.get_selection() || field_routeing__Area.is_value())
  && (OPTIONAL_OMIT == field_eDRX__Paremeters.get_selection() || field_eDRX__Paremeters.is_value());
}
int PDU__BSSGP__DUMMY__PAGING__PS::size_of() const
{
  int ret_val = 2;
  if (field_routeing__Area.ispresent()) ret_val++;
  if (field_eDRX__Paremeters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__DUMMY__PAGING__PS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
field_routeing__Area.log();
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DUMMY__PAGING__PS::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (!routeing__Area().is_bound()) routeing__Area() = OMIT_VALUE;
else routeing__Area().set_implicit_omit();
if (!eDRX__Paremeters().is_bound()) eDRX__Paremeters() = OMIT_VALUE;
else eDRX__Paremeters().set_implicit_omit();
}

void PDU__BSSGP__DUMMY__PAGING__PS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) eDRX__Paremeters().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eDRX_Paremeters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRX__Paremeters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS");
  }
}

void PDU__BSSGP__DUMMY__PAGING__PS::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_routeing__Area.encode_text(text_buf);
field_eDRX__Paremeters.encode_text(text_buf);
}

void PDU__BSSGP__DUMMY__PAGING__PS::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_routeing__Area.decode_text(text_buf);
field_eDRX__Paremeters.decode_text(text_buf);
}

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

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

int PDU__BSSGP__DUMMY__PAGING__PS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_routeing__Area = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, Routeing__Area_descr_.raw->forceomit);
  decoded_field_length = field_routeing__Area().RAW_decode(Routeing__Area_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_routeing__Area = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_routeing__Area=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_eDRX__Paremeters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, EDRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_eDRX__Paremeters().RAW_decode(EDRX__Parameters_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_eDRX__Paremeters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_eDRX__Paremeters=OMIT_VALUE;
  if (field_bssgpPduType !=  os_50) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__DUMMY__PAGING__PS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, IMSI__BSSGP_descr_.raw);
  if (field_routeing__Area.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Routeing__Area_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_eDRX__Paremeters.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, EDRX__Parameters_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_routeing__Area.ispresent()) {
  encoded_length += field_routeing__Area().RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_eDRX__Paremeters.ispresent()) {
  encoded_length += field_eDRX__Paremeters().RAW_encode(EDRX__Parameters_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bssgpPduType !=  os_50) {
  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_50.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__DUMMY__PAGING__PS_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
IMSI__BSSGP_template field_iMSI;
Routeing__Area_template field_routeing__Area;
EDRX__Parameters_template field_eDRX__Paremeters;
};

void PDU__BSSGP__DUMMY__PAGING__PS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_routeing__Area = ANY_OR_OMIT;
single_value->field_eDRX__Paremeters = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__DUMMY__PAGING__PS_template::copy_value(const PDU__BSSGP__DUMMY__PAGING__PS& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.routeing__Area().is_bound()) {
  if (other_value.routeing__Area().ispresent()) single_value->field_routeing__Area = other_value.routeing__Area()();
  else single_value->field_routeing__Area = OMIT_VALUE;
} else {
  single_value->field_routeing__Area.clean_up();
}
if (other_value.eDRX__Paremeters().is_bound()) {
  if (other_value.eDRX__Paremeters().ispresent()) single_value->field_eDRX__Paremeters = other_value.eDRX__Paremeters()();
  else single_value->field_eDRX__Paremeters = OMIT_VALUE;
} else {
  single_value->field_eDRX__Paremeters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DUMMY__PAGING__PS_template::copy_template(const PDU__BSSGP__DUMMY__PAGING__PS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routeing__Area().get_selection()) {
single_value->field_routeing__Area = other_value.routeing__Area();
} else {
single_value->field_routeing__Area.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eDRX__Paremeters().get_selection()) {
single_value->field_eDRX__Paremeters = other_value.eDRX__Paremeters();
} else {
single_value->field_eDRX__Paremeters.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DUMMY__PAGING__PS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__DUMMY__PAGING__PS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DUMMY__PAGING__PS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DUMMY__PAGING__PS_template::PDU__BSSGP__DUMMY__PAGING__PS_template()
{
}

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

PDU__BSSGP__DUMMY__PAGING__PS_template::PDU__BSSGP__DUMMY__PAGING__PS_template(const PDU__BSSGP__DUMMY__PAGING__PS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__DUMMY__PAGING__PS_template::match(const PDU__BSSGP__DUMMY__PAGING__PS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.routeing__Area().is_bound()) return FALSE;
if((other_value.routeing__Area().ispresent() ? !single_value->field_routeing__Area.match((const Routeing__Area&)other_value.routeing__Area(), legacy) : !single_value->field_routeing__Area.match_omit(legacy)))return FALSE;
if(!other_value.eDRX__Paremeters().is_bound()) return FALSE;
if((other_value.eDRX__Paremeters().ispresent() ? !single_value->field_eDRX__Paremeters.match((const EDRX__Parameters&)other_value.eDRX__Paremeters(), legacy) : !single_value->field_eDRX__Paremeters.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
}
return FALSE;
}

boolean PDU__BSSGP__DUMMY__PAGING__PS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_iMSI.is_bound()
 || (single_value->field_routeing__Area.is_omit() || single_value->field_routeing__Area.is_bound())
 || (single_value->field_eDRX__Paremeters.is_omit() || single_value->field_eDRX__Paremeters.is_bound());
}

boolean PDU__BSSGP__DUMMY__PAGING__PS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_iMSI.is_value()
 && (single_value->field_routeing__Area.is_omit() || single_value->field_routeing__Area.is_value())
 && (single_value->field_eDRX__Paremeters.is_omit() || single_value->field_eDRX__Paremeters.is_value());
}

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

PDU__BSSGP__DUMMY__PAGING__PS PDU__BSSGP__DUMMY__PAGING__PS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
PDU__BSSGP__DUMMY__PAGING__PS ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_routeing__Area.is_omit()) ret_val.routeing__Area() = OMIT_VALUE;
else if (single_value->field_routeing__Area.is_bound()) {
ret_val.routeing__Area() = single_value->field_routeing__Area.valueof();
}
if (single_value->field_eDRX__Paremeters.is_omit()) ret_val.eDRX__Paremeters() = OMIT_VALUE;
else if (single_value->field_eDRX__Paremeters.is_bound()) {
ret_val.eDRX__Paremeters() = single_value->field_eDRX__Paremeters.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__DUMMY__PAGING__PS_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DUMMY__PAGING__PS_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
return single_value->field_bssgpPduType;
}

IMSI__BSSGP_template& PDU__BSSGP__DUMMY__PAGING__PS_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__DUMMY__PAGING__PS_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
return single_value->field_iMSI;
}

Routeing__Area_template& PDU__BSSGP__DUMMY__PAGING__PS_template::routeing__Area()
{
set_specific();
return single_value->field_routeing__Area;
}

const Routeing__Area_template& PDU__BSSGP__DUMMY__PAGING__PS_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routeing_Area of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
return single_value->field_routeing__Area;
}

EDRX__Parameters_template& PDU__BSSGP__DUMMY__PAGING__PS_template::eDRX__Paremeters()
{
set_specific();
return single_value->field_eDRX__Paremeters;
}

const EDRX__Parameters_template& PDU__BSSGP__DUMMY__PAGING__PS_template::eDRX__Paremeters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eDRX_Paremeters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS.");
return single_value->field_eDRX__Paremeters;
}

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

void PDU__BSSGP__DUMMY__PAGING__PS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
single_value->field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DUMMY__PAGING__PS_template::log_match(const PDU__BSSGP__DUMMY__PAGING__PS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.routeing__Area().ispresent()){
if(!single_value->field_routeing__Area.match(match_value.routeing__Area(), legacy)){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routeing__Area.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routeing_Area := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eDRX__Paremeters().ispresent()){
if(!single_value->field_eDRX__Paremeters.match(match_value.eDRX__Paremeters(), legacy)){
TTCN_Logger::log_logmatch_info(".eDRX_Paremeters");
single_value->field_eDRX__Paremeters.log_match(match_value.eDRX__Paremeters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eDRX__Paremeters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eDRX_Paremeters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", routeing_Area := ");
if (match_value.routeing__Area().ispresent()) {
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routeing__Area.log();
if (single_value->field_routeing__Area.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
if (match_value.eDRX__Paremeters().ispresent()) {
single_value->field_eDRX__Paremeters.log_match(match_value.eDRX__Paremeters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eDRX__Paremeters.log();
if (single_value->field_eDRX__Paremeters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE()
{
}

PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE(const OCTETSTRING& par_bssgpPduType,
    const IMSI__BSSGP& par_iMSI,
    const Time__Until__Next__Paging__Occasion& par_time__Until__Next__Paging__Occasion)
  :   field_bssgpPduType(par_bssgpPduType),
  field_iMSI(par_iMSI),
  field_time__Until__Next__Paging__Occasion(par_time__Until__Next__Paging__Occasion)
{
}

PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.time__Until__Next__Paging__Occasion().is_bound()) field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
else field_time__Until__Next__Paging__Occasion.clean_up();
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::clean_up()
{
field_bssgpPduType.clean_up();
field_iMSI.clean_up();
field_time__Until__Next__Paging__Occasion.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::get_descriptor() const { return &PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_descr_; }
PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::operator=(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.time__Until__Next__Paging__Occasion().is_bound()) field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
  else field_time__Until__Next__Paging__Occasion.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::operator==(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_iMSI==other_value.field_iMSI
  && field_time__Until__Next__Paging__Occasion==other_value.field_time__Until__Next__Paging__Occasion;
}

boolean PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_iMSI.is_bound())
  || (field_time__Until__Next__Paging__Occasion.is_bound());
}
boolean PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::is_value() const
{
return field_bssgpPduType.is_value()
  && field_iMSI.is_value()
  && field_time__Until__Next__Paging__Occasion.is_value();
}
void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", time_Until_Next_Paging_Occasion := ");
field_time__Until__Next__Paging__Occasion.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (time__Until__Next__Paging__Occasion().is_bound()) time__Until__Next__Paging__Occasion().set_implicit_omit();
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) time__Until__Next__Paging__Occasion().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "time_Until_Next_Paging_Occasion")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          time__Until__Next__Paging__Occasion().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE");
  }
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_time__Until__Next__Paging__Occasion.encode_text(text_buf);
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_time__Until__Next__Paging__Occasion.decode_text(text_buf);
}

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

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

int PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Time__Until__Next__Paging__Occasion_descr_.raw->forceomit);
  decoded_field_length = field_time__Until__Next__Paging__Occasion.RAW_decode(Time__Until__Next__Paging__Occasion_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_1) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IMSI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Time__Until__Next__Paging__Occasion_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_time__Until__Next__Paging__Occasion.RAW_encode(Time__Until__Next__Paging__Occasion_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_1) {
  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_1.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
IMSI__BSSGP_template field_iMSI;
Time__Until__Next__Paging__Occasion_template field_time__Until__Next__Paging__Occasion;
};

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_time__Until__Next__Paging__Occasion = ANY_VALUE;
}
}
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::copy_value(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.time__Until__Next__Paging__Occasion().is_bound()) {
  single_value->field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
} else {
  single_value->field_time__Until__Next__Paging__Occasion.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::copy_template(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.time__Until__Next__Paging__Occasion().get_selection()) {
single_value->field_time__Until__Next__Paging__Occasion = other_value.time__Until__Next__Paging__Occasion();
} else {
single_value->field_time__Until__Next__Paging__Occasion.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template()
{
}

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

PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::match(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.time__Until__Next__Paging__Occasion().is_bound()) return FALSE;
if(!single_value->field_time__Until__Next__Paging__Occasion.match(other_value.time__Until__Next__Paging__Occasion(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
}
return FALSE;
}

boolean PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_iMSI.is_bound()
 || single_value->field_time__Until__Next__Paging__Occasion.is_bound();
}

boolean PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_iMSI.is_value()
 && single_value->field_time__Until__Next__Paging__Occasion.is_value();
}

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

PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_time__Until__Next__Paging__Occasion.is_bound()) {
ret_val.time__Until__Next__Paging__Occasion() = single_value->field_time__Until__Next__Paging__Occasion.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
return single_value->field_bssgpPduType;
}

IMSI__BSSGP_template& PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
return single_value->field_iMSI;
}

Time__Until__Next__Paging__Occasion_template& PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::time__Until__Next__Paging__Occasion()
{
set_specific();
return single_value->field_time__Until__Next__Paging__Occasion;
}

const Time__Until__Next__Paging__Occasion_template& PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::time__Until__Next__Paging__Occasion() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field time_Until_Next_Paging_Occasion of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DUMMY_PAGING_PS_RESPONSE.");
return single_value->field_time__Until__Next__Paging__Occasion;
}

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

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", time_Until_Next_Paging_Occasion := ");
single_value->field_time__Until__Next__Paging__Occasion.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template::log_match(const PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_time__Until__Next__Paging__Occasion.match(match_value.time__Until__Next__Paging__Occasion(), legacy)){
TTCN_Logger::log_logmatch_info(".time_Until_Next_Paging_Occasion");
single_value->field_time__Until__Next__Paging__Occasion.log_match(match_value.time__Until__Next__Paging__Occasion(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", time_Until_Next_Paging_Occasion := ");
single_value->field_time__Until__Next__Paging__Occasion.log_match(match_value.time__Until__Next__Paging__Occasion(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE()
{
}

PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE(const OCTETSTRING& par_bssgpPduType,
    const IMSI__BSSGP& par_iMSI,
    const OPTIONAL< PLMN__Identity >& par_pS__Registered__Operator)
  :   field_bssgpPduType(par_bssgpPduType),
  field_iMSI(par_iMSI),
  field_pS__Registered__Operator(par_pS__Registered__Operator)
{
}

PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.pS__Registered__Operator().is_bound()) field_pS__Registered__Operator = other_value.pS__Registered__Operator();
else field_pS__Registered__Operator.clean_up();
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::clean_up()
{
field_bssgpPduType.clean_up();
field_iMSI.clean_up();
field_pS__Registered__Operator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::get_descriptor() const { return &PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_descr_; }
PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::operator=(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.pS__Registered__Operator().is_bound()) field_pS__Registered__Operator = other_value.pS__Registered__Operator();
  else field_pS__Registered__Operator.clean_up();
}
return *this;
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::operator==(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_iMSI==other_value.field_iMSI
  && field_pS__Registered__Operator==other_value.field_pS__Registered__Operator;
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_pS__Registered__Operator.get_selection() || field_pS__Registered__Operator.is_bound());
}
boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::is_value() const
{
return field_bssgpPduType.is_value()
  && field_iMSI.is_value()
  && (OPTIONAL_OMIT == field_pS__Registered__Operator.get_selection() || field_pS__Registered__Operator.is_value());
}
int PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::size_of() const
{
  int ret_val = 2;
  if (field_pS__Registered__Operator.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", pS_Registered_Operator := ");
field_pS__Registered__Operator.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (!pS__Registered__Operator().is_bound()) pS__Registered__Operator() = OMIT_VALUE;
else pS__Registered__Operator().set_implicit_omit();
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pS__Registered__Operator().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pS_Registered_Operator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__Registered__Operator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE");
  }
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_pS__Registered__Operator.encode_text(text_buf);
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_pS__Registered__Operator.decode_text(text_buf);
}

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

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

int PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_pS__Registered__Operator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, PLMN__Identity_descr_.raw->forceomit);
  decoded_field_length = field_pS__Registered__Operator().RAW_decode(PLMN__Identity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_pS__Registered__Operator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pS__Registered__Operator=OMIT_VALUE;
  if (field_bssgpPduType !=  os_51) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IMSI__BSSGP_descr_.raw);
  if (field_pS__Registered__Operator.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PLMN__Identity_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_pS__Registered__Operator.ispresent()) {
  encoded_length += field_pS__Registered__Operator().RAW_encode(PLMN__Identity_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_bssgpPduType !=  os_51) {
  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_51.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
IMSI__BSSGP_template field_iMSI;
PLMN__Identity_template field_pS__Registered__Operator;
};

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_pS__Registered__Operator = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::copy_value(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.pS__Registered__Operator().is_bound()) {
  if (other_value.pS__Registered__Operator().ispresent()) single_value->field_pS__Registered__Operator = other_value.pS__Registered__Operator()();
  else single_value->field_pS__Registered__Operator = OMIT_VALUE;
} else {
  single_value->field_pS__Registered__Operator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::copy_template(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pS__Registered__Operator().get_selection()) {
single_value->field_pS__Registered__Operator = other_value.pS__Registered__Operator();
} else {
single_value->field_pS__Registered__Operator.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template()
{
}

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

PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::match(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.pS__Registered__Operator().is_bound()) return FALSE;
if((other_value.pS__Registered__Operator().ispresent() ? !single_value->field_pS__Registered__Operator.match((const PLMN__Identity&)other_value.pS__Registered__Operator(), legacy) : !single_value->field_pS__Registered__Operator.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
}
return FALSE;
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_iMSI.is_bound()
 || (single_value->field_pS__Registered__Operator.is_omit() || single_value->field_pS__Registered__Operator.is_bound());
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_iMSI.is_value()
 && (single_value->field_pS__Registered__Operator.is_omit() || single_value->field_pS__Registered__Operator.is_value());
}

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

PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_pS__Registered__Operator.is_omit()) ret_val.pS__Registered__Operator() = OMIT_VALUE;
else if (single_value->field_pS__Registered__Operator.is_bound()) {
ret_val.pS__Registered__Operator() = single_value->field_pS__Registered__Operator.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
return single_value->field_bssgpPduType;
}

IMSI__BSSGP_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
return single_value->field_iMSI;
}

PLMN__Identity_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::pS__Registered__Operator()
{
set_specific();
return single_value->field_pS__Registered__Operator;
}

const PLMN__Identity_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::pS__Registered__Operator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pS_Registered_Operator of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE.");
return single_value->field_pS__Registered__Operator;
}

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

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", pS_Registered_Operator := ");
single_value->field_pS__Registered__Operator.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template::log_match(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pS__Registered__Operator().ispresent()){
if(!single_value->field_pS__Registered__Operator.match(match_value.pS__Registered__Operator(), legacy)){
TTCN_Logger::log_logmatch_info(".pS_Registered_Operator");
single_value->field_pS__Registered__Operator.log_match(match_value.pS__Registered__Operator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pS__Registered__Operator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pS_Registered_Operator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pS__Registered__Operator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", pS_Registered_Operator := ");
if (match_value.pS__Registered__Operator().ispresent()) {
single_value->field_pS__Registered__Operator.log_match(match_value.pS__Registered__Operator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pS__Registered__Operator.log();
if (single_value->field_pS__Registered__Operator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__MS__REGISTRATION__ENQUIRY::PDU__BSSGP__MS__REGISTRATION__ENQUIRY()
{
}

PDU__BSSGP__MS__REGISTRATION__ENQUIRY::PDU__BSSGP__MS__REGISTRATION__ENQUIRY(const OCTETSTRING& par_bssgpPduType,
    const IMSI__BSSGP& par_iMSI,
    const OPTIONAL< MME__Query >& par_mME__Query)
  :   field_bssgpPduType(par_bssgpPduType),
  field_iMSI(par_iMSI),
  field_mME__Query(par_mME__Query)
{
}

PDU__BSSGP__MS__REGISTRATION__ENQUIRY::PDU__BSSGP__MS__REGISTRATION__ENQUIRY(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.mME__Query().is_bound()) field_mME__Query = other_value.mME__Query();
else field_mME__Query.clean_up();
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY::clean_up()
{
field_bssgpPduType.clean_up();
field_iMSI.clean_up();
field_mME__Query.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__MS__REGISTRATION__ENQUIRY::get_descriptor() const { return &PDU__BSSGP__MS__REGISTRATION__ENQUIRY_descr_; }
PDU__BSSGP__MS__REGISTRATION__ENQUIRY& PDU__BSSGP__MS__REGISTRATION__ENQUIRY::operator=(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.mME__Query().is_bound()) field_mME__Query = other_value.mME__Query();
  else field_mME__Query.clean_up();
}
return *this;
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY::operator==(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_iMSI==other_value.field_iMSI
  && field_mME__Query==other_value.field_mME__Query;
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_mME__Query.get_selection() || field_mME__Query.is_bound());
}
boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY::is_value() const
{
return field_bssgpPduType.is_value()
  && field_iMSI.is_value()
  && (OPTIONAL_OMIT == field_mME__Query.get_selection() || field_mME__Query.is_value());
}
int PDU__BSSGP__MS__REGISTRATION__ENQUIRY::size_of() const
{
  int ret_val = 2;
  if (field_mME__Query.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", mME_Query := ");
field_mME__Query.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (!mME__Query().is_bound()) mME__Query() = OMIT_VALUE;
else mME__Query().set_implicit_omit();
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mME__Query().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mME_Query")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mME__Query().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY");
  }
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_mME__Query.encode_text(text_buf);
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_mME__Query.decode_text(text_buf);
}

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

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

int PDU__BSSGP__MS__REGISTRATION__ENQUIRY::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_mME__Query = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MME__Query_descr_.raw->forceomit);
  decoded_field_length = field_mME__Query().RAW_decode(MME__Query_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mME__Query = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mME__Query=OMIT_VALUE;
  if (field_bssgpPduType !=  os_53) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__MS__REGISTRATION__ENQUIRY::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IMSI__BSSGP_descr_.raw);
  if (field_mME__Query.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MME__Query_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_mME__Query.ispresent()) {
  encoded_length += field_mME__Query().RAW_encode(MME__Query_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_bssgpPduType !=  os_53) {
  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_53.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
IMSI__BSSGP_template field_iMSI;
MME__Query_template field_mME__Query;
};

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_mME__Query = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::copy_value(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.mME__Query().is_bound()) {
  if (other_value.mME__Query().ispresent()) single_value->field_mME__Query = other_value.mME__Query()();
  else single_value->field_mME__Query = OMIT_VALUE;
} else {
  single_value->field_mME__Query.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::copy_template(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mME__Query().get_selection()) {
single_value->field_mME__Query = other_value.mME__Query();
} else {
single_value->field_mME__Query.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template()
{
}

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

PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::match(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.mME__Query().is_bound()) return FALSE;
if((other_value.mME__Query().ispresent() ? !single_value->field_mME__Query.match((const MME__Query&)other_value.mME__Query(), legacy) : !single_value->field_mME__Query.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
}
return FALSE;
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_iMSI.is_bound()
 || (single_value->field_mME__Query.is_omit() || single_value->field_mME__Query.is_bound());
}

boolean PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_iMSI.is_value()
 && (single_value->field_mME__Query.is_omit() || single_value->field_mME__Query.is_value());
}

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

PDU__BSSGP__MS__REGISTRATION__ENQUIRY PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
PDU__BSSGP__MS__REGISTRATION__ENQUIRY ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_mME__Query.is_omit()) ret_val.mME__Query() = OMIT_VALUE;
else if (single_value->field_mME__Query.is_bound()) {
ret_val.mME__Query() = single_value->field_mME__Query.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
return single_value->field_bssgpPduType;
}

IMSI__BSSGP_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
return single_value->field_iMSI;
}

MME__Query_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::mME__Query()
{
set_specific();
return single_value->field_mME__Query;
}

const MME__Query_template& PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::mME__Query() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mME_Query of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MS_REGISTRATION_ENQUIRY.");
return single_value->field_mME__Query;
}

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

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", mME_Query := ");
single_value->field_mME__Query.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template::log_match(const PDU__BSSGP__MS__REGISTRATION__ENQUIRY& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mME__Query().ispresent()){
if(!single_value->field_mME__Query.match(match_value.mME__Query(), legacy)){
TTCN_Logger::log_logmatch_info(".mME_Query");
single_value->field_mME__Query.log_match(match_value.mME__Query(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mME__Query.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mME_Query := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mME__Query.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", mME_Query := ");
if (match_value.mME__Query().ispresent()) {
single_value->field_mME__Query.log_match(match_value.mME__Query(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mME__Query.log();
if (single_value->field_mME__Query.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__FLUSH__LL::PDU__BSSGP__FLUSH__LL()
{
}

PDU__BSSGP__FLUSH__LL::PDU__BSSGP__FLUSH__LL(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const BVCI& par_bVCI__old,
    const OPTIONAL< BVCI >& par_bVCI__new,
    const OPTIONAL< NSEI__BSSGP >& par_nSEI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_bVCI__old(par_bVCI__old),
  field_bVCI__new(par_bVCI__new),
  field_nSEI(par_nSEI)
{
}

PDU__BSSGP__FLUSH__LL::PDU__BSSGP__FLUSH__LL(const PDU__BSSGP__FLUSH__LL& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.bVCI__old().is_bound()) field_bVCI__old = other_value.bVCI__old();
else field_bVCI__old.clean_up();
if (other_value.bVCI__new().is_bound()) field_bVCI__new = other_value.bVCI__new();
else field_bVCI__new.clean_up();
if (other_value.nSEI().is_bound()) field_nSEI = other_value.nSEI();
else field_nSEI.clean_up();
}

void PDU__BSSGP__FLUSH__LL::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_bVCI__old.clean_up();
field_bVCI__new.clean_up();
field_nSEI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLUSH__LL::get_descriptor() const { return &PDU__BSSGP__FLUSH__LL_descr_; }
PDU__BSSGP__FLUSH__LL& PDU__BSSGP__FLUSH__LL::operator=(const PDU__BSSGP__FLUSH__LL& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.bVCI__old().is_bound()) field_bVCI__old = other_value.bVCI__old();
  else field_bVCI__old.clean_up();
  if (other_value.bVCI__new().is_bound()) field_bVCI__new = other_value.bVCI__new();
  else field_bVCI__new.clean_up();
  if (other_value.nSEI().is_bound()) field_nSEI = other_value.nSEI();
  else field_nSEI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLUSH__LL::operator==(const PDU__BSSGP__FLUSH__LL& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_bVCI__old==other_value.field_bVCI__old
  && field_bVCI__new==other_value.field_bVCI__new
  && field_nSEI==other_value.field_nSEI;
}

boolean PDU__BSSGP__FLUSH__LL::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_bVCI__old.is_bound())
  || (OPTIONAL_OMIT == field_bVCI__new.get_selection() || field_bVCI__new.is_bound())
  || (OPTIONAL_OMIT == field_nSEI.get_selection() || field_nSEI.is_bound());
}
boolean PDU__BSSGP__FLUSH__LL::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_bVCI__old.is_value()
  && (OPTIONAL_OMIT == field_bVCI__new.get_selection() || field_bVCI__new.is_value())
  && (OPTIONAL_OMIT == field_nSEI.get_selection() || field_nSEI.is_value());
}
int PDU__BSSGP__FLUSH__LL::size_of() const
{
  int ret_val = 3;
  if (field_bVCI__new.ispresent()) ret_val++;
  if (field_nSEI.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__FLUSH__LL::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI_old := ");
field_bVCI__old.log();
TTCN_Logger::log_event_str(", bVCI_new := ");
field_bVCI__new.log();
TTCN_Logger::log_event_str(", nSEI := ");
field_nSEI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLUSH__LL::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (bVCI__old().is_bound()) bVCI__old().set_implicit_omit();
if (!bVCI__new().is_bound()) bVCI__new() = OMIT_VALUE;
else bVCI__new().set_implicit_omit();
if (!nSEI().is_bound()) nSEI() = OMIT_VALUE;
else nSEI().set_implicit_omit();
}

void PDU__BSSGP__FLUSH__LL::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI__old().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bVCI__new().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) nSEI().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI_old")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI__old().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI_new")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI__new().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLUSH_LL: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLUSH_LL");
  }
}

void PDU__BSSGP__FLUSH__LL::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_bVCI__old.encode_text(text_buf);
field_bVCI__new.encode_text(text_buf);
field_nSEI.encode_text(text_buf);
}

void PDU__BSSGP__FLUSH__LL::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_bVCI__old.decode_text(text_buf);
field_bVCI__new.decode_text(text_buf);
field_nSEI.decode_text(text_buf);
}

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

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

int PDU__BSSGP__FLUSH__LL::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI__old.RAW_decode(BVCI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_bVCI__new = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI__new().RAW_decode(BVCI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_bVCI__new = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bVCI__new=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_nSEI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, NSEI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_nSEI().RAW_decode(NSEI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_nSEI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_nSEI=OMIT_VALUE;
  if (field_bssgpPduType !=  os_55) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__FLUSH__LL::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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BVCI_descr_.raw);
  if (field_bVCI__new.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BVCI_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_nSEI.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, NSEI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_bVCI__old.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[2]);
  if (field_bVCI__new.ispresent()) {
  encoded_length += field_bVCI__new().RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_nSEI.ispresent()) {
  encoded_length += field_nSEI().RAW_encode(NSEI__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_bssgpPduType !=  os_55) {
  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_55.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLUSH__LL_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
BVCI_template field_bVCI__old;
BVCI_template field_bVCI__new;
NSEI__BSSGP_template field_nSEI;
};

void PDU__BSSGP__FLUSH__LL_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_bVCI__old = ANY_VALUE;
single_value->field_bVCI__new = ANY_OR_OMIT;
single_value->field_nSEI = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__FLUSH__LL_template::copy_value(const PDU__BSSGP__FLUSH__LL& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.bVCI__old().is_bound()) {
  single_value->field_bVCI__old = other_value.bVCI__old();
} else {
  single_value->field_bVCI__old.clean_up();
}
if (other_value.bVCI__new().is_bound()) {
  if (other_value.bVCI__new().ispresent()) single_value->field_bVCI__new = other_value.bVCI__new()();
  else single_value->field_bVCI__new = OMIT_VALUE;
} else {
  single_value->field_bVCI__new.clean_up();
}
if (other_value.nSEI().is_bound()) {
  if (other_value.nSEI().ispresent()) single_value->field_nSEI = other_value.nSEI()();
  else single_value->field_nSEI = OMIT_VALUE;
} else {
  single_value->field_nSEI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLUSH__LL_template::copy_template(const PDU__BSSGP__FLUSH__LL_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI__old().get_selection()) {
single_value->field_bVCI__old = other_value.bVCI__old();
} else {
single_value->field_bVCI__old.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI__new().get_selection()) {
single_value->field_bVCI__new = other_value.bVCI__new();
} else {
single_value->field_bVCI__new.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nSEI().get_selection()) {
single_value->field_nSEI = other_value.nSEI();
} else {
single_value->field_nSEI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLUSH__LL_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__FLUSH__LL_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLUSH__LL_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLUSH__LL_template::PDU__BSSGP__FLUSH__LL_template()
{
}

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

PDU__BSSGP__FLUSH__LL_template::PDU__BSSGP__FLUSH__LL_template(const PDU__BSSGP__FLUSH__LL& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLUSH__LL_template::match(const PDU__BSSGP__FLUSH__LL& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.bVCI__old().is_bound()) return FALSE;
if(!single_value->field_bVCI__old.match(other_value.bVCI__old(), legacy))return FALSE;
if(!other_value.bVCI__new().is_bound()) return FALSE;
if((other_value.bVCI__new().ispresent() ? !single_value->field_bVCI__new.match((const BVCI&)other_value.bVCI__new(), legacy) : !single_value->field_bVCI__new.match_omit(legacy)))return FALSE;
if(!other_value.nSEI().is_bound()) return FALSE;
if((other_value.nSEI().ispresent() ? !single_value->field_nSEI.match((const NSEI__BSSGP&)other_value.nSEI(), legacy) : !single_value->field_nSEI.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
}
return FALSE;
}

boolean PDU__BSSGP__FLUSH__LL_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_bVCI__old.is_bound()
 || (single_value->field_bVCI__new.is_omit() || single_value->field_bVCI__new.is_bound())
 || (single_value->field_nSEI.is_omit() || single_value->field_nSEI.is_bound());
}

boolean PDU__BSSGP__FLUSH__LL_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_bVCI__old.is_value()
 && (single_value->field_bVCI__new.is_omit() || single_value->field_bVCI__new.is_value())
 && (single_value->field_nSEI.is_omit() || single_value->field_nSEI.is_value());
}

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

PDU__BSSGP__FLUSH__LL PDU__BSSGP__FLUSH__LL_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
PDU__BSSGP__FLUSH__LL ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_bVCI__old.is_bound()) {
ret_val.bVCI__old() = single_value->field_bVCI__old.valueof();
}
if (single_value->field_bVCI__new.is_omit()) ret_val.bVCI__new() = OMIT_VALUE;
else if (single_value->field_bVCI__new.is_bound()) {
ret_val.bVCI__new() = single_value->field_bVCI__new.valueof();
}
if (single_value->field_nSEI.is_omit()) ret_val.nSEI() = OMIT_VALUE;
else if (single_value->field_nSEI.is_bound()) {
ret_val.nSEI() = single_value->field_nSEI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLUSH__LL_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLUSH__LL_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__FLUSH__LL_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__FLUSH__LL_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
return single_value->field_tLLI;
}

BVCI_template& PDU__BSSGP__FLUSH__LL_template::bVCI__old()
{
set_specific();
return single_value->field_bVCI__old;
}

const BVCI_template& PDU__BSSGP__FLUSH__LL_template::bVCI__old() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI_old of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
return single_value->field_bVCI__old;
}

BVCI_template& PDU__BSSGP__FLUSH__LL_template::bVCI__new()
{
set_specific();
return single_value->field_bVCI__new;
}

const BVCI_template& PDU__BSSGP__FLUSH__LL_template::bVCI__new() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI_new of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
return single_value->field_bVCI__new;
}

NSEI__BSSGP_template& PDU__BSSGP__FLUSH__LL_template::nSEI()
{
set_specific();
return single_value->field_nSEI;
}

const NSEI__BSSGP_template& PDU__BSSGP__FLUSH__LL_template::nSEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSEI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL.");
return single_value->field_nSEI;
}

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

void PDU__BSSGP__FLUSH__LL_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI_old := ");
single_value->field_bVCI__old.log();
TTCN_Logger::log_event_str(", bVCI_new := ");
single_value->field_bVCI__new.log();
TTCN_Logger::log_event_str(", nSEI := ");
single_value->field_nSEI.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__FLUSH__LL_template::log_match(const PDU__BSSGP__FLUSH__LL& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI__old.match(match_value.bVCI__old(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI_old");
single_value->field_bVCI__old.log_match(match_value.bVCI__old(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.bVCI__new().ispresent()){
if(!single_value->field_bVCI__new.match(match_value.bVCI__new(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI_new");
single_value->field_bVCI__new.log_match(match_value.bVCI__new(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bVCI__new.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bVCI_new := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bVCI__new.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.nSEI().ispresent()){
if(!single_value->field_nSEI.match(match_value.nSEI(), legacy)){
TTCN_Logger::log_logmatch_info(".nSEI");
single_value->field_nSEI.log_match(match_value.nSEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nSEI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nSEI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nSEI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", bVCI_old := ");
single_value->field_bVCI__old.log_match(match_value.bVCI__old(), legacy);
TTCN_Logger::log_event_str(", bVCI_new := ");
if (match_value.bVCI__new().ispresent()) {
single_value->field_bVCI__new.log_match(match_value.bVCI__new(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bVCI__new.log();
if (single_value->field_bVCI__new.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", nSEI := ");
if (match_value.nSEI().ispresent()) {
single_value->field_nSEI.log_match(match_value.nSEI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nSEI.log();
if (single_value->field_nSEI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

void PDU__BSSGP__FLUSH__LL_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__FLUSH__LL_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI__old().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bVCI__new().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) nSEI().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI_old")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI__old().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI_new")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI__new().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLUSH_LL: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__FLUSH__LL_template* precondition = new PDU__BSSGP__FLUSH__LL_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__FLUSH__LL_template* implied_template = new PDU__BSSGP__FLUSH__LL_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__FLUSH__LL_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_FLUSH_LL");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

PDU__BSSGP__FLUSH__LL__ACK::PDU__BSSGP__FLUSH__LL__ACK()
{
}

PDU__BSSGP__FLUSH__LL__ACK::PDU__BSSGP__FLUSH__LL__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Flush__Action& par_flush__Action,
    const OPTIONAL< BVCI >& par_bVCI__new,
    const Number__of__octets__affected& par_number__of__octets__affected,
    const OPTIONAL< NSEI__BSSGP >& par_nSEI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_flush__Action(par_flush__Action),
  field_bVCI__new(par_bVCI__new),
  field_number__of__octets__affected(par_number__of__octets__affected),
  field_nSEI(par_nSEI)
{
}

PDU__BSSGP__FLUSH__LL__ACK::PDU__BSSGP__FLUSH__LL__ACK(const PDU__BSSGP__FLUSH__LL__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.flush__Action().is_bound()) field_flush__Action = other_value.flush__Action();
else field_flush__Action.clean_up();
if (other_value.bVCI__new().is_bound()) field_bVCI__new = other_value.bVCI__new();
else field_bVCI__new.clean_up();
if (other_value.number__of__octets__affected().is_bound()) field_number__of__octets__affected = other_value.number__of__octets__affected();
else field_number__of__octets__affected.clean_up();
if (other_value.nSEI().is_bound()) field_nSEI = other_value.nSEI();
else field_nSEI.clean_up();
}

void PDU__BSSGP__FLUSH__LL__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_flush__Action.clean_up();
field_bVCI__new.clean_up();
field_number__of__octets__affected.clean_up();
field_nSEI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLUSH__LL__ACK::get_descriptor() const { return &PDU__BSSGP__FLUSH__LL__ACK_descr_; }
PDU__BSSGP__FLUSH__LL__ACK& PDU__BSSGP__FLUSH__LL__ACK::operator=(const PDU__BSSGP__FLUSH__LL__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.flush__Action().is_bound()) field_flush__Action = other_value.flush__Action();
  else field_flush__Action.clean_up();
  if (other_value.bVCI__new().is_bound()) field_bVCI__new = other_value.bVCI__new();
  else field_bVCI__new.clean_up();
  if (other_value.number__of__octets__affected().is_bound()) field_number__of__octets__affected = other_value.number__of__octets__affected();
  else field_number__of__octets__affected.clean_up();
  if (other_value.nSEI().is_bound()) field_nSEI = other_value.nSEI();
  else field_nSEI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLUSH__LL__ACK::operator==(const PDU__BSSGP__FLUSH__LL__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_flush__Action==other_value.field_flush__Action
  && field_bVCI__new==other_value.field_bVCI__new
  && field_number__of__octets__affected==other_value.field_number__of__octets__affected
  && field_nSEI==other_value.field_nSEI;
}

boolean PDU__BSSGP__FLUSH__LL__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_flush__Action.is_bound())
  || (OPTIONAL_OMIT == field_bVCI__new.get_selection() || field_bVCI__new.is_bound())
  || (field_number__of__octets__affected.is_bound())
  || (OPTIONAL_OMIT == field_nSEI.get_selection() || field_nSEI.is_bound());
}
boolean PDU__BSSGP__FLUSH__LL__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_flush__Action.is_value()
  && (OPTIONAL_OMIT == field_bVCI__new.get_selection() || field_bVCI__new.is_value())
  && field_number__of__octets__affected.is_value()
  && (OPTIONAL_OMIT == field_nSEI.get_selection() || field_nSEI.is_value());
}
int PDU__BSSGP__FLUSH__LL__ACK::size_of() const
{
  int ret_val = 4;
  if (field_bVCI__new.ispresent()) ret_val++;
  if (field_nSEI.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__FLUSH__LL__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", flush_Action := ");
field_flush__Action.log();
TTCN_Logger::log_event_str(", bVCI_new := ");
field_bVCI__new.log();
TTCN_Logger::log_event_str(", number_of_octets_affected := ");
field_number__of__octets__affected.log();
TTCN_Logger::log_event_str(", nSEI := ");
field_nSEI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLUSH__LL__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (flush__Action().is_bound()) flush__Action().set_implicit_omit();
if (!bVCI__new().is_bound()) bVCI__new() = OMIT_VALUE;
else bVCI__new().set_implicit_omit();
if (number__of__octets__affected().is_bound()) number__of__octets__affected().set_implicit_omit();
if (!nSEI().is_bound()) nSEI() = OMIT_VALUE;
else nSEI().set_implicit_omit();
}

void PDU__BSSGP__FLUSH__LL__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) flush__Action().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bVCI__new().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) number__of__octets__affected().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nSEI().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flush_Action")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flush__Action().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI_new")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI__new().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_octets_affected")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__octets__affected().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK");
  }
}

void PDU__BSSGP__FLUSH__LL__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_flush__Action.encode_text(text_buf);
field_bVCI__new.encode_text(text_buf);
field_number__of__octets__affected.encode_text(text_buf);
field_nSEI.encode_text(text_buf);
}

void PDU__BSSGP__FLUSH__LL__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_flush__Action.decode_text(text_buf);
field_bVCI__new.decode_text(text_buf);
field_number__of__octets__affected.decode_text(text_buf);
field_nSEI.decode_text(text_buf);
}

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

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

int PDU__BSSGP__FLUSH__LL__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Flush__Action_descr_.raw->forceomit);
  decoded_field_length = field_flush__Action.RAW_decode(Flush__Action_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_bVCI__new = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI__new().RAW_decode(BVCI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_bVCI__new = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bVCI__new=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Number__of__octets__affected_descr_.raw->forceomit);
  decoded_field_length = field_number__of__octets__affected.RAW_decode(Number__of__octets__affected_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_nSEI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, NSEI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_nSEI().RAW_decode(NSEI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_nSEI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_nSEI=OMIT_VALUE;
  if (field_bssgpPduType !=  os_57) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__FLUSH__LL__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Flush__Action_descr_.raw);
  if (field_bVCI__new.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BVCI_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Number__of__octets__affected_descr_.raw);
  if (field_nSEI.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, NSEI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_flush__Action.RAW_encode(Flush__Action_descr_, *myleaf.body.node.nodes[2]);
  if (field_bVCI__new.ispresent()) {
  encoded_length += field_bVCI__new().RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_number__of__octets__affected.RAW_encode(Number__of__octets__affected_descr_, *myleaf.body.node.nodes[4]);
  if (field_nSEI.ispresent()) {
  encoded_length += field_nSEI().RAW_encode(NSEI__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_bssgpPduType !=  os_57) {
  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_57.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLUSH__LL__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Flush__Action_template field_flush__Action;
BVCI_template field_bVCI__new;
Number__of__octets__affected_template field_number__of__octets__affected;
NSEI__BSSGP_template field_nSEI;
};

void PDU__BSSGP__FLUSH__LL__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_flush__Action = ANY_VALUE;
single_value->field_bVCI__new = ANY_OR_OMIT;
single_value->field_number__of__octets__affected = ANY_VALUE;
single_value->field_nSEI = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__FLUSH__LL__ACK_template::copy_value(const PDU__BSSGP__FLUSH__LL__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.flush__Action().is_bound()) {
  single_value->field_flush__Action = other_value.flush__Action();
} else {
  single_value->field_flush__Action.clean_up();
}
if (other_value.bVCI__new().is_bound()) {
  if (other_value.bVCI__new().ispresent()) single_value->field_bVCI__new = other_value.bVCI__new()();
  else single_value->field_bVCI__new = OMIT_VALUE;
} else {
  single_value->field_bVCI__new.clean_up();
}
if (other_value.number__of__octets__affected().is_bound()) {
  single_value->field_number__of__octets__affected = other_value.number__of__octets__affected();
} else {
  single_value->field_number__of__octets__affected.clean_up();
}
if (other_value.nSEI().is_bound()) {
  if (other_value.nSEI().ispresent()) single_value->field_nSEI = other_value.nSEI()();
  else single_value->field_nSEI = OMIT_VALUE;
} else {
  single_value->field_nSEI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLUSH__LL__ACK_template::copy_template(const PDU__BSSGP__FLUSH__LL__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flush__Action().get_selection()) {
single_value->field_flush__Action = other_value.flush__Action();
} else {
single_value->field_flush__Action.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI__new().get_selection()) {
single_value->field_bVCI__new = other_value.bVCI__new();
} else {
single_value->field_bVCI__new.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.number__of__octets__affected().get_selection()) {
single_value->field_number__of__octets__affected = other_value.number__of__octets__affected();
} else {
single_value->field_number__of__octets__affected.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nSEI().get_selection()) {
single_value->field_nSEI = other_value.nSEI();
} else {
single_value->field_nSEI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLUSH__LL__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__FLUSH__LL__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLUSH__LL__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLUSH__LL__ACK_template::PDU__BSSGP__FLUSH__LL__ACK_template()
{
}

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

PDU__BSSGP__FLUSH__LL__ACK_template::PDU__BSSGP__FLUSH__LL__ACK_template(const PDU__BSSGP__FLUSH__LL__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLUSH__LL__ACK_template::match(const PDU__BSSGP__FLUSH__LL__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.flush__Action().is_bound()) return FALSE;
if(!single_value->field_flush__Action.match(other_value.flush__Action(), legacy))return FALSE;
if(!other_value.bVCI__new().is_bound()) return FALSE;
if((other_value.bVCI__new().ispresent() ? !single_value->field_bVCI__new.match((const BVCI&)other_value.bVCI__new(), legacy) : !single_value->field_bVCI__new.match_omit(legacy)))return FALSE;
if(!other_value.number__of__octets__affected().is_bound()) return FALSE;
if(!single_value->field_number__of__octets__affected.match(other_value.number__of__octets__affected(), legacy))return FALSE;
if(!other_value.nSEI().is_bound()) return FALSE;
if((other_value.nSEI().ispresent() ? !single_value->field_nSEI.match((const NSEI__BSSGP&)other_value.nSEI(), legacy) : !single_value->field_nSEI.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__FLUSH__LL__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_flush__Action.is_bound()
 || (single_value->field_bVCI__new.is_omit() || single_value->field_bVCI__new.is_bound())
 || single_value->field_number__of__octets__affected.is_bound()
 || (single_value->field_nSEI.is_omit() || single_value->field_nSEI.is_bound());
}

boolean PDU__BSSGP__FLUSH__LL__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_flush__Action.is_value()
 && (single_value->field_bVCI__new.is_omit() || single_value->field_bVCI__new.is_value())
 && single_value->field_number__of__octets__affected.is_value()
 && (single_value->field_nSEI.is_omit() || single_value->field_nSEI.is_value());
}

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

PDU__BSSGP__FLUSH__LL__ACK PDU__BSSGP__FLUSH__LL__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
PDU__BSSGP__FLUSH__LL__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_flush__Action.is_bound()) {
ret_val.flush__Action() = single_value->field_flush__Action.valueof();
}
if (single_value->field_bVCI__new.is_omit()) ret_val.bVCI__new() = OMIT_VALUE;
else if (single_value->field_bVCI__new.is_bound()) {
ret_val.bVCI__new() = single_value->field_bVCI__new.valueof();
}
if (single_value->field_number__of__octets__affected.is_bound()) {
ret_val.number__of__octets__affected() = single_value->field_number__of__octets__affected.valueof();
}
if (single_value->field_nSEI.is_omit()) ret_val.nSEI() = OMIT_VALUE;
else if (single_value->field_nSEI.is_bound()) {
ret_val.nSEI() = single_value->field_nSEI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLUSH__LL__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLUSH__LL__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__FLUSH__LL__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__FLUSH__LL__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
return single_value->field_tLLI;
}

Flush__Action_template& PDU__BSSGP__FLUSH__LL__ACK_template::flush__Action()
{
set_specific();
return single_value->field_flush__Action;
}

const Flush__Action_template& PDU__BSSGP__FLUSH__LL__ACK_template::flush__Action() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flush_Action of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
return single_value->field_flush__Action;
}

BVCI_template& PDU__BSSGP__FLUSH__LL__ACK_template::bVCI__new()
{
set_specific();
return single_value->field_bVCI__new;
}

const BVCI_template& PDU__BSSGP__FLUSH__LL__ACK_template::bVCI__new() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI_new of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
return single_value->field_bVCI__new;
}

Number__of__octets__affected_template& PDU__BSSGP__FLUSH__LL__ACK_template::number__of__octets__affected()
{
set_specific();
return single_value->field_number__of__octets__affected;
}

const Number__of__octets__affected_template& PDU__BSSGP__FLUSH__LL__ACK_template::number__of__octets__affected() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_octets_affected of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
return single_value->field_number__of__octets__affected;
}

NSEI__BSSGP_template& PDU__BSSGP__FLUSH__LL__ACK_template::nSEI()
{
set_specific();
return single_value->field_nSEI;
}

const NSEI__BSSGP_template& PDU__BSSGP__FLUSH__LL__ACK_template::nSEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSEI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
return single_value->field_nSEI;
}

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

void PDU__BSSGP__FLUSH__LL__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", flush_Action := ");
single_value->field_flush__Action.log();
TTCN_Logger::log_event_str(", bVCI_new := ");
single_value->field_bVCI__new.log();
TTCN_Logger::log_event_str(", number_of_octets_affected := ");
single_value->field_number__of__octets__affected.log();
TTCN_Logger::log_event_str(", nSEI := ");
single_value->field_nSEI.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__FLUSH__LL__ACK_template::log_match(const PDU__BSSGP__FLUSH__LL__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flush__Action.match(match_value.flush__Action(), legacy)){
TTCN_Logger::log_logmatch_info(".flush_Action");
single_value->field_flush__Action.log_match(match_value.flush__Action(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.bVCI__new().ispresent()){
if(!single_value->field_bVCI__new.match(match_value.bVCI__new(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI_new");
single_value->field_bVCI__new.log_match(match_value.bVCI__new(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bVCI__new.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bVCI_new := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bVCI__new.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_number__of__octets__affected.match(match_value.number__of__octets__affected(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_octets_affected");
single_value->field_number__of__octets__affected.log_match(match_value.number__of__octets__affected(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.nSEI().ispresent()){
if(!single_value->field_nSEI.match(match_value.nSEI(), legacy)){
TTCN_Logger::log_logmatch_info(".nSEI");
single_value->field_nSEI.log_match(match_value.nSEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nSEI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nSEI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nSEI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", flush_Action := ");
single_value->field_flush__Action.log_match(match_value.flush__Action(), legacy);
TTCN_Logger::log_event_str(", bVCI_new := ");
if (match_value.bVCI__new().ispresent()) {
single_value->field_bVCI__new.log_match(match_value.bVCI__new(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bVCI__new.log();
if (single_value->field_bVCI__new.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", number_of_octets_affected := ");
single_value->field_number__of__octets__affected.log_match(match_value.number__of__octets__affected(), legacy);
TTCN_Logger::log_event_str(", nSEI := ");
if (match_value.nSEI().ispresent()) {
single_value->field_nSEI.log_match(match_value.nSEI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nSEI.log();
if (single_value->field_nSEI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__FLUSH__LL__ACK_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_flush__Action.decode_text(text_buf);
single_value->field_bVCI__new.decode_text(text_buf);
single_value->field_number__of__octets__affected.decode_text(text_buf);
single_value->field_nSEI.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__FLUSH__LL__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_FLUSH_LL_ACK.");
}
}

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

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

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

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

PDU__BSSGP__LLC__DISCARDED::PDU__BSSGP__LLC__DISCARDED()
{
}

PDU__BSSGP__LLC__DISCARDED::PDU__BSSGP__LLC__DISCARDED(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const LLC__Frames__Discarded& par_lLC__Frames__Discarded,
    const BVCI& par_bVCI,
    const Number__of__octets__affected& par_number__of__octets__deleted,
    const OPTIONAL< PFI >& par_pFI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_lLC__Frames__Discarded(par_lLC__Frames__Discarded),
  field_bVCI(par_bVCI),
  field_number__of__octets__deleted(par_number__of__octets__deleted),
  field_pFI(par_pFI)
{
}

PDU__BSSGP__LLC__DISCARDED::PDU__BSSGP__LLC__DISCARDED(const PDU__BSSGP__LLC__DISCARDED& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.lLC__Frames__Discarded().is_bound()) field_lLC__Frames__Discarded = other_value.lLC__Frames__Discarded();
else field_lLC__Frames__Discarded.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.number__of__octets__deleted().is_bound()) field_number__of__octets__deleted = other_value.number__of__octets__deleted();
else field_number__of__octets__deleted.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
}

void PDU__BSSGP__LLC__DISCARDED::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_lLC__Frames__Discarded.clean_up();
field_bVCI.clean_up();
field_number__of__octets__deleted.clean_up();
field_pFI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__LLC__DISCARDED::get_descriptor() const { return &PDU__BSSGP__LLC__DISCARDED_descr_; }
PDU__BSSGP__LLC__DISCARDED& PDU__BSSGP__LLC__DISCARDED::operator=(const PDU__BSSGP__LLC__DISCARDED& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.lLC__Frames__Discarded().is_bound()) field_lLC__Frames__Discarded = other_value.lLC__Frames__Discarded();
  else field_lLC__Frames__Discarded.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.number__of__octets__deleted().is_bound()) field_number__of__octets__deleted = other_value.number__of__octets__deleted();
  else field_number__of__octets__deleted.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__LLC__DISCARDED::operator==(const PDU__BSSGP__LLC__DISCARDED& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_lLC__Frames__Discarded==other_value.field_lLC__Frames__Discarded
  && field_bVCI==other_value.field_bVCI
  && field_number__of__octets__deleted==other_value.field_number__of__octets__deleted
  && field_pFI==other_value.field_pFI;
}

boolean PDU__BSSGP__LLC__DISCARDED::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_lLC__Frames__Discarded.is_bound())
  || (field_bVCI.is_bound())
  || (field_number__of__octets__deleted.is_bound())
  || (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_bound());
}
boolean PDU__BSSGP__LLC__DISCARDED::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_lLC__Frames__Discarded.is_value()
  && field_bVCI.is_value()
  && field_number__of__octets__deleted.is_value()
  && (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_value());
}
int PDU__BSSGP__LLC__DISCARDED::size_of() const
{
  int ret_val = 5;
  if (field_pFI.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__LLC__DISCARDED::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", lLC_Frames_Discarded := ");
field_lLC__Frames__Discarded.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", number_of_octets_deleted := ");
field_number__of__octets__deleted.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__LLC__DISCARDED::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (lLC__Frames__Discarded().is_bound()) lLC__Frames__Discarded().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (number__of__octets__deleted().is_bound()) number__of__octets__deleted().set_implicit_omit();
if (!pFI().is_bound()) pFI() = OMIT_VALUE;
else pFI().set_implicit_omit();
}

void PDU__BSSGP__LLC__DISCARDED::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lLC__Frames__Discarded().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) number__of__octets__deleted().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_Frames_Discarded")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__Frames__Discarded().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_octets_deleted")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__octets__deleted().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_LLC_DISCARDED");
  }
}

void PDU__BSSGP__LLC__DISCARDED::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_lLC__Frames__Discarded.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_number__of__octets__deleted.encode_text(text_buf);
field_pFI.encode_text(text_buf);
}

void PDU__BSSGP__LLC__DISCARDED::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_lLC__Frames__Discarded.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_number__of__octets__deleted.decode_text(text_buf);
field_pFI.decode_text(text_buf);
}

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

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

int PDU__BSSGP__LLC__DISCARDED::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, LLC__Frames__Discarded_descr_.raw->forceomit);
  decoded_field_length = field_lLC__Frames__Discarded.RAW_decode(LLC__Frames__Discarded_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, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_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, Number__of__octets__affected_descr_.raw->forceomit);
  decoded_field_length = field_number__of__octets__deleted.RAW_decode(Number__of__octets__affected_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_pFI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI().RAW_decode(PFI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_pFI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pFI=OMIT_VALUE;
  if (field_bssgpPduType !=  os_58) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__LLC__DISCARDED::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, LLC__Frames__Discarded_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BVCI_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Number__of__octets__affected_descr_.raw);
  if (field_pFI.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, PFI_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lLC__Frames__Discarded.RAW_encode(LLC__Frames__Discarded_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_number__of__octets__deleted.RAW_encode(Number__of__octets__affected_descr_, *myleaf.body.node.nodes[4]);
  if (field_pFI.ispresent()) {
  encoded_length += field_pFI().RAW_encode(PFI_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_bssgpPduType !=  os_58) {
  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_58.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__LLC__DISCARDED_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
LLC__Frames__Discarded_template field_lLC__Frames__Discarded;
BVCI_template field_bVCI;
Number__of__octets__affected_template field_number__of__octets__deleted;
PFI_template field_pFI;
};

void PDU__BSSGP__LLC__DISCARDED_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_lLC__Frames__Discarded = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_number__of__octets__deleted = ANY_VALUE;
single_value->field_pFI = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__LLC__DISCARDED_template::copy_value(const PDU__BSSGP__LLC__DISCARDED& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.lLC__Frames__Discarded().is_bound()) {
  single_value->field_lLC__Frames__Discarded = other_value.lLC__Frames__Discarded();
} else {
  single_value->field_lLC__Frames__Discarded.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.number__of__octets__deleted().is_bound()) {
  single_value->field_number__of__octets__deleted = other_value.number__of__octets__deleted();
} else {
  single_value->field_number__of__octets__deleted.clean_up();
}
if (other_value.pFI().is_bound()) {
  if (other_value.pFI().ispresent()) single_value->field_pFI = other_value.pFI()();
  else single_value->field_pFI = OMIT_VALUE;
} else {
  single_value->field_pFI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__LLC__DISCARDED_template::copy_template(const PDU__BSSGP__LLC__DISCARDED_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lLC__Frames__Discarded().get_selection()) {
single_value->field_lLC__Frames__Discarded = other_value.lLC__Frames__Discarded();
} else {
single_value->field_lLC__Frames__Discarded.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.number__of__octets__deleted().get_selection()) {
single_value->field_number__of__octets__deleted = other_value.number__of__octets__deleted();
} else {
single_value->field_number__of__octets__deleted.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__LLC__DISCARDED_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__LLC__DISCARDED_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__LLC__DISCARDED_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__LLC__DISCARDED_template::PDU__BSSGP__LLC__DISCARDED_template()
{
}

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

PDU__BSSGP__LLC__DISCARDED_template::PDU__BSSGP__LLC__DISCARDED_template(const PDU__BSSGP__LLC__DISCARDED& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__LLC__DISCARDED_template::match(const PDU__BSSGP__LLC__DISCARDED& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.lLC__Frames__Discarded().is_bound()) return FALSE;
if(!single_value->field_lLC__Frames__Discarded.match(other_value.lLC__Frames__Discarded(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.number__of__octets__deleted().is_bound()) return FALSE;
if(!single_value->field_number__of__octets__deleted.match(other_value.number__of__octets__deleted(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if((other_value.pFI().ispresent() ? !single_value->field_pFI.match((const PFI&)other_value.pFI(), legacy) : !single_value->field_pFI.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
}
return FALSE;
}

boolean PDU__BSSGP__LLC__DISCARDED_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_lLC__Frames__Discarded.is_bound()
 || single_value->field_bVCI.is_bound()
 || single_value->field_number__of__octets__deleted.is_bound()
 || (single_value->field_pFI.is_omit() || single_value->field_pFI.is_bound());
}

boolean PDU__BSSGP__LLC__DISCARDED_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_lLC__Frames__Discarded.is_value()
 && single_value->field_bVCI.is_value()
 && single_value->field_number__of__octets__deleted.is_value()
 && (single_value->field_pFI.is_omit() || single_value->field_pFI.is_value());
}

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

PDU__BSSGP__LLC__DISCARDED PDU__BSSGP__LLC__DISCARDED_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
PDU__BSSGP__LLC__DISCARDED ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_lLC__Frames__Discarded.is_bound()) {
ret_val.lLC__Frames__Discarded() = single_value->field_lLC__Frames__Discarded.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_number__of__octets__deleted.is_bound()) {
ret_val.number__of__octets__deleted() = single_value->field_number__of__octets__deleted.valueof();
}
if (single_value->field_pFI.is_omit()) ret_val.pFI() = OMIT_VALUE;
else if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__LLC__DISCARDED_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__LLC__DISCARDED_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__LLC__DISCARDED_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__LLC__DISCARDED_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
return single_value->field_tLLI;
}

LLC__Frames__Discarded_template& PDU__BSSGP__LLC__DISCARDED_template::lLC__Frames__Discarded()
{
set_specific();
return single_value->field_lLC__Frames__Discarded;
}

const LLC__Frames__Discarded_template& PDU__BSSGP__LLC__DISCARDED_template::lLC__Frames__Discarded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lLC_Frames_Discarded of a non-specific template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
return single_value->field_lLC__Frames__Discarded;
}

BVCI_template& PDU__BSSGP__LLC__DISCARDED_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__LLC__DISCARDED_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
return single_value->field_bVCI;
}

Number__of__octets__affected_template& PDU__BSSGP__LLC__DISCARDED_template::number__of__octets__deleted()
{
set_specific();
return single_value->field_number__of__octets__deleted;
}

const Number__of__octets__affected_template& PDU__BSSGP__LLC__DISCARDED_template::number__of__octets__deleted() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_octets_deleted of a non-specific template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
return single_value->field_number__of__octets__deleted;
}

PFI_template& PDU__BSSGP__LLC__DISCARDED_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__LLC__DISCARDED_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
return single_value->field_pFI;
}

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

void PDU__BSSGP__LLC__DISCARDED_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", lLC_Frames_Discarded := ");
single_value->field_lLC__Frames__Discarded.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", number_of_octets_deleted := ");
single_value->field_number__of__octets__deleted.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__LLC__DISCARDED_template::log_match(const PDU__BSSGP__LLC__DISCARDED& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lLC__Frames__Discarded.match(match_value.lLC__Frames__Discarded(), legacy)){
TTCN_Logger::log_logmatch_info(".lLC_Frames_Discarded");
single_value->field_lLC__Frames__Discarded.log_match(match_value.lLC__Frames__Discarded(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_number__of__octets__deleted.match(match_value.number__of__octets__deleted(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_octets_deleted");
single_value->field_number__of__octets__deleted.log_match(match_value.number__of__octets__deleted(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pFI().ispresent()){
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pFI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pFI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", lLC_Frames_Discarded := ");
single_value->field_lLC__Frames__Discarded.log_match(match_value.lLC__Frames__Discarded(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", number_of_octets_deleted := ");
single_value->field_number__of__octets__deleted.log_match(match_value.number__of__octets__deleted(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
if (match_value.pFI().ispresent()) {
single_value->field_pFI.log_match(match_value.pFI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pFI.log();
if (single_value->field_pFI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__LLC__DISCARDED_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_lLC__Frames__Discarded.decode_text(text_buf);
single_value->field_bVCI.decode_text(text_buf);
single_value->field_number__of__octets__deleted.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__LLC__DISCARDED_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_LLC_DISCARDED.");
}
}

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

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

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

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

PDU__BSSGP__FLOW__CONTROL__BVC::PDU__BSSGP__FLOW__CONTROL__BVC()
{
}

PDU__BSSGP__FLOW__CONTROL__BVC::PDU__BSSGP__FLOW__CONTROL__BVC(const OCTETSTRING& par_bssgpPduType,
    const Tag& par_tag,
    const BVC__Bucket__Size& par_bVC__Bucket__Size,
    const Bucket__Leak__Rate& par_bucket__Leak__Rate,
    const Bmax__default__MS& par_bmax__default__MS,
    const R__default__MS& par_r__default__MS,
    const OPTIONAL< Bucket__Full__Ratio >& par_bucket__Full__Ratio,
    const OPTIONAL< BVC__Measurement >& par_bVC__Measurement,
    const OPTIONAL< Flow__Control__Granularity >& par_flow__Control__Granularity)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tag(par_tag),
  field_bVC__Bucket__Size(par_bVC__Bucket__Size),
  field_bucket__Leak__Rate(par_bucket__Leak__Rate),
  field_bmax__default__MS(par_bmax__default__MS),
  field_r__default__MS(par_r__default__MS),
  field_bucket__Full__Ratio(par_bucket__Full__Ratio),
  field_bVC__Measurement(par_bVC__Measurement),
  field_flow__Control__Granularity(par_flow__Control__Granularity)
{
}

PDU__BSSGP__FLOW__CONTROL__BVC::PDU__BSSGP__FLOW__CONTROL__BVC(const PDU__BSSGP__FLOW__CONTROL__BVC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.bVC__Bucket__Size().is_bound()) field_bVC__Bucket__Size = other_value.bVC__Bucket__Size();
else field_bVC__Bucket__Size.clean_up();
if (other_value.bucket__Leak__Rate().is_bound()) field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
else field_bucket__Leak__Rate.clean_up();
if (other_value.bmax__default__MS().is_bound()) field_bmax__default__MS = other_value.bmax__default__MS();
else field_bmax__default__MS.clean_up();
if (other_value.r__default__MS().is_bound()) field_r__default__MS = other_value.r__default__MS();
else field_r__default__MS.clean_up();
if (other_value.bucket__Full__Ratio().is_bound()) field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
else field_bucket__Full__Ratio.clean_up();
if (other_value.bVC__Measurement().is_bound()) field_bVC__Measurement = other_value.bVC__Measurement();
else field_bVC__Measurement.clean_up();
if (other_value.flow__Control__Granularity().is_bound()) field_flow__Control__Granularity = other_value.flow__Control__Granularity();
else field_flow__Control__Granularity.clean_up();
}

void PDU__BSSGP__FLOW__CONTROL__BVC::clean_up()
{
field_bssgpPduType.clean_up();
field_tag.clean_up();
field_bVC__Bucket__Size.clean_up();
field_bucket__Leak__Rate.clean_up();
field_bmax__default__MS.clean_up();
field_r__default__MS.clean_up();
field_bucket__Full__Ratio.clean_up();
field_bVC__Measurement.clean_up();
field_flow__Control__Granularity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLOW__CONTROL__BVC::get_descriptor() const { return &PDU__BSSGP__FLOW__CONTROL__BVC_descr_; }
PDU__BSSGP__FLOW__CONTROL__BVC& PDU__BSSGP__FLOW__CONTROL__BVC::operator=(const PDU__BSSGP__FLOW__CONTROL__BVC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.bVC__Bucket__Size().is_bound()) field_bVC__Bucket__Size = other_value.bVC__Bucket__Size();
  else field_bVC__Bucket__Size.clean_up();
  if (other_value.bucket__Leak__Rate().is_bound()) field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
  else field_bucket__Leak__Rate.clean_up();
  if (other_value.bmax__default__MS().is_bound()) field_bmax__default__MS = other_value.bmax__default__MS();
  else field_bmax__default__MS.clean_up();
  if (other_value.r__default__MS().is_bound()) field_r__default__MS = other_value.r__default__MS();
  else field_r__default__MS.clean_up();
  if (other_value.bucket__Full__Ratio().is_bound()) field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
  else field_bucket__Full__Ratio.clean_up();
  if (other_value.bVC__Measurement().is_bound()) field_bVC__Measurement = other_value.bVC__Measurement();
  else field_bVC__Measurement.clean_up();
  if (other_value.flow__Control__Granularity().is_bound()) field_flow__Control__Granularity = other_value.flow__Control__Granularity();
  else field_flow__Control__Granularity.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLOW__CONTROL__BVC::operator==(const PDU__BSSGP__FLOW__CONTROL__BVC& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tag==other_value.field_tag
  && field_bVC__Bucket__Size==other_value.field_bVC__Bucket__Size
  && field_bucket__Leak__Rate==other_value.field_bucket__Leak__Rate
  && field_bmax__default__MS==other_value.field_bmax__default__MS
  && field_r__default__MS==other_value.field_r__default__MS
  && field_bucket__Full__Ratio==other_value.field_bucket__Full__Ratio
  && field_bVC__Measurement==other_value.field_bVC__Measurement
  && field_flow__Control__Granularity==other_value.field_flow__Control__Granularity;
}

boolean PDU__BSSGP__FLOW__CONTROL__BVC::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tag.is_bound())
  || (field_bVC__Bucket__Size.is_bound())
  || (field_bucket__Leak__Rate.is_bound())
  || (field_bmax__default__MS.is_bound())
  || (field_r__default__MS.is_bound())
  || (OPTIONAL_OMIT == field_bucket__Full__Ratio.get_selection() || field_bucket__Full__Ratio.is_bound())
  || (OPTIONAL_OMIT == field_bVC__Measurement.get_selection() || field_bVC__Measurement.is_bound())
  || (OPTIONAL_OMIT == field_flow__Control__Granularity.get_selection() || field_flow__Control__Granularity.is_bound());
}
boolean PDU__BSSGP__FLOW__CONTROL__BVC::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tag.is_value()
  && field_bVC__Bucket__Size.is_value()
  && field_bucket__Leak__Rate.is_value()
  && field_bmax__default__MS.is_value()
  && field_r__default__MS.is_value()
  && (OPTIONAL_OMIT == field_bucket__Full__Ratio.get_selection() || field_bucket__Full__Ratio.is_value())
  && (OPTIONAL_OMIT == field_bVC__Measurement.get_selection() || field_bVC__Measurement.is_value())
  && (OPTIONAL_OMIT == field_flow__Control__Granularity.get_selection() || field_flow__Control__Granularity.is_value());
}
int PDU__BSSGP__FLOW__CONTROL__BVC::size_of() const
{
  int ret_val = 6;
  if (field_bucket__Full__Ratio.ispresent()) ret_val++;
  if (field_bVC__Measurement.ispresent()) ret_val++;
  if (field_flow__Control__Granularity.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__FLOW__CONTROL__BVC::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", bVC_Bucket_Size := ");
field_bVC__Bucket__Size.log();
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
field_bucket__Leak__Rate.log();
TTCN_Logger::log_event_str(", bmax_default_MS := ");
field_bmax__default__MS.log();
TTCN_Logger::log_event_str(", r_default_MS := ");
field_r__default__MS.log();
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(", bVC_Measurement := ");
field_bVC__Measurement.log();
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLOW__CONTROL__BVC::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
if (bVC__Bucket__Size().is_bound()) bVC__Bucket__Size().set_implicit_omit();
if (bucket__Leak__Rate().is_bound()) bucket__Leak__Rate().set_implicit_omit();
if (bmax__default__MS().is_bound()) bmax__default__MS().set_implicit_omit();
if (r__default__MS().is_bound()) r__default__MS().set_implicit_omit();
if (!bucket__Full__Ratio().is_bound()) bucket__Full__Ratio() = OMIT_VALUE;
else bucket__Full__Ratio().set_implicit_omit();
if (!bVC__Measurement().is_bound()) bVC__Measurement() = OMIT_VALUE;
else bVC__Measurement().set_implicit_omit();
if (!flow__Control__Granularity().is_bound()) flow__Control__Granularity() = OMIT_VALUE;
else flow__Control__Granularity().set_implicit_omit();
}

void PDU__BSSGP__FLOW__CONTROL__BVC::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVC__Bucket__Size().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bucket__Leak__Rate().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bmax__default__MS().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) r__default__MS().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) bucket__Full__Ratio().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) bVC__Measurement().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) flow__Control__Granularity().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVC_Bucket_Size")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVC__Bucket__Size().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Leak_Rate")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Leak__Rate().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_default_MS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bmax__default__MS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_default_MS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          r__default__MS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Full_Ratio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Full__Ratio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVC_Measurement")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVC__Measurement().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flow_Control_Granularity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flow__Control__Granularity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
  }
}

void PDU__BSSGP__FLOW__CONTROL__BVC::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tag.encode_text(text_buf);
field_bVC__Bucket__Size.encode_text(text_buf);
field_bucket__Leak__Rate.encode_text(text_buf);
field_bmax__default__MS.encode_text(text_buf);
field_r__default__MS.encode_text(text_buf);
field_bucket__Full__Ratio.encode_text(text_buf);
field_bVC__Measurement.encode_text(text_buf);
field_flow__Control__Granularity.encode_text(text_buf);
}

void PDU__BSSGP__FLOW__CONTROL__BVC::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tag.decode_text(text_buf);
field_bVC__Bucket__Size.decode_text(text_buf);
field_bucket__Leak__Rate.decode_text(text_buf);
field_bmax__default__MS.decode_text(text_buf);
field_r__default__MS.decode_text(text_buf);
field_bucket__Full__Ratio.decode_text(text_buf);
field_bVC__Measurement.decode_text(text_buf);
field_flow__Control__Granularity.decode_text(text_buf);
}

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

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

int PDU__BSSGP__FLOW__CONTROL__BVC::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, Tag_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(Tag_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, BVC__Bucket__Size_descr_.raw->forceomit);
  decoded_field_length = field_bVC__Bucket__Size.RAW_decode(BVC__Bucket__Size_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, Bucket__Leak__Rate_descr_.raw->forceomit);
  decoded_field_length = field_bucket__Leak__Rate.RAW_decode(Bucket__Leak__Rate_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, Bmax__default__MS_descr_.raw->forceomit);
  decoded_field_length = field_bmax__default__MS.RAW_decode(Bmax__default__MS_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, R__default__MS_descr_.raw->forceomit);
  decoded_field_length = field_r__default__MS.RAW_decode(R__default__MS_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_bucket__Full__Ratio = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, Bucket__Full__Ratio_descr_.raw->forceomit);
  decoded_field_length = field_bucket__Full__Ratio().RAW_decode(Bucket__Full__Ratio_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_bucket__Full__Ratio = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bucket__Full__Ratio=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_bVC__Measurement = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, BVC__Measurement_descr_.raw->forceomit);
  decoded_field_length = field_bVC__Measurement().RAW_decode(BVC__Measurement_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_bVC__Measurement = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bVC__Measurement=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_flow__Control__Granularity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, Flow__Control__Granularity_descr_.raw->forceomit);
  decoded_field_length = field_flow__Control__Granularity().RAW_decode(Flow__Control__Granularity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_flow__Control__Granularity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_flow__Control__Granularity=OMIT_VALUE;
  if (field_bssgpPduType !=  os_22) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__FLOW__CONTROL__BVC::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, Tag_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BVC__Bucket__Size_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Bucket__Leak__Rate_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Bmax__default__MS_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, R__default__MS_descr_.raw);
  if (field_bucket__Full__Ratio.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Bucket__Full__Ratio_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_bVC__Measurement.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, BVC__Measurement_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_flow__Control__Granularity.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, Flow__Control__Granularity_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_bVC__Bucket__Size.RAW_encode(BVC__Bucket__Size_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_bucket__Leak__Rate.RAW_encode(Bucket__Leak__Rate_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_bmax__default__MS.RAW_encode(Bmax__default__MS_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_r__default__MS.RAW_encode(R__default__MS_descr_, *myleaf.body.node.nodes[5]);
  if (field_bucket__Full__Ratio.ispresent()) {
  encoded_length += field_bucket__Full__Ratio().RAW_encode(Bucket__Full__Ratio_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_bVC__Measurement.ispresent()) {
  encoded_length += field_bVC__Measurement().RAW_encode(BVC__Measurement_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_flow__Control__Granularity.ispresent()) {
  encoded_length += field_flow__Control__Granularity().RAW_encode(Flow__Control__Granularity_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_bssgpPduType !=  os_22) {
  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_22.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLOW__CONTROL__BVC_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
Tag_template field_tag;
BVC__Bucket__Size_template field_bVC__Bucket__Size;
Bucket__Leak__Rate_template field_bucket__Leak__Rate;
Bmax__default__MS_template field_bmax__default__MS;
R__default__MS_template field_r__default__MS;
Bucket__Full__Ratio_template field_bucket__Full__Ratio;
BVC__Measurement_template field_bVC__Measurement;
Flow__Control__Granularity_template field_flow__Control__Granularity;
};

void PDU__BSSGP__FLOW__CONTROL__BVC_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tag = ANY_VALUE;
single_value->field_bVC__Bucket__Size = ANY_VALUE;
single_value->field_bucket__Leak__Rate = ANY_VALUE;
single_value->field_bmax__default__MS = ANY_VALUE;
single_value->field_r__default__MS = ANY_VALUE;
single_value->field_bucket__Full__Ratio = ANY_OR_OMIT;
single_value->field_bVC__Measurement = ANY_OR_OMIT;
single_value->field_flow__Control__Granularity = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__FLOW__CONTROL__BVC_template::copy_value(const PDU__BSSGP__FLOW__CONTROL__BVC& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.bVC__Bucket__Size().is_bound()) {
  single_value->field_bVC__Bucket__Size = other_value.bVC__Bucket__Size();
} else {
  single_value->field_bVC__Bucket__Size.clean_up();
}
if (other_value.bucket__Leak__Rate().is_bound()) {
  single_value->field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
} else {
  single_value->field_bucket__Leak__Rate.clean_up();
}
if (other_value.bmax__default__MS().is_bound()) {
  single_value->field_bmax__default__MS = other_value.bmax__default__MS();
} else {
  single_value->field_bmax__default__MS.clean_up();
}
if (other_value.r__default__MS().is_bound()) {
  single_value->field_r__default__MS = other_value.r__default__MS();
} else {
  single_value->field_r__default__MS.clean_up();
}
if (other_value.bucket__Full__Ratio().is_bound()) {
  if (other_value.bucket__Full__Ratio().ispresent()) single_value->field_bucket__Full__Ratio = other_value.bucket__Full__Ratio()();
  else single_value->field_bucket__Full__Ratio = OMIT_VALUE;
} else {
  single_value->field_bucket__Full__Ratio.clean_up();
}
if (other_value.bVC__Measurement().is_bound()) {
  if (other_value.bVC__Measurement().ispresent()) single_value->field_bVC__Measurement = other_value.bVC__Measurement()();
  else single_value->field_bVC__Measurement = OMIT_VALUE;
} else {
  single_value->field_bVC__Measurement.clean_up();
}
if (other_value.flow__Control__Granularity().is_bound()) {
  if (other_value.flow__Control__Granularity().ispresent()) single_value->field_flow__Control__Granularity = other_value.flow__Control__Granularity()();
  else single_value->field_flow__Control__Granularity = OMIT_VALUE;
} else {
  single_value->field_flow__Control__Granularity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLOW__CONTROL__BVC_template::copy_template(const PDU__BSSGP__FLOW__CONTROL__BVC_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVC__Bucket__Size().get_selection()) {
single_value->field_bVC__Bucket__Size = other_value.bVC__Bucket__Size();
} else {
single_value->field_bVC__Bucket__Size.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bucket__Leak__Rate().get_selection()) {
single_value->field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
} else {
single_value->field_bucket__Leak__Rate.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bmax__default__MS().get_selection()) {
single_value->field_bmax__default__MS = other_value.bmax__default__MS();
} else {
single_value->field_bmax__default__MS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.r__default__MS().get_selection()) {
single_value->field_r__default__MS = other_value.r__default__MS();
} else {
single_value->field_r__default__MS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bucket__Full__Ratio().get_selection()) {
single_value->field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
} else {
single_value->field_bucket__Full__Ratio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVC__Measurement().get_selection()) {
single_value->field_bVC__Measurement = other_value.bVC__Measurement();
} else {
single_value->field_bVC__Measurement.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flow__Control__Granularity().get_selection()) {
single_value->field_flow__Control__Granularity = other_value.flow__Control__Granularity();
} else {
single_value->field_flow__Control__Granularity.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__BVC_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__FLOW__CONTROL__BVC_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLOW__CONTROL__BVC_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLOW__CONTROL__BVC_template::PDU__BSSGP__FLOW__CONTROL__BVC_template()
{
}

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

PDU__BSSGP__FLOW__CONTROL__BVC_template::PDU__BSSGP__FLOW__CONTROL__BVC_template(const PDU__BSSGP__FLOW__CONTROL__BVC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLOW__CONTROL__BVC_template::match(const PDU__BSSGP__FLOW__CONTROL__BVC& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.bVC__Bucket__Size().is_bound()) return FALSE;
if(!single_value->field_bVC__Bucket__Size.match(other_value.bVC__Bucket__Size(), legacy))return FALSE;
if(!other_value.bucket__Leak__Rate().is_bound()) return FALSE;
if(!single_value->field_bucket__Leak__Rate.match(other_value.bucket__Leak__Rate(), legacy))return FALSE;
if(!other_value.bmax__default__MS().is_bound()) return FALSE;
if(!single_value->field_bmax__default__MS.match(other_value.bmax__default__MS(), legacy))return FALSE;
if(!other_value.r__default__MS().is_bound()) return FALSE;
if(!single_value->field_r__default__MS.match(other_value.r__default__MS(), legacy))return FALSE;
if(!other_value.bucket__Full__Ratio().is_bound()) return FALSE;
if((other_value.bucket__Full__Ratio().ispresent() ? !single_value->field_bucket__Full__Ratio.match((const Bucket__Full__Ratio&)other_value.bucket__Full__Ratio(), legacy) : !single_value->field_bucket__Full__Ratio.match_omit(legacy)))return FALSE;
if(!other_value.bVC__Measurement().is_bound()) return FALSE;
if((other_value.bVC__Measurement().ispresent() ? !single_value->field_bVC__Measurement.match((const BVC__Measurement&)other_value.bVC__Measurement(), legacy) : !single_value->field_bVC__Measurement.match_omit(legacy)))return FALSE;
if(!other_value.flow__Control__Granularity().is_bound()) return FALSE;
if((other_value.flow__Control__Granularity().ispresent() ? !single_value->field_flow__Control__Granularity.match((const Flow__Control__Granularity&)other_value.flow__Control__Granularity(), legacy) : !single_value->field_flow__Control__Granularity.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
}
return FALSE;
}

boolean PDU__BSSGP__FLOW__CONTROL__BVC_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tag.is_bound()
 || single_value->field_bVC__Bucket__Size.is_bound()
 || single_value->field_bucket__Leak__Rate.is_bound()
 || single_value->field_bmax__default__MS.is_bound()
 || single_value->field_r__default__MS.is_bound()
 || (single_value->field_bucket__Full__Ratio.is_omit() || single_value->field_bucket__Full__Ratio.is_bound())
 || (single_value->field_bVC__Measurement.is_omit() || single_value->field_bVC__Measurement.is_bound())
 || (single_value->field_flow__Control__Granularity.is_omit() || single_value->field_flow__Control__Granularity.is_bound());
}

boolean PDU__BSSGP__FLOW__CONTROL__BVC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tag.is_value()
 && single_value->field_bVC__Bucket__Size.is_value()
 && single_value->field_bucket__Leak__Rate.is_value()
 && single_value->field_bmax__default__MS.is_value()
 && single_value->field_r__default__MS.is_value()
 && (single_value->field_bucket__Full__Ratio.is_omit() || single_value->field_bucket__Full__Ratio.is_value())
 && (single_value->field_bVC__Measurement.is_omit() || single_value->field_bVC__Measurement.is_value())
 && (single_value->field_flow__Control__Granularity.is_omit() || single_value->field_flow__Control__Granularity.is_value());
}

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

PDU__BSSGP__FLOW__CONTROL__BVC PDU__BSSGP__FLOW__CONTROL__BVC_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
PDU__BSSGP__FLOW__CONTROL__BVC ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_bVC__Bucket__Size.is_bound()) {
ret_val.bVC__Bucket__Size() = single_value->field_bVC__Bucket__Size.valueof();
}
if (single_value->field_bucket__Leak__Rate.is_bound()) {
ret_val.bucket__Leak__Rate() = single_value->field_bucket__Leak__Rate.valueof();
}
if (single_value->field_bmax__default__MS.is_bound()) {
ret_val.bmax__default__MS() = single_value->field_bmax__default__MS.valueof();
}
if (single_value->field_r__default__MS.is_bound()) {
ret_val.r__default__MS() = single_value->field_r__default__MS.valueof();
}
if (single_value->field_bucket__Full__Ratio.is_omit()) ret_val.bucket__Full__Ratio() = OMIT_VALUE;
else if (single_value->field_bucket__Full__Ratio.is_bound()) {
ret_val.bucket__Full__Ratio() = single_value->field_bucket__Full__Ratio.valueof();
}
if (single_value->field_bVC__Measurement.is_omit()) ret_val.bVC__Measurement() = OMIT_VALUE;
else if (single_value->field_bVC__Measurement.is_bound()) {
ret_val.bVC__Measurement() = single_value->field_bVC__Measurement.valueof();
}
if (single_value->field_flow__Control__Granularity.is_omit()) ret_val.flow__Control__Granularity() = OMIT_VALUE;
else if (single_value->field_flow__Control__Granularity.is_bound()) {
ret_val.flow__Control__Granularity() = single_value->field_flow__Control__Granularity.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_bssgpPduType;
}

Tag_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_tag;
}

BVC__Bucket__Size_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bVC__Bucket__Size()
{
set_specific();
return single_value->field_bVC__Bucket__Size;
}

const BVC__Bucket__Size_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bVC__Bucket__Size() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVC_Bucket_Size of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_bVC__Bucket__Size;
}

Bucket__Leak__Rate_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bucket__Leak__Rate()
{
set_specific();
return single_value->field_bucket__Leak__Rate;
}

const Bucket__Leak__Rate_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bucket__Leak__Rate() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bucket_Leak_Rate of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_bucket__Leak__Rate;
}

Bmax__default__MS_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bmax__default__MS()
{
set_specific();
return single_value->field_bmax__default__MS;
}

const Bmax__default__MS_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bmax__default__MS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bmax_default_MS of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_bmax__default__MS;
}

R__default__MS_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::r__default__MS()
{
set_specific();
return single_value->field_r__default__MS;
}

const R__default__MS_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::r__default__MS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field r_default_MS of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_r__default__MS;
}

Bucket__Full__Ratio_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bucket__Full__Ratio()
{
set_specific();
return single_value->field_bucket__Full__Ratio;
}

const Bucket__Full__Ratio_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bucket__Full__Ratio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bucket_Full_Ratio of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_bucket__Full__Ratio;
}

BVC__Measurement_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bVC__Measurement()
{
set_specific();
return single_value->field_bVC__Measurement;
}

const BVC__Measurement_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::bVC__Measurement() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVC_Measurement of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_bVC__Measurement;
}

Flow__Control__Granularity_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::flow__Control__Granularity()
{
set_specific();
return single_value->field_flow__Control__Granularity;
}

const Flow__Control__Granularity_template& PDU__BSSGP__FLOW__CONTROL__BVC_template::flow__Control__Granularity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flow_Control_Granularity of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
return single_value->field_flow__Control__Granularity;
}

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

void PDU__BSSGP__FLOW__CONTROL__BVC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", bVC_Bucket_Size := ");
single_value->field_bVC__Bucket__Size.log();
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
single_value->field_bucket__Leak__Rate.log();
TTCN_Logger::log_event_str(", bmax_default_MS := ");
single_value->field_bmax__default__MS.log();
TTCN_Logger::log_event_str(", r_default_MS := ");
single_value->field_r__default__MS.log();
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
single_value->field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(", bVC_Measurement := ");
single_value->field_bVC__Measurement.log();
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
single_value->field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__FLOW__CONTROL__BVC_template::log_match(const PDU__BSSGP__FLOW__CONTROL__BVC& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVC__Bucket__Size.match(match_value.bVC__Bucket__Size(), legacy)){
TTCN_Logger::log_logmatch_info(".bVC_Bucket_Size");
single_value->field_bVC__Bucket__Size.log_match(match_value.bVC__Bucket__Size(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bucket__Leak__Rate.match(match_value.bucket__Leak__Rate(), legacy)){
TTCN_Logger::log_logmatch_info(".bucket_Leak_Rate");
single_value->field_bucket__Leak__Rate.log_match(match_value.bucket__Leak__Rate(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bmax__default__MS.match(match_value.bmax__default__MS(), legacy)){
TTCN_Logger::log_logmatch_info(".bmax_default_MS");
single_value->field_bmax__default__MS.log_match(match_value.bmax__default__MS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_r__default__MS.match(match_value.r__default__MS(), legacy)){
TTCN_Logger::log_logmatch_info(".r_default_MS");
single_value->field_r__default__MS.log_match(match_value.r__default__MS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.bucket__Full__Ratio().ispresent()){
if(!single_value->field_bucket__Full__Ratio.match(match_value.bucket__Full__Ratio(), legacy)){
TTCN_Logger::log_logmatch_info(".bucket_Full_Ratio");
single_value->field_bucket__Full__Ratio.log_match(match_value.bucket__Full__Ratio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bucket__Full__Ratio.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bucket_Full_Ratio := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bVC__Measurement().ispresent()){
if(!single_value->field_bVC__Measurement.match(match_value.bVC__Measurement(), legacy)){
TTCN_Logger::log_logmatch_info(".bVC_Measurement");
single_value->field_bVC__Measurement.log_match(match_value.bVC__Measurement(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bVC__Measurement.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bVC_Measurement := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bVC__Measurement.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.flow__Control__Granularity().ispresent()){
if(!single_value->field_flow__Control__Granularity.match(match_value.flow__Control__Granularity(), legacy)){
TTCN_Logger::log_logmatch_info(".flow_Control_Granularity");
single_value->field_flow__Control__Granularity.log_match(match_value.flow__Control__Granularity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_flow__Control__Granularity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".flow_Control_Granularity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", bVC_Bucket_Size := ");
single_value->field_bVC__Bucket__Size.log_match(match_value.bVC__Bucket__Size(), legacy);
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
single_value->field_bucket__Leak__Rate.log_match(match_value.bucket__Leak__Rate(), legacy);
TTCN_Logger::log_event_str(", bmax_default_MS := ");
single_value->field_bmax__default__MS.log_match(match_value.bmax__default__MS(), legacy);
TTCN_Logger::log_event_str(", r_default_MS := ");
single_value->field_r__default__MS.log_match(match_value.r__default__MS(), legacy);
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
if (match_value.bucket__Full__Ratio().ispresent()) {
single_value->field_bucket__Full__Ratio.log_match(match_value.bucket__Full__Ratio(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bucket__Full__Ratio.log();
if (single_value->field_bucket__Full__Ratio.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bVC_Measurement := ");
if (match_value.bVC__Measurement().ispresent()) {
single_value->field_bVC__Measurement.log_match(match_value.bVC__Measurement(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bVC__Measurement.log();
if (single_value->field_bVC__Measurement.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
if (match_value.flow__Control__Granularity().ispresent()) {
single_value->field_flow__Control__Granularity.log_match(match_value.flow__Control__Granularity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_flow__Control__Granularity.log();
if (single_value->field_flow__Control__Granularity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__FLOW__CONTROL__BVC_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tag.encode_text(text_buf);
single_value->field_bVC__Bucket__Size.encode_text(text_buf);
single_value->field_bucket__Leak__Rate.encode_text(text_buf);
single_value->field_bmax__default__MS.encode_text(text_buf);
single_value->field_r__default__MS.encode_text(text_buf);
single_value->field_bucket__Full__Ratio.encode_text(text_buf);
single_value->field_bVC__Measurement.encode_text(text_buf);
single_value->field_flow__Control__Granularity.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
}
}

void PDU__BSSGP__FLOW__CONTROL__BVC_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tag.decode_text(text_buf);
single_value->field_bVC__Bucket__Size.decode_text(text_buf);
single_value->field_bucket__Leak__Rate.decode_text(text_buf);
single_value->field_bmax__default__MS.decode_text(text_buf);
single_value->field_r__default__MS.decode_text(text_buf);
single_value->field_bucket__Full__Ratio.decode_text(text_buf);
single_value->field_bVC__Measurement.decode_text(text_buf);
single_value->field_flow__Control__Granularity.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__BVC_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC.");
}
}

void PDU__BSSGP__FLOW__CONTROL__BVC_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__FLOW__CONTROL__BVC_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVC__Bucket__Size().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bucket__Leak__Rate().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bmax__default__MS().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) r__default__MS().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) bucket__Full__Ratio().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) bVC__Measurement().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) flow__Control__Granularity().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVC_Bucket_Size")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVC__Bucket__Size().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Leak_Rate")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Leak__Rate().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_default_MS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bmax__default__MS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_default_MS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          r__default__MS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Full_Ratio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Full__Ratio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVC_Measurement")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVC__Measurement().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flow_Control_Granularity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flow__Control__Granularity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__FLOW__CONTROL__BVC_template* precondition = new PDU__BSSGP__FLOW__CONTROL__BVC_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__FLOW__CONTROL__BVC_template* implied_template = new PDU__BSSGP__FLOW__CONTROL__BVC_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__FLOW__CONTROL__BVC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__FLOW__CONTROL__BVC_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_tag.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_bVC__Bucket__Size.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_bucket__Leak__Rate.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_bmax__default__MS.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_r__default__MS.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_bucket__Full__Ratio.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_bVC__Measurement.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
single_value->field_flow__Control__Granularity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC");
}

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

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

PDU__BSSGP__FLOW__CONTROL__BVC__ACK::PDU__BSSGP__FLOW__CONTROL__BVC__ACK()
{
}

PDU__BSSGP__FLOW__CONTROL__BVC__ACK::PDU__BSSGP__FLOW__CONTROL__BVC__ACK(const OCTETSTRING& par_bssgpPduType,
    const Tag& par_tag)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tag(par_tag)
{
}

PDU__BSSGP__FLOW__CONTROL__BVC__ACK::PDU__BSSGP__FLOW__CONTROL__BVC__ACK(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
}

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tag.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLOW__CONTROL__BVC__ACK::get_descriptor() const { return &PDU__BSSGP__FLOW__CONTROL__BVC__ACK_descr_; }
PDU__BSSGP__FLOW__CONTROL__BVC__ACK& PDU__BSSGP__FLOW__CONTROL__BVC__ACK::operator=(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLOW__CONTROL__BVC__ACK::operator==(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tag==other_value.field_tag;
}

boolean PDU__BSSGP__FLOW__CONTROL__BVC__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tag.is_bound());
}
boolean PDU__BSSGP__FLOW__CONTROL__BVC__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tag.is_value();
}
void PDU__BSSGP__FLOW__CONTROL__BVC__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
}

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK");
  }
}

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tag.encode_text(text_buf);
}

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tag.decode_text(text_buf);
}

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

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

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

int PDU__BSSGP__FLOW__CONTROL__BVC__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Tag_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[1]);
  if (field_bssgpPduType !=  os_7) {
  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_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
Tag_template field_tag;
};

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

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::copy_value(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::copy_template(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template()
{
}

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

PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::match(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK.");
}
return FALSE;
}

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

boolean PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tag.is_value();
}

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

PDU__BSSGP__FLOW__CONTROL__BVC__ACK PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK.");
PDU__BSSGP__FLOW__CONTROL__BVC__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK.");
return single_value->field_bssgpPduType;
}

Tag_template& PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_BVC_ACK.");
return single_value->field_tag;
}

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

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

void PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template::log_match(const PDU__BSSGP__FLOW__CONTROL__BVC__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__FLOW__CONTROL__MS::PDU__BSSGP__FLOW__CONTROL__MS()
{
}

PDU__BSSGP__FLOW__CONTROL__MS::PDU__BSSGP__FLOW__CONTROL__MS(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Tag& par_tag,
    const MS__Bucket__Size& par_mS__Bucket__Size,
    const Bucket__Leak__Rate& par_bucket__Leak__Rate,
    const OPTIONAL< Bucket__Full__Ratio >& par_bucket__Full__Ratio,
    const OPTIONAL< Flow__Control__Granularity >& par_flow__Control__Granularity)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_tag(par_tag),
  field_mS__Bucket__Size(par_mS__Bucket__Size),
  field_bucket__Leak__Rate(par_bucket__Leak__Rate),
  field_bucket__Full__Ratio(par_bucket__Full__Ratio),
  field_flow__Control__Granularity(par_flow__Control__Granularity)
{
}

PDU__BSSGP__FLOW__CONTROL__MS::PDU__BSSGP__FLOW__CONTROL__MS(const PDU__BSSGP__FLOW__CONTROL__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.mS__Bucket__Size().is_bound()) field_mS__Bucket__Size = other_value.mS__Bucket__Size();
else field_mS__Bucket__Size.clean_up();
if (other_value.bucket__Leak__Rate().is_bound()) field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
else field_bucket__Leak__Rate.clean_up();
if (other_value.bucket__Full__Ratio().is_bound()) field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
else field_bucket__Full__Ratio.clean_up();
if (other_value.flow__Control__Granularity().is_bound()) field_flow__Control__Granularity = other_value.flow__Control__Granularity();
else field_flow__Control__Granularity.clean_up();
}

void PDU__BSSGP__FLOW__CONTROL__MS::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_tag.clean_up();
field_mS__Bucket__Size.clean_up();
field_bucket__Leak__Rate.clean_up();
field_bucket__Full__Ratio.clean_up();
field_flow__Control__Granularity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLOW__CONTROL__MS::get_descriptor() const { return &PDU__BSSGP__FLOW__CONTROL__MS_descr_; }
PDU__BSSGP__FLOW__CONTROL__MS& PDU__BSSGP__FLOW__CONTROL__MS::operator=(const PDU__BSSGP__FLOW__CONTROL__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.mS__Bucket__Size().is_bound()) field_mS__Bucket__Size = other_value.mS__Bucket__Size();
  else field_mS__Bucket__Size.clean_up();
  if (other_value.bucket__Leak__Rate().is_bound()) field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
  else field_bucket__Leak__Rate.clean_up();
  if (other_value.bucket__Full__Ratio().is_bound()) field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
  else field_bucket__Full__Ratio.clean_up();
  if (other_value.flow__Control__Granularity().is_bound()) field_flow__Control__Granularity = other_value.flow__Control__Granularity();
  else field_flow__Control__Granularity.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLOW__CONTROL__MS::operator==(const PDU__BSSGP__FLOW__CONTROL__MS& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_tag==other_value.field_tag
  && field_mS__Bucket__Size==other_value.field_mS__Bucket__Size
  && field_bucket__Leak__Rate==other_value.field_bucket__Leak__Rate
  && field_bucket__Full__Ratio==other_value.field_bucket__Full__Ratio
  && field_flow__Control__Granularity==other_value.field_flow__Control__Granularity;
}

boolean PDU__BSSGP__FLOW__CONTROL__MS::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_tag.is_bound())
  || (field_mS__Bucket__Size.is_bound())
  || (field_bucket__Leak__Rate.is_bound())
  || (OPTIONAL_OMIT == field_bucket__Full__Ratio.get_selection() || field_bucket__Full__Ratio.is_bound())
  || (OPTIONAL_OMIT == field_flow__Control__Granularity.get_selection() || field_flow__Control__Granularity.is_bound());
}
boolean PDU__BSSGP__FLOW__CONTROL__MS::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_tag.is_value()
  && field_mS__Bucket__Size.is_value()
  && field_bucket__Leak__Rate.is_value()
  && (OPTIONAL_OMIT == field_bucket__Full__Ratio.get_selection() || field_bucket__Full__Ratio.is_value())
  && (OPTIONAL_OMIT == field_flow__Control__Granularity.get_selection() || field_flow__Control__Granularity.is_value());
}
int PDU__BSSGP__FLOW__CONTROL__MS::size_of() const
{
  int ret_val = 5;
  if (field_bucket__Full__Ratio.ispresent()) ret_val++;
  if (field_flow__Control__Granularity.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__FLOW__CONTROL__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", mS_Bucket_Size := ");
field_mS__Bucket__Size.log();
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
field_bucket__Leak__Rate.log();
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLOW__CONTROL__MS::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
if (mS__Bucket__Size().is_bound()) mS__Bucket__Size().set_implicit_omit();
if (bucket__Leak__Rate().is_bound()) bucket__Leak__Rate().set_implicit_omit();
if (!bucket__Full__Ratio().is_bound()) bucket__Full__Ratio() = OMIT_VALUE;
else bucket__Full__Ratio().set_implicit_omit();
if (!flow__Control__Granularity().is_bound()) flow__Control__Granularity() = OMIT_VALUE;
else flow__Control__Granularity().set_implicit_omit();
}

void PDU__BSSGP__FLOW__CONTROL__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mS__Bucket__Size().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bucket__Leak__Rate().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) bucket__Full__Ratio().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) flow__Control__Granularity().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Bucket_Size")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Bucket__Size().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Leak_Rate")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Leak__Rate().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Full_Ratio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Full__Ratio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flow_Control_Granularity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flow__Control__Granularity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
  }
}

void PDU__BSSGP__FLOW__CONTROL__MS::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_tag.encode_text(text_buf);
field_mS__Bucket__Size.encode_text(text_buf);
field_bucket__Leak__Rate.encode_text(text_buf);
field_bucket__Full__Ratio.encode_text(text_buf);
field_flow__Control__Granularity.encode_text(text_buf);
}

void PDU__BSSGP__FLOW__CONTROL__MS::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_tag.decode_text(text_buf);
field_mS__Bucket__Size.decode_text(text_buf);
field_bucket__Leak__Rate.decode_text(text_buf);
field_bucket__Full__Ratio.decode_text(text_buf);
field_flow__Control__Granularity.decode_text(text_buf);
}

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

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

int PDU__BSSGP__FLOW__CONTROL__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Tag_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(Tag_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, MS__Bucket__Size_descr_.raw->forceomit);
  decoded_field_length = field_mS__Bucket__Size.RAW_decode(MS__Bucket__Size_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, Bucket__Leak__Rate_descr_.raw->forceomit);
  decoded_field_length = field_bucket__Leak__Rate.RAW_decode(Bucket__Leak__Rate_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_bucket__Full__Ratio = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, Bucket__Full__Ratio_descr_.raw->forceomit);
  decoded_field_length = field_bucket__Full__Ratio().RAW_decode(Bucket__Full__Ratio_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_bucket__Full__Ratio = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bucket__Full__Ratio=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_flow__Control__Granularity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, Flow__Control__Granularity_descr_.raw->forceomit);
  decoded_field_length = field_flow__Control__Granularity().RAW_decode(Flow__Control__Granularity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_flow__Control__Granularity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_flow__Control__Granularity=OMIT_VALUE;
  if (field_bssgpPduType !=  os_6) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__FLOW__CONTROL__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Tag_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MS__Bucket__Size_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Bucket__Leak__Rate_descr_.raw);
  if (field_bucket__Full__Ratio.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Bucket__Full__Ratio_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_flow__Control__Granularity.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Flow__Control__Granularity_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mS__Bucket__Size.RAW_encode(MS__Bucket__Size_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_bucket__Leak__Rate.RAW_encode(Bucket__Leak__Rate_descr_, *myleaf.body.node.nodes[4]);
  if (field_bucket__Full__Ratio.ispresent()) {
  encoded_length += field_bucket__Full__Ratio().RAW_encode(Bucket__Full__Ratio_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_flow__Control__Granularity.ispresent()) {
  encoded_length += field_flow__Control__Granularity().RAW_encode(Flow__Control__Granularity_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_bssgpPduType !=  os_6) {
  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_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLOW__CONTROL__MS_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Tag_template field_tag;
MS__Bucket__Size_template field_mS__Bucket__Size;
Bucket__Leak__Rate_template field_bucket__Leak__Rate;
Bucket__Full__Ratio_template field_bucket__Full__Ratio;
Flow__Control__Granularity_template field_flow__Control__Granularity;
};

void PDU__BSSGP__FLOW__CONTROL__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_tag = ANY_VALUE;
single_value->field_mS__Bucket__Size = ANY_VALUE;
single_value->field_bucket__Leak__Rate = ANY_VALUE;
single_value->field_bucket__Full__Ratio = ANY_OR_OMIT;
single_value->field_flow__Control__Granularity = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__FLOW__CONTROL__MS_template::copy_value(const PDU__BSSGP__FLOW__CONTROL__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.mS__Bucket__Size().is_bound()) {
  single_value->field_mS__Bucket__Size = other_value.mS__Bucket__Size();
} else {
  single_value->field_mS__Bucket__Size.clean_up();
}
if (other_value.bucket__Leak__Rate().is_bound()) {
  single_value->field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
} else {
  single_value->field_bucket__Leak__Rate.clean_up();
}
if (other_value.bucket__Full__Ratio().is_bound()) {
  if (other_value.bucket__Full__Ratio().ispresent()) single_value->field_bucket__Full__Ratio = other_value.bucket__Full__Ratio()();
  else single_value->field_bucket__Full__Ratio = OMIT_VALUE;
} else {
  single_value->field_bucket__Full__Ratio.clean_up();
}
if (other_value.flow__Control__Granularity().is_bound()) {
  if (other_value.flow__Control__Granularity().ispresent()) single_value->field_flow__Control__Granularity = other_value.flow__Control__Granularity()();
  else single_value->field_flow__Control__Granularity = OMIT_VALUE;
} else {
  single_value->field_flow__Control__Granularity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLOW__CONTROL__MS_template::copy_template(const PDU__BSSGP__FLOW__CONTROL__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__Bucket__Size().get_selection()) {
single_value->field_mS__Bucket__Size = other_value.mS__Bucket__Size();
} else {
single_value->field_mS__Bucket__Size.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bucket__Leak__Rate().get_selection()) {
single_value->field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
} else {
single_value->field_bucket__Leak__Rate.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bucket__Full__Ratio().get_selection()) {
single_value->field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
} else {
single_value->field_bucket__Full__Ratio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flow__Control__Granularity().get_selection()) {
single_value->field_flow__Control__Granularity = other_value.flow__Control__Granularity();
} else {
single_value->field_flow__Control__Granularity.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__FLOW__CONTROL__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLOW__CONTROL__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLOW__CONTROL__MS_template::PDU__BSSGP__FLOW__CONTROL__MS_template()
{
}

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

PDU__BSSGP__FLOW__CONTROL__MS_template::PDU__BSSGP__FLOW__CONTROL__MS_template(const PDU__BSSGP__FLOW__CONTROL__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLOW__CONTROL__MS_template::match(const PDU__BSSGP__FLOW__CONTROL__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.mS__Bucket__Size().is_bound()) return FALSE;
if(!single_value->field_mS__Bucket__Size.match(other_value.mS__Bucket__Size(), legacy))return FALSE;
if(!other_value.bucket__Leak__Rate().is_bound()) return FALSE;
if(!single_value->field_bucket__Leak__Rate.match(other_value.bucket__Leak__Rate(), legacy))return FALSE;
if(!other_value.bucket__Full__Ratio().is_bound()) return FALSE;
if((other_value.bucket__Full__Ratio().ispresent() ? !single_value->field_bucket__Full__Ratio.match((const Bucket__Full__Ratio&)other_value.bucket__Full__Ratio(), legacy) : !single_value->field_bucket__Full__Ratio.match_omit(legacy)))return FALSE;
if(!other_value.flow__Control__Granularity().is_bound()) return FALSE;
if((other_value.flow__Control__Granularity().ispresent() ? !single_value->field_flow__Control__Granularity.match((const Flow__Control__Granularity&)other_value.flow__Control__Granularity(), legacy) : !single_value->field_flow__Control__Granularity.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
}
return FALSE;
}

boolean PDU__BSSGP__FLOW__CONTROL__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_tag.is_bound()
 || single_value->field_mS__Bucket__Size.is_bound()
 || single_value->field_bucket__Leak__Rate.is_bound()
 || (single_value->field_bucket__Full__Ratio.is_omit() || single_value->field_bucket__Full__Ratio.is_bound())
 || (single_value->field_flow__Control__Granularity.is_omit() || single_value->field_flow__Control__Granularity.is_bound());
}

boolean PDU__BSSGP__FLOW__CONTROL__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_tag.is_value()
 && single_value->field_mS__Bucket__Size.is_value()
 && single_value->field_bucket__Leak__Rate.is_value()
 && (single_value->field_bucket__Full__Ratio.is_omit() || single_value->field_bucket__Full__Ratio.is_value())
 && (single_value->field_flow__Control__Granularity.is_omit() || single_value->field_flow__Control__Granularity.is_value());
}

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

PDU__BSSGP__FLOW__CONTROL__MS PDU__BSSGP__FLOW__CONTROL__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
PDU__BSSGP__FLOW__CONTROL__MS ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_mS__Bucket__Size.is_bound()) {
ret_val.mS__Bucket__Size() = single_value->field_mS__Bucket__Size.valueof();
}
if (single_value->field_bucket__Leak__Rate.is_bound()) {
ret_val.bucket__Leak__Rate() = single_value->field_bucket__Leak__Rate.valueof();
}
if (single_value->field_bucket__Full__Ratio.is_omit()) ret_val.bucket__Full__Ratio() = OMIT_VALUE;
else if (single_value->field_bucket__Full__Ratio.is_bound()) {
ret_val.bucket__Full__Ratio() = single_value->field_bucket__Full__Ratio.valueof();
}
if (single_value->field_flow__Control__Granularity.is_omit()) ret_val.flow__Control__Granularity() = OMIT_VALUE;
else if (single_value->field_flow__Control__Granularity.is_bound()) {
ret_val.flow__Control__Granularity() = single_value->field_flow__Control__Granularity.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__MS_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__MS_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__MS_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__MS_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
return single_value->field_tLLI;
}

Tag_template& PDU__BSSGP__FLOW__CONTROL__MS_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__FLOW__CONTROL__MS_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
return single_value->field_tag;
}

MS__Bucket__Size_template& PDU__BSSGP__FLOW__CONTROL__MS_template::mS__Bucket__Size()
{
set_specific();
return single_value->field_mS__Bucket__Size;
}

const MS__Bucket__Size_template& PDU__BSSGP__FLOW__CONTROL__MS_template::mS__Bucket__Size() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_Bucket_Size of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
return single_value->field_mS__Bucket__Size;
}

Bucket__Leak__Rate_template& PDU__BSSGP__FLOW__CONTROL__MS_template::bucket__Leak__Rate()
{
set_specific();
return single_value->field_bucket__Leak__Rate;
}

const Bucket__Leak__Rate_template& PDU__BSSGP__FLOW__CONTROL__MS_template::bucket__Leak__Rate() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bucket_Leak_Rate of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
return single_value->field_bucket__Leak__Rate;
}

Bucket__Full__Ratio_template& PDU__BSSGP__FLOW__CONTROL__MS_template::bucket__Full__Ratio()
{
set_specific();
return single_value->field_bucket__Full__Ratio;
}

const Bucket__Full__Ratio_template& PDU__BSSGP__FLOW__CONTROL__MS_template::bucket__Full__Ratio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bucket_Full_Ratio of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
return single_value->field_bucket__Full__Ratio;
}

Flow__Control__Granularity_template& PDU__BSSGP__FLOW__CONTROL__MS_template::flow__Control__Granularity()
{
set_specific();
return single_value->field_flow__Control__Granularity;
}

const Flow__Control__Granularity_template& PDU__BSSGP__FLOW__CONTROL__MS_template::flow__Control__Granularity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flow_Control_Granularity of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
return single_value->field_flow__Control__Granularity;
}

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

void PDU__BSSGP__FLOW__CONTROL__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", mS_Bucket_Size := ");
single_value->field_mS__Bucket__Size.log();
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
single_value->field_bucket__Leak__Rate.log();
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
single_value->field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
single_value->field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__FLOW__CONTROL__MS_template::log_match(const PDU__BSSGP__FLOW__CONTROL__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mS__Bucket__Size.match(match_value.mS__Bucket__Size(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_Bucket_Size");
single_value->field_mS__Bucket__Size.log_match(match_value.mS__Bucket__Size(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bucket__Leak__Rate.match(match_value.bucket__Leak__Rate(), legacy)){
TTCN_Logger::log_logmatch_info(".bucket_Leak_Rate");
single_value->field_bucket__Leak__Rate.log_match(match_value.bucket__Leak__Rate(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.bucket__Full__Ratio().ispresent()){
if(!single_value->field_bucket__Full__Ratio.match(match_value.bucket__Full__Ratio(), legacy)){
TTCN_Logger::log_logmatch_info(".bucket_Full_Ratio");
single_value->field_bucket__Full__Ratio.log_match(match_value.bucket__Full__Ratio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bucket__Full__Ratio.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bucket_Full_Ratio := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.flow__Control__Granularity().ispresent()){
if(!single_value->field_flow__Control__Granularity.match(match_value.flow__Control__Granularity(), legacy)){
TTCN_Logger::log_logmatch_info(".flow_Control_Granularity");
single_value->field_flow__Control__Granularity.log_match(match_value.flow__Control__Granularity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_flow__Control__Granularity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".flow_Control_Granularity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", mS_Bucket_Size := ");
single_value->field_mS__Bucket__Size.log_match(match_value.mS__Bucket__Size(), legacy);
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
single_value->field_bucket__Leak__Rate.log_match(match_value.bucket__Leak__Rate(), legacy);
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
if (match_value.bucket__Full__Ratio().ispresent()) {
single_value->field_bucket__Full__Ratio.log_match(match_value.bucket__Full__Ratio(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bucket__Full__Ratio.log();
if (single_value->field_bucket__Full__Ratio.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
if (match_value.flow__Control__Granularity().ispresent()) {
single_value->field_flow__Control__Granularity.log_match(match_value.flow__Control__Granularity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_flow__Control__Granularity.log();
if (single_value->field_flow__Control__Granularity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__FLOW__CONTROL__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_tag.decode_text(text_buf);
single_value->field_mS__Bucket__Size.decode_text(text_buf);
single_value->field_bucket__Leak__Rate.decode_text(text_buf);
single_value->field_bucket__Full__Ratio.decode_text(text_buf);
single_value->field_flow__Control__Granularity.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS.");
}
}

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

void PDU__BSSGP__FLOW__CONTROL__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
single_value->field_tag.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
single_value->field_mS__Bucket__Size.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
single_value->field_bucket__Leak__Rate.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
single_value->field_bucket__Full__Ratio.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
single_value->field_flow__Control__Granularity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS");
}

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

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

PDU__BSSGP__FLOW__CONTROL__MS__ACK::PDU__BSSGP__FLOW__CONTROL__MS__ACK()
{
}

PDU__BSSGP__FLOW__CONTROL__MS__ACK::PDU__BSSGP__FLOW__CONTROL__MS__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Tag& par_tag)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_tag(par_tag)
{
}

PDU__BSSGP__FLOW__CONTROL__MS__ACK::PDU__BSSGP__FLOW__CONTROL__MS__ACK(const PDU__BSSGP__FLOW__CONTROL__MS__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_tag.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLOW__CONTROL__MS__ACK::get_descriptor() const { return &PDU__BSSGP__FLOW__CONTROL__MS__ACK_descr_; }
PDU__BSSGP__FLOW__CONTROL__MS__ACK& PDU__BSSGP__FLOW__CONTROL__MS__ACK::operator=(const PDU__BSSGP__FLOW__CONTROL__MS__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLOW__CONTROL__MS__ACK::operator==(const PDU__BSSGP__FLOW__CONTROL__MS__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_tag==other_value.field_tag;
}

boolean PDU__BSSGP__FLOW__CONTROL__MS__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_tag.is_bound());
}
boolean PDU__BSSGP__FLOW__CONTROL__MS__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_tag.is_value();
}
void PDU__BSSGP__FLOW__CONTROL__MS__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK");
  }
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_tag.encode_text(text_buf);
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_tag.decode_text(text_buf);
}

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

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

int PDU__BSSGP__FLOW__CONTROL__MS__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Tag_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(Tag_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_63) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__FLOW__CONTROL__MS__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Tag_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_63) {
  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_63.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Tag_template field_tag;
};

void PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_tag = ANY_VALUE;
}
}
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::copy_value(const PDU__BSSGP__FLOW__CONTROL__MS__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::copy_template(const PDU__BSSGP__FLOW__CONTROL__MS__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__MS__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__FLOW__CONTROL__MS__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLOW__CONTROL__MS__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::PDU__BSSGP__FLOW__CONTROL__MS__ACK_template()
{
}

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

PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::PDU__BSSGP__FLOW__CONTROL__MS__ACK_template(const PDU__BSSGP__FLOW__CONTROL__MS__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::match(const PDU__BSSGP__FLOW__CONTROL__MS__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_tag.is_bound();
}

boolean PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_tag.is_value();
}

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

PDU__BSSGP__FLOW__CONTROL__MS__ACK PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
PDU__BSSGP__FLOW__CONTROL__MS__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
return single_value->field_tLLI;
}

Tag_template& PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_MS_ACK.");
return single_value->field_tag;
}

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

void PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__FLOW__CONTROL__MS__ACK_template::log_match(const PDU__BSSGP__FLOW__CONTROL__MS__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__BVC__BLOCK::PDU__BSSGP__BVC__BLOCK()
{
}

PDU__BSSGP__BVC__BLOCK::PDU__BSSGP__BVC__BLOCK(const OCTETSTRING& par_bssgpPduType,
    const BVCI& par_bVCI,
    const Cause__BSSGP& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_bVCI(par_bVCI),
  field_cause(par_cause)
{
}

PDU__BSSGP__BVC__BLOCK::PDU__BSSGP__BVC__BLOCK(const PDU__BSSGP__BVC__BLOCK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__BVC__BLOCK::clean_up()
{
field_bssgpPduType.clean_up();
field_bVCI.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__BVC__BLOCK::get_descriptor() const { return &PDU__BSSGP__BVC__BLOCK_descr_; }
PDU__BSSGP__BVC__BLOCK& PDU__BSSGP__BVC__BLOCK::operator=(const PDU__BSSGP__BVC__BLOCK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__BVC__BLOCK::operator==(const PDU__BSSGP__BVC__BLOCK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_bVCI==other_value.field_bVCI
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__BVC__BLOCK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_bVCI.is_bound())
  || (field_cause.is_bound());
}
boolean PDU__BSSGP__BVC__BLOCK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_bVCI.is_value()
  && field_cause.is_value();
}
void PDU__BSSGP__BVC__BLOCK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__BVC__BLOCK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
}

void PDU__BSSGP__BVC__BLOCK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_BVC_BLOCK");
  }
}

void PDU__BSSGP__BVC__BLOCK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__BVC__BLOCK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

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

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

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

int PDU__BSSGP__BVC__BLOCK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, BVCI_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Cause__BSSGP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_36) {
  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_36.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__BVC__BLOCK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
BVCI_template field_bVCI;
Cause__BSSGP_template field_cause;
};

void PDU__BSSGP__BVC__BLOCK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
}
}
}

void PDU__BSSGP__BVC__BLOCK_template::copy_value(const PDU__BSSGP__BVC__BLOCK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__BVC__BLOCK_template::copy_template(const PDU__BSSGP__BVC__BLOCK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__BVC__BLOCK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__BVC__BLOCK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__BVC__BLOCK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__BVC__BLOCK_template::PDU__BSSGP__BVC__BLOCK_template()
{
}

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

PDU__BSSGP__BVC__BLOCK_template::PDU__BSSGP__BVC__BLOCK_template(const PDU__BSSGP__BVC__BLOCK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__BVC__BLOCK_template::match(const PDU__BSSGP__BVC__BLOCK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
}
return FALSE;
}

boolean PDU__BSSGP__BVC__BLOCK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_bVCI.is_bound()
 || single_value->field_cause.is_bound();
}

boolean PDU__BSSGP__BVC__BLOCK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_bVCI.is_value()
 && single_value->field_cause.is_value();
}

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

PDU__BSSGP__BVC__BLOCK PDU__BSSGP__BVC__BLOCK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
PDU__BSSGP__BVC__BLOCK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__BVC__BLOCK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__BVC__BLOCK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
return single_value->field_bssgpPduType;
}

BVCI_template& PDU__BSSGP__BVC__BLOCK_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__BVC__BLOCK_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
return single_value->field_bVCI;
}

Cause__BSSGP_template& PDU__BSSGP__BVC__BLOCK_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__BVC__BLOCK_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK.");
return single_value->field_cause;
}

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

void PDU__BSSGP__BVC__BLOCK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__BVC__BLOCK_template::log_match(const PDU__BSSGP__BVC__BLOCK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__BVC__BLOCK__ACK::PDU__BSSGP__BVC__BLOCK__ACK()
{
}

PDU__BSSGP__BVC__BLOCK__ACK::PDU__BSSGP__BVC__BLOCK__ACK(const OCTETSTRING& par_bssgpPduType,
    const BVCI& par_bVCI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_bVCI(par_bVCI)
{
}

PDU__BSSGP__BVC__BLOCK__ACK::PDU__BSSGP__BVC__BLOCK__ACK(const PDU__BSSGP__BVC__BLOCK__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
}

void PDU__BSSGP__BVC__BLOCK__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_bVCI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__BVC__BLOCK__ACK::get_descriptor() const { return &PDU__BSSGP__BVC__BLOCK__ACK_descr_; }
PDU__BSSGP__BVC__BLOCK__ACK& PDU__BSSGP__BVC__BLOCK__ACK::operator=(const PDU__BSSGP__BVC__BLOCK__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__BVC__BLOCK__ACK::operator==(const PDU__BSSGP__BVC__BLOCK__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_bVCI==other_value.field_bVCI;
}

boolean PDU__BSSGP__BVC__BLOCK__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_bVCI.is_bound());
}
boolean PDU__BSSGP__BVC__BLOCK__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_bVCI.is_value();
}
void PDU__BSSGP__BVC__BLOCK__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__BVC__BLOCK__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
}

void PDU__BSSGP__BVC__BLOCK__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK");
  }
}

void PDU__BSSGP__BVC__BLOCK__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
}

void PDU__BSSGP__BVC__BLOCK__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
}

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

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

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

int PDU__BSSGP__BVC__BLOCK__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, BVCI_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[1]);
  if (field_bssgpPduType !=  os_68) {
  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_68.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__BVC__BLOCK__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
BVCI_template field_bVCI;
};

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

void PDU__BSSGP__BVC__BLOCK__ACK_template::copy_value(const PDU__BSSGP__BVC__BLOCK__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__BVC__BLOCK__ACK_template::copy_template(const PDU__BSSGP__BVC__BLOCK__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__BVC__BLOCK__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__BVC__BLOCK__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__BVC__BLOCK__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__BVC__BLOCK__ACK_template::PDU__BSSGP__BVC__BLOCK__ACK_template()
{
}

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

PDU__BSSGP__BVC__BLOCK__ACK_template::PDU__BSSGP__BVC__BLOCK__ACK_template(const PDU__BSSGP__BVC__BLOCK__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__BVC__BLOCK__ACK_template::match(const PDU__BSSGP__BVC__BLOCK__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK.");
}
return FALSE;
}

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

boolean PDU__BSSGP__BVC__BLOCK__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_bVCI.is_value();
}

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

PDU__BSSGP__BVC__BLOCK__ACK PDU__BSSGP__BVC__BLOCK__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK.");
PDU__BSSGP__BVC__BLOCK__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__BVC__BLOCK__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__BVC__BLOCK__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK.");
return single_value->field_bssgpPduType;
}

BVCI_template& PDU__BSSGP__BVC__BLOCK__ACK_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__BVC__BLOCK__ACK_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_BLOCK_ACK.");
return single_value->field_bVCI;
}

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

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

void PDU__BSSGP__BVC__BLOCK__ACK_template::log_match(const PDU__BSSGP__BVC__BLOCK__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__BVC__UNBLOCK::PDU__BSSGP__BVC__UNBLOCK()
{
}

PDU__BSSGP__BVC__UNBLOCK::PDU__BSSGP__BVC__UNBLOCK(const OCTETSTRING& par_bssgpPduType,
    const BVCI& par_bVCI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_bVCI(par_bVCI)
{
}

PDU__BSSGP__BVC__UNBLOCK::PDU__BSSGP__BVC__UNBLOCK(const PDU__BSSGP__BVC__UNBLOCK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
}

void PDU__BSSGP__BVC__UNBLOCK::clean_up()
{
field_bssgpPduType.clean_up();
field_bVCI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__BVC__UNBLOCK::get_descriptor() const { return &PDU__BSSGP__BVC__UNBLOCK_descr_; }
PDU__BSSGP__BVC__UNBLOCK& PDU__BSSGP__BVC__UNBLOCK::operator=(const PDU__BSSGP__BVC__UNBLOCK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__BVC__UNBLOCK::operator==(const PDU__BSSGP__BVC__UNBLOCK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_bVCI==other_value.field_bVCI;
}

boolean PDU__BSSGP__BVC__UNBLOCK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_bVCI.is_bound());
}
boolean PDU__BSSGP__BVC__UNBLOCK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_bVCI.is_value();
}
void PDU__BSSGP__BVC__UNBLOCK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__BVC__UNBLOCK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
}

void PDU__BSSGP__BVC__UNBLOCK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK");
  }
}

void PDU__BSSGP__BVC__UNBLOCK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
}

void PDU__BSSGP__BVC__UNBLOCK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
}

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

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

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

int PDU__BSSGP__BVC__UNBLOCK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, BVCI_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[1]);
  if (field_bssgpPduType !=  os_69) {
  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_69.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__BVC__UNBLOCK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
BVCI_template field_bVCI;
};

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

void PDU__BSSGP__BVC__UNBLOCK_template::copy_value(const PDU__BSSGP__BVC__UNBLOCK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__BVC__UNBLOCK_template::copy_template(const PDU__BSSGP__BVC__UNBLOCK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__BVC__UNBLOCK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__BVC__UNBLOCK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__BVC__UNBLOCK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__BVC__UNBLOCK_template::PDU__BSSGP__BVC__UNBLOCK_template()
{
}

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

PDU__BSSGP__BVC__UNBLOCK_template::PDU__BSSGP__BVC__UNBLOCK_template(const PDU__BSSGP__BVC__UNBLOCK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__BVC__UNBLOCK_template::match(const PDU__BSSGP__BVC__UNBLOCK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK.");
}
return FALSE;
}

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

boolean PDU__BSSGP__BVC__UNBLOCK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_bVCI.is_value();
}

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

PDU__BSSGP__BVC__UNBLOCK PDU__BSSGP__BVC__UNBLOCK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK.");
PDU__BSSGP__BVC__UNBLOCK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__BVC__UNBLOCK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__BVC__UNBLOCK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK.");
return single_value->field_bssgpPduType;
}

BVCI_template& PDU__BSSGP__BVC__UNBLOCK_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__BVC__UNBLOCK_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK.");
return single_value->field_bVCI;
}

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

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

void PDU__BSSGP__BVC__UNBLOCK_template::log_match(const PDU__BSSGP__BVC__UNBLOCK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__BVC__UNBLOCK__ACK::PDU__BSSGP__BVC__UNBLOCK__ACK()
{
}

PDU__BSSGP__BVC__UNBLOCK__ACK::PDU__BSSGP__BVC__UNBLOCK__ACK(const OCTETSTRING& par_bssgpPduType,
    const BVCI& par_bVCI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_bVCI(par_bVCI)
{
}

PDU__BSSGP__BVC__UNBLOCK__ACK::PDU__BSSGP__BVC__UNBLOCK__ACK(const PDU__BSSGP__BVC__UNBLOCK__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
}

void PDU__BSSGP__BVC__UNBLOCK__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_bVCI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__BVC__UNBLOCK__ACK::get_descriptor() const { return &PDU__BSSGP__BVC__UNBLOCK__ACK_descr_; }
PDU__BSSGP__BVC__UNBLOCK__ACK& PDU__BSSGP__BVC__UNBLOCK__ACK::operator=(const PDU__BSSGP__BVC__UNBLOCK__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__BVC__UNBLOCK__ACK::operator==(const PDU__BSSGP__BVC__UNBLOCK__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_bVCI==other_value.field_bVCI;
}

boolean PDU__BSSGP__BVC__UNBLOCK__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_bVCI.is_bound());
}
boolean PDU__BSSGP__BVC__UNBLOCK__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_bVCI.is_value();
}
void PDU__BSSGP__BVC__UNBLOCK__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__BVC__UNBLOCK__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
}

void PDU__BSSGP__BVC__UNBLOCK__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK");
  }
}

void PDU__BSSGP__BVC__UNBLOCK__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
}

void PDU__BSSGP__BVC__UNBLOCK__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
}

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

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

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

int PDU__BSSGP__BVC__UNBLOCK__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, BVCI_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[1]);
  if (field_bssgpPduType !=  os_56) {
  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_56.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__BVC__UNBLOCK__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
BVCI_template field_bVCI;
};

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

void PDU__BSSGP__BVC__UNBLOCK__ACK_template::copy_value(const PDU__BSSGP__BVC__UNBLOCK__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__BVC__UNBLOCK__ACK_template::copy_template(const PDU__BSSGP__BVC__UNBLOCK__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__BVC__UNBLOCK__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__BVC__UNBLOCK__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__BVC__UNBLOCK__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__BVC__UNBLOCK__ACK_template::PDU__BSSGP__BVC__UNBLOCK__ACK_template()
{
}

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

PDU__BSSGP__BVC__UNBLOCK__ACK_template::PDU__BSSGP__BVC__UNBLOCK__ACK_template(const PDU__BSSGP__BVC__UNBLOCK__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__BVC__UNBLOCK__ACK_template::match(const PDU__BSSGP__BVC__UNBLOCK__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK.");
}
return FALSE;
}

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

boolean PDU__BSSGP__BVC__UNBLOCK__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_bVCI.is_value();
}

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

PDU__BSSGP__BVC__UNBLOCK__ACK PDU__BSSGP__BVC__UNBLOCK__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK.");
PDU__BSSGP__BVC__UNBLOCK__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__BVC__UNBLOCK__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__BVC__UNBLOCK__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK.");
return single_value->field_bssgpPduType;
}

BVCI_template& PDU__BSSGP__BVC__UNBLOCK__ACK_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__BVC__UNBLOCK__ACK_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_UNBLOCK_ACK.");
return single_value->field_bVCI;
}

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

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

void PDU__BSSGP__BVC__UNBLOCK__ACK_template::log_match(const PDU__BSSGP__BVC__UNBLOCK__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__BVC__RESET::PDU__BSSGP__BVC__RESET()
{
}

PDU__BSSGP__BVC__RESET::PDU__BSSGP__BVC__RESET(const OCTETSTRING& par_bssgpPduType,
    const BVCI& par_bVCI,
    const Cause__BSSGP& par_cause,
    const OPTIONAL< Cell__Identifier >& par_cell__Identifier,
    const OPTIONAL< Feature__bitmap >& par_feature__bitmap,
    const OPTIONAL< Extended__Feature__Bitmap >& par_extended__Feature__Bitmap)
  :   field_bssgpPduType(par_bssgpPduType),
  field_bVCI(par_bVCI),
  field_cause(par_cause),
  field_cell__Identifier(par_cell__Identifier),
  field_feature__bitmap(par_feature__bitmap),
  field_extended__Feature__Bitmap(par_extended__Feature__Bitmap)
{
}

PDU__BSSGP__BVC__RESET::PDU__BSSGP__BVC__RESET(const PDU__BSSGP__BVC__RESET& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
else field_cell__Identifier.clean_up();
if (other_value.feature__bitmap().is_bound()) field_feature__bitmap = other_value.feature__bitmap();
else field_feature__bitmap.clean_up();
if (other_value.extended__Feature__Bitmap().is_bound()) field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap();
else field_extended__Feature__Bitmap.clean_up();
}

void PDU__BSSGP__BVC__RESET::clean_up()
{
field_bssgpPduType.clean_up();
field_bVCI.clean_up();
field_cause.clean_up();
field_cell__Identifier.clean_up();
field_feature__bitmap.clean_up();
field_extended__Feature__Bitmap.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__BVC__RESET::get_descriptor() const { return &PDU__BSSGP__BVC__RESET_descr_; }
PDU__BSSGP__BVC__RESET& PDU__BSSGP__BVC__RESET::operator=(const PDU__BSSGP__BVC__RESET& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
  else field_cell__Identifier.clean_up();
  if (other_value.feature__bitmap().is_bound()) field_feature__bitmap = other_value.feature__bitmap();
  else field_feature__bitmap.clean_up();
  if (other_value.extended__Feature__Bitmap().is_bound()) field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap();
  else field_extended__Feature__Bitmap.clean_up();
}
return *this;
}

boolean PDU__BSSGP__BVC__RESET::operator==(const PDU__BSSGP__BVC__RESET& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_bVCI==other_value.field_bVCI
  && field_cause==other_value.field_cause
  && field_cell__Identifier==other_value.field_cell__Identifier
  && field_feature__bitmap==other_value.field_feature__bitmap
  && field_extended__Feature__Bitmap==other_value.field_extended__Feature__Bitmap;
}

boolean PDU__BSSGP__BVC__RESET::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_bVCI.is_bound())
  || (field_cause.is_bound())
  || (OPTIONAL_OMIT == field_cell__Identifier.get_selection() || field_cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_feature__bitmap.get_selection() || field_feature__bitmap.is_bound())
  || (OPTIONAL_OMIT == field_extended__Feature__Bitmap.get_selection() || field_extended__Feature__Bitmap.is_bound());
}
boolean PDU__BSSGP__BVC__RESET::is_value() const
{
return field_bssgpPduType.is_value()
  && field_bVCI.is_value()
  && field_cause.is_value()
  && (OPTIONAL_OMIT == field_cell__Identifier.get_selection() || field_cell__Identifier.is_value())
  && (OPTIONAL_OMIT == field_feature__bitmap.get_selection() || field_feature__bitmap.is_value())
  && (OPTIONAL_OMIT == field_extended__Feature__Bitmap.get_selection() || field_extended__Feature__Bitmap.is_value());
}
int PDU__BSSGP__BVC__RESET::size_of() const
{
  int ret_val = 3;
  if (field_cell__Identifier.ispresent()) ret_val++;
  if (field_feature__bitmap.ispresent()) ret_val++;
  if (field_extended__Feature__Bitmap.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__BVC__RESET::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
field_cell__Identifier.log();
TTCN_Logger::log_event_str(", feature_bitmap := ");
field_feature__bitmap.log();
TTCN_Logger::log_event_str(", extended_Feature_Bitmap := ");
field_extended__Feature__Bitmap.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__BVC__RESET::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!cell__Identifier().is_bound()) cell__Identifier() = OMIT_VALUE;
else cell__Identifier().set_implicit_omit();
if (!feature__bitmap().is_bound()) feature__bitmap() = OMIT_VALUE;
else feature__bitmap().set_implicit_omit();
if (!extended__Feature__Bitmap().is_bound()) extended__Feature__Bitmap() = OMIT_VALUE;
else extended__Feature__Bitmap().set_implicit_omit();
}

void PDU__BSSGP__BVC__RESET::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_BVC_RESET has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) feature__bitmap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) extended__Feature__Bitmap().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "feature_bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          feature__bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extended_Feature_Bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extended__Feature__Bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_RESET: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_BVC_RESET");
  }
}

void PDU__BSSGP__BVC__RESET::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_cell__Identifier.encode_text(text_buf);
field_feature__bitmap.encode_text(text_buf);
field_extended__Feature__Bitmap.encode_text(text_buf);
}

void PDU__BSSGP__BVC__RESET::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_cell__Identifier.decode_text(text_buf);
field_feature__bitmap.decode_text(text_buf);
field_extended__Feature__Bitmap.decode_text(text_buf);
}

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

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

int PDU__BSSGP__BVC__RESET::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_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, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_cell__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_cell__Identifier().RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_cell__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cell__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_feature__bitmap = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Feature__bitmap_descr_.raw->forceomit);
  decoded_field_length = field_feature__bitmap().RAW_decode(Feature__bitmap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_feature__bitmap = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_feature__bitmap=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_extended__Feature__Bitmap = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, Extended__Feature__Bitmap_descr_.raw->forceomit);
  decoded_field_length = field_extended__Feature__Bitmap().RAW_decode(Extended__Feature__Bitmap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_extended__Feature__Bitmap = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_extended__Feature__Bitmap=OMIT_VALUE;
  if (field_bssgpPduType !=  os_72) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__BVC__RESET::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, BVCI_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Cause__BSSGP_descr_.raw);
  if (field_cell__Identifier.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_feature__bitmap.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Feature__bitmap_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_extended__Feature__Bitmap.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Extended__Feature__Bitmap_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_cell__Identifier.ispresent()) {
  encoded_length += field_cell__Identifier().RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_feature__bitmap.ispresent()) {
  encoded_length += field_feature__bitmap().RAW_encode(Feature__bitmap_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_extended__Feature__Bitmap.ispresent()) {
  encoded_length += field_extended__Feature__Bitmap().RAW_encode(Extended__Feature__Bitmap_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_bssgpPduType !=  os_72) {
  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_72.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__BVC__RESET_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
BVCI_template field_bVCI;
Cause__BSSGP_template field_cause;
Cell__Identifier_template field_cell__Identifier;
Feature__bitmap_template field_feature__bitmap;
Extended__Feature__Bitmap_template field_extended__Feature__Bitmap;
};

void PDU__BSSGP__BVC__RESET_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_cell__Identifier = ANY_OR_OMIT;
single_value->field_feature__bitmap = ANY_OR_OMIT;
single_value->field_extended__Feature__Bitmap = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__BVC__RESET_template::copy_value(const PDU__BSSGP__BVC__RESET& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.cell__Identifier().is_bound()) {
  if (other_value.cell__Identifier().ispresent()) single_value->field_cell__Identifier = other_value.cell__Identifier()();
  else single_value->field_cell__Identifier = OMIT_VALUE;
} else {
  single_value->field_cell__Identifier.clean_up();
}
if (other_value.feature__bitmap().is_bound()) {
  if (other_value.feature__bitmap().ispresent()) single_value->field_feature__bitmap = other_value.feature__bitmap()();
  else single_value->field_feature__bitmap = OMIT_VALUE;
} else {
  single_value->field_feature__bitmap.clean_up();
}
if (other_value.extended__Feature__Bitmap().is_bound()) {
  if (other_value.extended__Feature__Bitmap().ispresent()) single_value->field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap()();
  else single_value->field_extended__Feature__Bitmap = OMIT_VALUE;
} else {
  single_value->field_extended__Feature__Bitmap.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__BVC__RESET_template::copy_template(const PDU__BSSGP__BVC__RESET_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__Identifier().get_selection()) {
single_value->field_cell__Identifier = other_value.cell__Identifier();
} else {
single_value->field_cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.feature__bitmap().get_selection()) {
single_value->field_feature__bitmap = other_value.feature__bitmap();
} else {
single_value->field_feature__bitmap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extended__Feature__Bitmap().get_selection()) {
single_value->field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap();
} else {
single_value->field_extended__Feature__Bitmap.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__BVC__RESET_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__BVC__RESET_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__BVC__RESET_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__BVC__RESET_template::PDU__BSSGP__BVC__RESET_template()
{
}

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

PDU__BSSGP__BVC__RESET_template::PDU__BSSGP__BVC__RESET_template(const PDU__BSSGP__BVC__RESET& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__BVC__RESET_template::match(const PDU__BSSGP__BVC__RESET& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.cell__Identifier().is_bound()) return FALSE;
if((other_value.cell__Identifier().ispresent() ? !single_value->field_cell__Identifier.match((const Cell__Identifier&)other_value.cell__Identifier(), legacy) : !single_value->field_cell__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.feature__bitmap().is_bound()) return FALSE;
if((other_value.feature__bitmap().ispresent() ? !single_value->field_feature__bitmap.match((const Feature__bitmap&)other_value.feature__bitmap(), legacy) : !single_value->field_feature__bitmap.match_omit(legacy)))return FALSE;
if(!other_value.extended__Feature__Bitmap().is_bound()) return FALSE;
if((other_value.extended__Feature__Bitmap().ispresent() ? !single_value->field_extended__Feature__Bitmap.match((const Extended__Feature__Bitmap&)other_value.extended__Feature__Bitmap(), legacy) : !single_value->field_extended__Feature__Bitmap.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
}
return FALSE;
}

boolean PDU__BSSGP__BVC__RESET_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_bVCI.is_bound()
 || single_value->field_cause.is_bound()
 || (single_value->field_cell__Identifier.is_omit() || single_value->field_cell__Identifier.is_bound())
 || (single_value->field_feature__bitmap.is_omit() || single_value->field_feature__bitmap.is_bound())
 || (single_value->field_extended__Feature__Bitmap.is_omit() || single_value->field_extended__Feature__Bitmap.is_bound());
}

boolean PDU__BSSGP__BVC__RESET_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_bVCI.is_value()
 && single_value->field_cause.is_value()
 && (single_value->field_cell__Identifier.is_omit() || single_value->field_cell__Identifier.is_value())
 && (single_value->field_feature__bitmap.is_omit() || single_value->field_feature__bitmap.is_value())
 && (single_value->field_extended__Feature__Bitmap.is_omit() || single_value->field_extended__Feature__Bitmap.is_value());
}

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

PDU__BSSGP__BVC__RESET PDU__BSSGP__BVC__RESET_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
PDU__BSSGP__BVC__RESET ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_cell__Identifier.is_omit()) ret_val.cell__Identifier() = OMIT_VALUE;
else if (single_value->field_cell__Identifier.is_bound()) {
ret_val.cell__Identifier() = single_value->field_cell__Identifier.valueof();
}
if (single_value->field_feature__bitmap.is_omit()) ret_val.feature__bitmap() = OMIT_VALUE;
else if (single_value->field_feature__bitmap.is_bound()) {
ret_val.feature__bitmap() = single_value->field_feature__bitmap.valueof();
}
if (single_value->field_extended__Feature__Bitmap.is_omit()) ret_val.extended__Feature__Bitmap() = OMIT_VALUE;
else if (single_value->field_extended__Feature__Bitmap.is_bound()) {
ret_val.extended__Feature__Bitmap() = single_value->field_extended__Feature__Bitmap.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__BVC__RESET_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__BVC__RESET_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
return single_value->field_bssgpPduType;
}

BVCI_template& PDU__BSSGP__BVC__RESET_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__BVC__RESET_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
return single_value->field_bVCI;
}

Cause__BSSGP_template& PDU__BSSGP__BVC__RESET_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__BVC__RESET_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
return single_value->field_cause;
}

Cell__Identifier_template& PDU__BSSGP__BVC__RESET_template::cell__Identifier()
{
set_specific();
return single_value->field_cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__BVC__RESET_template::cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
return single_value->field_cell__Identifier;
}

Feature__bitmap_template& PDU__BSSGP__BVC__RESET_template::feature__bitmap()
{
set_specific();
return single_value->field_feature__bitmap;
}

const Feature__bitmap_template& PDU__BSSGP__BVC__RESET_template::feature__bitmap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field feature_bitmap of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
return single_value->field_feature__bitmap;
}

Extended__Feature__Bitmap_template& PDU__BSSGP__BVC__RESET_template::extended__Feature__Bitmap()
{
set_specific();
return single_value->field_extended__Feature__Bitmap;
}

const Extended__Feature__Bitmap_template& PDU__BSSGP__BVC__RESET_template::extended__Feature__Bitmap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extended_Feature_Bitmap of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
return single_value->field_extended__Feature__Bitmap;
}

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

void PDU__BSSGP__BVC__RESET_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
single_value->field_cell__Identifier.log();
TTCN_Logger::log_event_str(", feature_bitmap := ");
single_value->field_feature__bitmap.log();
TTCN_Logger::log_event_str(", extended_Feature_Bitmap := ");
single_value->field_extended__Feature__Bitmap.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__BVC__RESET_template::log_match(const PDU__BSSGP__BVC__RESET& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cell__Identifier().ispresent()){
if(!single_value->field_cell__Identifier.match(match_value.cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_Identifier");
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cell__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cell_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cell__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.feature__bitmap().ispresent()){
if(!single_value->field_feature__bitmap.match(match_value.feature__bitmap(), legacy)){
TTCN_Logger::log_logmatch_info(".feature_bitmap");
single_value->field_feature__bitmap.log_match(match_value.feature__bitmap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_feature__bitmap.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".feature_bitmap := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_feature__bitmap.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extended__Feature__Bitmap().ispresent()){
if(!single_value->field_extended__Feature__Bitmap.match(match_value.extended__Feature__Bitmap(), legacy)){
TTCN_Logger::log_logmatch_info(".extended_Feature_Bitmap");
single_value->field_extended__Feature__Bitmap.log_match(match_value.extended__Feature__Bitmap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extended__Feature__Bitmap.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extended_Feature_Bitmap := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extended__Feature__Bitmap.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", cell_Identifier := ");
if (match_value.cell__Identifier().ispresent()) {
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cell__Identifier.log();
if (single_value->field_cell__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", feature_bitmap := ");
if (match_value.feature__bitmap().ispresent()) {
single_value->field_feature__bitmap.log_match(match_value.feature__bitmap(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_feature__bitmap.log();
if (single_value->field_feature__bitmap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extended_Feature_Bitmap := ");
if (match_value.extended__Feature__Bitmap().ispresent()) {
single_value->field_extended__Feature__Bitmap.log_match(match_value.extended__Feature__Bitmap(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extended__Feature__Bitmap.log();
if (single_value->field_extended__Feature__Bitmap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__BVC__RESET_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_bVCI.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_cell__Identifier.decode_text(text_buf);
single_value->field_feature__bitmap.decode_text(text_buf);
single_value->field_extended__Feature__Bitmap.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__BVC__RESET_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET.");
}
}

void PDU__BSSGP__BVC__RESET_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__BVC__RESET_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) feature__bitmap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) extended__Feature__Bitmap().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "feature_bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          feature__bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extended_Feature_Bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extended__Feature__Bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_RESET: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__BVC__RESET_template* precondition = new PDU__BSSGP__BVC__RESET_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__BVC__RESET_template* implied_template = new PDU__BSSGP__BVC__RESET_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__BVC__RESET_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_BVC_RESET");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

PDU__BSSGP__BVC__RESET__ACK::PDU__BSSGP__BVC__RESET__ACK()
{
}

PDU__BSSGP__BVC__RESET__ACK::PDU__BSSGP__BVC__RESET__ACK(const OCTETSTRING& par_bssgpPduType,
    const BVCI& par_bVCI,
    const OPTIONAL< Cell__Identifier >& par_cell__Identifier,
    const OPTIONAL< Feature__bitmap >& par_feature__bitmap,
    const OPTIONAL< Extended__Feature__Bitmap >& par_extended__Feature__Bitmap)
  :   field_bssgpPduType(par_bssgpPduType),
  field_bVCI(par_bVCI),
  field_cell__Identifier(par_cell__Identifier),
  field_feature__bitmap(par_feature__bitmap),
  field_extended__Feature__Bitmap(par_extended__Feature__Bitmap)
{
}

PDU__BSSGP__BVC__RESET__ACK::PDU__BSSGP__BVC__RESET__ACK(const PDU__BSSGP__BVC__RESET__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
else field_cell__Identifier.clean_up();
if (other_value.feature__bitmap().is_bound()) field_feature__bitmap = other_value.feature__bitmap();
else field_feature__bitmap.clean_up();
if (other_value.extended__Feature__Bitmap().is_bound()) field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap();
else field_extended__Feature__Bitmap.clean_up();
}

void PDU__BSSGP__BVC__RESET__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_bVCI.clean_up();
field_cell__Identifier.clean_up();
field_feature__bitmap.clean_up();
field_extended__Feature__Bitmap.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__BVC__RESET__ACK::get_descriptor() const { return &PDU__BSSGP__BVC__RESET__ACK_descr_; }
PDU__BSSGP__BVC__RESET__ACK& PDU__BSSGP__BVC__RESET__ACK::operator=(const PDU__BSSGP__BVC__RESET__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
  else field_cell__Identifier.clean_up();
  if (other_value.feature__bitmap().is_bound()) field_feature__bitmap = other_value.feature__bitmap();
  else field_feature__bitmap.clean_up();
  if (other_value.extended__Feature__Bitmap().is_bound()) field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap();
  else field_extended__Feature__Bitmap.clean_up();
}
return *this;
}

boolean PDU__BSSGP__BVC__RESET__ACK::operator==(const PDU__BSSGP__BVC__RESET__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_bVCI==other_value.field_bVCI
  && field_cell__Identifier==other_value.field_cell__Identifier
  && field_feature__bitmap==other_value.field_feature__bitmap
  && field_extended__Feature__Bitmap==other_value.field_extended__Feature__Bitmap;
}

boolean PDU__BSSGP__BVC__RESET__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_bVCI.is_bound())
  || (OPTIONAL_OMIT == field_cell__Identifier.get_selection() || field_cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_feature__bitmap.get_selection() || field_feature__bitmap.is_bound())
  || (OPTIONAL_OMIT == field_extended__Feature__Bitmap.get_selection() || field_extended__Feature__Bitmap.is_bound());
}
boolean PDU__BSSGP__BVC__RESET__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_bVCI.is_value()
  && (OPTIONAL_OMIT == field_cell__Identifier.get_selection() || field_cell__Identifier.is_value())
  && (OPTIONAL_OMIT == field_feature__bitmap.get_selection() || field_feature__bitmap.is_value())
  && (OPTIONAL_OMIT == field_extended__Feature__Bitmap.get_selection() || field_extended__Feature__Bitmap.is_value());
}
int PDU__BSSGP__BVC__RESET__ACK::size_of() const
{
  int ret_val = 2;
  if (field_cell__Identifier.ispresent()) ret_val++;
  if (field_feature__bitmap.ispresent()) ret_val++;
  if (field_extended__Feature__Bitmap.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__BVC__RESET__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
field_cell__Identifier.log();
TTCN_Logger::log_event_str(", feature_bitmap := ");
field_feature__bitmap.log();
TTCN_Logger::log_event_str(", extended_Feature_Bitmap := ");
field_extended__Feature__Bitmap.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__BVC__RESET__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (!cell__Identifier().is_bound()) cell__Identifier() = OMIT_VALUE;
else cell__Identifier().set_implicit_omit();
if (!feature__bitmap().is_bound()) feature__bitmap() = OMIT_VALUE;
else feature__bitmap().set_implicit_omit();
if (!extended__Feature__Bitmap().is_bound()) extended__Feature__Bitmap() = OMIT_VALUE;
else extended__Feature__Bitmap().set_implicit_omit();
}

void PDU__BSSGP__BVC__RESET__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) feature__bitmap().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) extended__Feature__Bitmap().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "feature_bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          feature__bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extended_Feature_Bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extended__Feature__Bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK");
  }
}

void PDU__BSSGP__BVC__RESET__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_cell__Identifier.encode_text(text_buf);
field_feature__bitmap.encode_text(text_buf);
field_extended__Feature__Bitmap.encode_text(text_buf);
}

void PDU__BSSGP__BVC__RESET__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_cell__Identifier.decode_text(text_buf);
field_feature__bitmap.decode_text(text_buf);
field_extended__Feature__Bitmap.decode_text(text_buf);
}

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

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

int PDU__BSSGP__BVC__RESET__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_cell__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_cell__Identifier().RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_cell__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cell__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_feature__bitmap = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Feature__bitmap_descr_.raw->forceomit);
  decoded_field_length = field_feature__bitmap().RAW_decode(Feature__bitmap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_feature__bitmap = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_feature__bitmap=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_extended__Feature__Bitmap = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Extended__Feature__Bitmap_descr_.raw->forceomit);
  decoded_field_length = field_extended__Feature__Bitmap().RAW_decode(Extended__Feature__Bitmap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_extended__Feature__Bitmap = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_extended__Feature__Bitmap=OMIT_VALUE;
  if (field_bssgpPduType !=  os_73) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__BVC__RESET__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, BVCI_descr_.raw);
  if (field_cell__Identifier.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Cell__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_feature__bitmap.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Feature__bitmap_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_extended__Feature__Bitmap.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Extended__Feature__Bitmap_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[1]);
  if (field_cell__Identifier.ispresent()) {
  encoded_length += field_cell__Identifier().RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_feature__bitmap.ispresent()) {
  encoded_length += field_feature__bitmap().RAW_encode(Feature__bitmap_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_extended__Feature__Bitmap.ispresent()) {
  encoded_length += field_extended__Feature__Bitmap().RAW_encode(Extended__Feature__Bitmap_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_bssgpPduType !=  os_73) {
  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_73.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__BVC__RESET__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
BVCI_template field_bVCI;
Cell__Identifier_template field_cell__Identifier;
Feature__bitmap_template field_feature__bitmap;
Extended__Feature__Bitmap_template field_extended__Feature__Bitmap;
};

void PDU__BSSGP__BVC__RESET__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_cell__Identifier = ANY_OR_OMIT;
single_value->field_feature__bitmap = ANY_OR_OMIT;
single_value->field_extended__Feature__Bitmap = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__BVC__RESET__ACK_template::copy_value(const PDU__BSSGP__BVC__RESET__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.cell__Identifier().is_bound()) {
  if (other_value.cell__Identifier().ispresent()) single_value->field_cell__Identifier = other_value.cell__Identifier()();
  else single_value->field_cell__Identifier = OMIT_VALUE;
} else {
  single_value->field_cell__Identifier.clean_up();
}
if (other_value.feature__bitmap().is_bound()) {
  if (other_value.feature__bitmap().ispresent()) single_value->field_feature__bitmap = other_value.feature__bitmap()();
  else single_value->field_feature__bitmap = OMIT_VALUE;
} else {
  single_value->field_feature__bitmap.clean_up();
}
if (other_value.extended__Feature__Bitmap().is_bound()) {
  if (other_value.extended__Feature__Bitmap().ispresent()) single_value->field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap()();
  else single_value->field_extended__Feature__Bitmap = OMIT_VALUE;
} else {
  single_value->field_extended__Feature__Bitmap.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__BVC__RESET__ACK_template::copy_template(const PDU__BSSGP__BVC__RESET__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__Identifier().get_selection()) {
single_value->field_cell__Identifier = other_value.cell__Identifier();
} else {
single_value->field_cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.feature__bitmap().get_selection()) {
single_value->field_feature__bitmap = other_value.feature__bitmap();
} else {
single_value->field_feature__bitmap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extended__Feature__Bitmap().get_selection()) {
single_value->field_extended__Feature__Bitmap = other_value.extended__Feature__Bitmap();
} else {
single_value->field_extended__Feature__Bitmap.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__BVC__RESET__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__BVC__RESET__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__BVC__RESET__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__BVC__RESET__ACK_template::PDU__BSSGP__BVC__RESET__ACK_template()
{
}

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

PDU__BSSGP__BVC__RESET__ACK_template::PDU__BSSGP__BVC__RESET__ACK_template(const PDU__BSSGP__BVC__RESET__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__BVC__RESET__ACK_template::match(const PDU__BSSGP__BVC__RESET__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.cell__Identifier().is_bound()) return FALSE;
if((other_value.cell__Identifier().ispresent() ? !single_value->field_cell__Identifier.match((const Cell__Identifier&)other_value.cell__Identifier(), legacy) : !single_value->field_cell__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.feature__bitmap().is_bound()) return FALSE;
if((other_value.feature__bitmap().ispresent() ? !single_value->field_feature__bitmap.match((const Feature__bitmap&)other_value.feature__bitmap(), legacy) : !single_value->field_feature__bitmap.match_omit(legacy)))return FALSE;
if(!other_value.extended__Feature__Bitmap().is_bound()) return FALSE;
if((other_value.extended__Feature__Bitmap().ispresent() ? !single_value->field_extended__Feature__Bitmap.match((const Extended__Feature__Bitmap&)other_value.extended__Feature__Bitmap(), legacy) : !single_value->field_extended__Feature__Bitmap.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__BVC__RESET__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_bVCI.is_bound()
 || (single_value->field_cell__Identifier.is_omit() || single_value->field_cell__Identifier.is_bound())
 || (single_value->field_feature__bitmap.is_omit() || single_value->field_feature__bitmap.is_bound())
 || (single_value->field_extended__Feature__Bitmap.is_omit() || single_value->field_extended__Feature__Bitmap.is_bound());
}

boolean PDU__BSSGP__BVC__RESET__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_bVCI.is_value()
 && (single_value->field_cell__Identifier.is_omit() || single_value->field_cell__Identifier.is_value())
 && (single_value->field_feature__bitmap.is_omit() || single_value->field_feature__bitmap.is_value())
 && (single_value->field_extended__Feature__Bitmap.is_omit() || single_value->field_extended__Feature__Bitmap.is_value());
}

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

PDU__BSSGP__BVC__RESET__ACK PDU__BSSGP__BVC__RESET__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
PDU__BSSGP__BVC__RESET__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_cell__Identifier.is_omit()) ret_val.cell__Identifier() = OMIT_VALUE;
else if (single_value->field_cell__Identifier.is_bound()) {
ret_val.cell__Identifier() = single_value->field_cell__Identifier.valueof();
}
if (single_value->field_feature__bitmap.is_omit()) ret_val.feature__bitmap() = OMIT_VALUE;
else if (single_value->field_feature__bitmap.is_bound()) {
ret_val.feature__bitmap() = single_value->field_feature__bitmap.valueof();
}
if (single_value->field_extended__Feature__Bitmap.is_omit()) ret_val.extended__Feature__Bitmap() = OMIT_VALUE;
else if (single_value->field_extended__Feature__Bitmap.is_bound()) {
ret_val.extended__Feature__Bitmap() = single_value->field_extended__Feature__Bitmap.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__BVC__RESET__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__BVC__RESET__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
return single_value->field_bssgpPduType;
}

BVCI_template& PDU__BSSGP__BVC__RESET__ACK_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__BVC__RESET__ACK_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
return single_value->field_bVCI;
}

Cell__Identifier_template& PDU__BSSGP__BVC__RESET__ACK_template::cell__Identifier()
{
set_specific();
return single_value->field_cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__BVC__RESET__ACK_template::cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
return single_value->field_cell__Identifier;
}

Feature__bitmap_template& PDU__BSSGP__BVC__RESET__ACK_template::feature__bitmap()
{
set_specific();
return single_value->field_feature__bitmap;
}

const Feature__bitmap_template& PDU__BSSGP__BVC__RESET__ACK_template::feature__bitmap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field feature_bitmap of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
return single_value->field_feature__bitmap;
}

Extended__Feature__Bitmap_template& PDU__BSSGP__BVC__RESET__ACK_template::extended__Feature__Bitmap()
{
set_specific();
return single_value->field_extended__Feature__Bitmap;
}

const Extended__Feature__Bitmap_template& PDU__BSSGP__BVC__RESET__ACK_template::extended__Feature__Bitmap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extended_Feature_Bitmap of a non-specific template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK.");
return single_value->field_extended__Feature__Bitmap;
}

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

void PDU__BSSGP__BVC__RESET__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
single_value->field_cell__Identifier.log();
TTCN_Logger::log_event_str(", feature_bitmap := ");
single_value->field_feature__bitmap.log();
TTCN_Logger::log_event_str(", extended_Feature_Bitmap := ");
single_value->field_extended__Feature__Bitmap.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__BVC__RESET__ACK_template::log_match(const PDU__BSSGP__BVC__RESET__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cell__Identifier().ispresent()){
if(!single_value->field_cell__Identifier.match(match_value.cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_Identifier");
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cell__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cell_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cell__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.feature__bitmap().ispresent()){
if(!single_value->field_feature__bitmap.match(match_value.feature__bitmap(), legacy)){
TTCN_Logger::log_logmatch_info(".feature_bitmap");
single_value->field_feature__bitmap.log_match(match_value.feature__bitmap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_feature__bitmap.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".feature_bitmap := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_feature__bitmap.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extended__Feature__Bitmap().ispresent()){
if(!single_value->field_extended__Feature__Bitmap.match(match_value.extended__Feature__Bitmap(), legacy)){
TTCN_Logger::log_logmatch_info(".extended_Feature_Bitmap");
single_value->field_extended__Feature__Bitmap.log_match(match_value.extended__Feature__Bitmap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extended__Feature__Bitmap.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extended_Feature_Bitmap := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extended__Feature__Bitmap.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", cell_Identifier := ");
if (match_value.cell__Identifier().ispresent()) {
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cell__Identifier.log();
if (single_value->field_cell__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", feature_bitmap := ");
if (match_value.feature__bitmap().ispresent()) {
single_value->field_feature__bitmap.log_match(match_value.feature__bitmap(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_feature__bitmap.log();
if (single_value->field_feature__bitmap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extended_Feature_Bitmap := ");
if (match_value.extended__Feature__Bitmap().ispresent()) {
single_value->field_extended__Feature__Bitmap.log_match(match_value.extended__Feature__Bitmap(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extended__Feature__Bitmap.log();
if (single_value->field_extended__Feature__Bitmap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

void PDU__BSSGP__BVC__RESET__ACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__BVC__RESET__ACK_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) feature__bitmap().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) extended__Feature__Bitmap().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "feature_bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          feature__bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extended_Feature_Bitmap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extended__Feature__Bitmap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__BVC__RESET__ACK_template* precondition = new PDU__BSSGP__BVC__RESET__ACK_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__BVC__RESET__ACK_template* implied_template = new PDU__BSSGP__BVC__RESET__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__BVC__RESET__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_BVC_RESET_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

PDU__BSSGP__STATUS::PDU__BSSGP__STATUS()
{
}

PDU__BSSGP__STATUS::PDU__BSSGP__STATUS(const OCTETSTRING& par_bssgpPduType,
    const Cause__BSSGP& par_cause,
    const OPTIONAL< BVCI >& par_bVCI,
    const OPTIONAL< PDU__in__Error >& par_pDU__in__Error)
  :   field_bssgpPduType(par_bssgpPduType),
  field_cause(par_cause),
  field_bVCI(par_bVCI),
  field_pDU__in__Error(par_pDU__in__Error)
{
}

PDU__BSSGP__STATUS::PDU__BSSGP__STATUS(const PDU__BSSGP__STATUS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_STATUS.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.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();
}

void PDU__BSSGP__STATUS::clean_up()
{
field_bssgpPduType.clean_up();
field_cause.clean_up();
field_bVCI.clean_up();
field_pDU__in__Error.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__STATUS::get_descriptor() const { return &PDU__BSSGP__STATUS_descr_; }
PDU__BSSGP__STATUS& PDU__BSSGP__STATUS::operator=(const PDU__BSSGP__STATUS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_STATUS.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.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();
}
return *this;
}

boolean PDU__BSSGP__STATUS::operator==(const PDU__BSSGP__STATUS& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_cause==other_value.field_cause
  && field_bVCI==other_value.field_bVCI
  && field_pDU__in__Error==other_value.field_pDU__in__Error;
}

boolean PDU__BSSGP__STATUS::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_cause.is_bound())
  || (OPTIONAL_OMIT == field_bVCI.get_selection() || field_bVCI.is_bound())
  || (OPTIONAL_OMIT == field_pDU__in__Error.get_selection() || field_pDU__in__Error.is_bound());
}
boolean PDU__BSSGP__STATUS::is_value() const
{
return field_bssgpPduType.is_value()
  && field_cause.is_value()
  && (OPTIONAL_OMIT == field_bVCI.get_selection() || field_bVCI.is_value())
  && (OPTIONAL_OMIT == field_pDU__in__Error.get_selection() || field_pDU__in__Error.is_value());
}
int PDU__BSSGP__STATUS::size_of() const
{
  int ret_val = 2;
  if (field_bVCI.ispresent()) ret_val++;
  if (field_pDU__in__Error.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__STATUS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", pDU_in_Error := ");
field_pDU__in__Error.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__STATUS::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!bVCI().is_bound()) bVCI() = OMIT_VALUE;
else bVCI().set_implicit_omit();
if (!pDU__in__Error().is_bound()) pDU__in__Error() = OMIT_VALUE;
else pDU__in__Error().set_implicit_omit();
}

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

void PDU__BSSGP__STATUS::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_pDU__in__Error.encode_text(text_buf);
}

void PDU__BSSGP__STATUS::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_pDU__in__Error.decode_text(text_buf);
}

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

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

int PDU__BSSGP__STATUS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_bVCI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI().RAW_decode(BVCI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_bVCI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bVCI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_pDU__in__Error = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__in__Error_descr_.raw->forceomit);
  decoded_field_length = field_pDU__in__Error().RAW_decode(PDU__in__Error_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_pDU__in__Error = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pDU__in__Error=OMIT_VALUE;
  if (field_bssgpPduType !=  os_67) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__STATUS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, Cause__BSSGP_descr_.raw);
  if (field_bVCI.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BVCI_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_pDU__in__Error.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__in__Error_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_bVCI.ispresent()) {
  encoded_length += field_bVCI().RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_pDU__in__Error.ispresent()) {
  encoded_length += field_pDU__in__Error().RAW_encode(PDU__in__Error_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bssgpPduType !=  os_67) {
  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_67.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__STATUS_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
Cause__BSSGP_template field_cause;
BVCI_template field_bVCI;
PDU__in__Error_template field_pDU__in__Error;
};

void PDU__BSSGP__STATUS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_bVCI = ANY_OR_OMIT;
single_value->field_pDU__in__Error = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__STATUS_template::copy_value(const PDU__BSSGP__STATUS& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.bVCI().is_bound()) {
  if (other_value.bVCI().ispresent()) single_value->field_bVCI = other_value.bVCI()();
  else single_value->field_bVCI = OMIT_VALUE;
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.pDU__in__Error().is_bound()) {
  if (other_value.pDU__in__Error().ispresent()) single_value->field_pDU__in__Error = other_value.pDU__in__Error()();
  else single_value->field_pDU__in__Error = OMIT_VALUE;
} else {
  single_value->field_pDU__in__Error.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__STATUS_template::copy_template(const PDU__BSSGP__STATUS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.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();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__STATUS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__STATUS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__STATUS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_STATUS.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__STATUS_template::PDU__BSSGP__STATUS_template()
{
}

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

PDU__BSSGP__STATUS_template::PDU__BSSGP__STATUS_template(const PDU__BSSGP__STATUS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__STATUS_template::match(const PDU__BSSGP__STATUS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if((other_value.bVCI().ispresent() ? !single_value->field_bVCI.match((const BVCI&)other_value.bVCI(), legacy) : !single_value->field_bVCI.match_omit(legacy)))return FALSE;
if(!other_value.pDU__in__Error().is_bound()) return FALSE;
if((other_value.pDU__in__Error().ispresent() ? !single_value->field_pDU__in__Error.match((const PDU__in__Error&)other_value.pDU__in__Error(), legacy) : !single_value->field_pDU__in__Error.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_STATUS.");
}
return FALSE;
}

boolean PDU__BSSGP__STATUS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_cause.is_bound()
 || (single_value->field_bVCI.is_omit() || single_value->field_bVCI.is_bound())
 || (single_value->field_pDU__in__Error.is_omit() || single_value->field_pDU__in__Error.is_bound());
}

boolean PDU__BSSGP__STATUS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_cause.is_value()
 && (single_value->field_bVCI.is_omit() || single_value->field_bVCI.is_value())
 && (single_value->field_pDU__in__Error.is_omit() || single_value->field_pDU__in__Error.is_value());
}

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

PDU__BSSGP__STATUS PDU__BSSGP__STATUS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_STATUS.");
PDU__BSSGP__STATUS ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_bVCI.is_omit()) ret_val.bVCI() = OMIT_VALUE;
else if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_pDU__in__Error.is_omit()) ret_val.pDU__in__Error() = OMIT_VALUE;
else if (single_value->field_pDU__in__Error.is_bound()) {
ret_val.pDU__in__Error() = single_value->field_pDU__in__Error.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__STATUS_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__STATUS_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_STATUS.");
return single_value->field_bssgpPduType;
}

Cause__BSSGP_template& PDU__BSSGP__STATUS_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__STATUS_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_STATUS.");
return single_value->field_cause;
}

BVCI_template& PDU__BSSGP__STATUS_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__STATUS_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_STATUS.");
return single_value->field_bVCI;
}

PDU__in__Error_template& PDU__BSSGP__STATUS_template::pDU__in__Error()
{
set_specific();
return single_value->field_pDU__in__Error;
}

const PDU__in__Error_template& PDU__BSSGP__STATUS_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.PDU_BSSGP_STATUS.");
return single_value->field_pDU__in__Error;
}

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

void PDU__BSSGP__STATUS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", pDU_in_Error := ");
single_value->field_pDU__in__Error.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__STATUS_template::log_match(const PDU__BSSGP__STATUS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.bVCI().ispresent()){
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bVCI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bVCI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pDU__in__Error().ispresent()){
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);
}
} else {
if (!single_value->field_pDU__in__Error.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pDU_in_Error := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pDU__in__Error.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
if (match_value.bVCI().ispresent()) {
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bVCI.log();
if (single_value->field_bVCI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pDU_in_Error := ");
if (match_value.pDU__in__Error().ispresent()) {
single_value->field_pDU__in__Error.log_match(match_value.pDU__in__Error(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pDU__in__Error.log();
if (single_value->field_pDU__in__Error.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__SGSN__INVOKE__TRACE::PDU__BSSGP__SGSN__INVOKE__TRACE()
{
}

PDU__BSSGP__SGSN__INVOKE__TRACE::PDU__BSSGP__SGSN__INVOKE__TRACE(const OCTETSTRING& par_bssgpPduType,
    const Trace__Type__BSSGP& par_traceType,
    const Trace__Reference__BSSGP& par_traceReference,
    const OPTIONAL< Trigger__Id__BSSGP >& par_triggerId,
    const OPTIONAL< Mobile__Id__BSSGP >& par_mobileId,
    const OPTIONAL< OMC__Id__BSSGP >& par_omcId,
    const OPTIONAL< TransactionId__BSSGP >& par_transactionId)
  :   field_bssgpPduType(par_bssgpPduType),
  field_traceType(par_traceType),
  field_traceReference(par_traceReference),
  field_triggerId(par_triggerId),
  field_mobileId(par_mobileId),
  field_omcId(par_omcId),
  field_transactionId(par_transactionId)
{
}

PDU__BSSGP__SGSN__INVOKE__TRACE::PDU__BSSGP__SGSN__INVOKE__TRACE(const PDU__BSSGP__SGSN__INVOKE__TRACE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.traceType().is_bound()) field_traceType = other_value.traceType();
else field_traceType.clean_up();
if (other_value.traceReference().is_bound()) field_traceReference = other_value.traceReference();
else field_traceReference.clean_up();
if (other_value.triggerId().is_bound()) field_triggerId = other_value.triggerId();
else field_triggerId.clean_up();
if (other_value.mobileId().is_bound()) field_mobileId = other_value.mobileId();
else field_mobileId.clean_up();
if (other_value.omcId().is_bound()) field_omcId = other_value.omcId();
else field_omcId.clean_up();
if (other_value.transactionId().is_bound()) field_transactionId = other_value.transactionId();
else field_transactionId.clean_up();
}

void PDU__BSSGP__SGSN__INVOKE__TRACE::clean_up()
{
field_bssgpPduType.clean_up();
field_traceType.clean_up();
field_traceReference.clean_up();
field_triggerId.clean_up();
field_mobileId.clean_up();
field_omcId.clean_up();
field_transactionId.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__SGSN__INVOKE__TRACE::get_descriptor() const { return &PDU__BSSGP__SGSN__INVOKE__TRACE_descr_; }
PDU__BSSGP__SGSN__INVOKE__TRACE& PDU__BSSGP__SGSN__INVOKE__TRACE::operator=(const PDU__BSSGP__SGSN__INVOKE__TRACE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.traceType().is_bound()) field_traceType = other_value.traceType();
  else field_traceType.clean_up();
  if (other_value.traceReference().is_bound()) field_traceReference = other_value.traceReference();
  else field_traceReference.clean_up();
  if (other_value.triggerId().is_bound()) field_triggerId = other_value.triggerId();
  else field_triggerId.clean_up();
  if (other_value.mobileId().is_bound()) field_mobileId = other_value.mobileId();
  else field_mobileId.clean_up();
  if (other_value.omcId().is_bound()) field_omcId = other_value.omcId();
  else field_omcId.clean_up();
  if (other_value.transactionId().is_bound()) field_transactionId = other_value.transactionId();
  else field_transactionId.clean_up();
}
return *this;
}

boolean PDU__BSSGP__SGSN__INVOKE__TRACE::operator==(const PDU__BSSGP__SGSN__INVOKE__TRACE& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_traceType==other_value.field_traceType
  && field_traceReference==other_value.field_traceReference
  && field_triggerId==other_value.field_triggerId
  && field_mobileId==other_value.field_mobileId
  && field_omcId==other_value.field_omcId
  && field_transactionId==other_value.field_transactionId;
}

boolean PDU__BSSGP__SGSN__INVOKE__TRACE::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_traceType.is_bound())
  || (field_traceReference.is_bound())
  || (OPTIONAL_OMIT == field_triggerId.get_selection() || field_triggerId.is_bound())
  || (OPTIONAL_OMIT == field_mobileId.get_selection() || field_mobileId.is_bound())
  || (OPTIONAL_OMIT == field_omcId.get_selection() || field_omcId.is_bound())
  || (OPTIONAL_OMIT == field_transactionId.get_selection() || field_transactionId.is_bound());
}
boolean PDU__BSSGP__SGSN__INVOKE__TRACE::is_value() const
{
return field_bssgpPduType.is_value()
  && field_traceType.is_value()
  && field_traceReference.is_value()
  && (OPTIONAL_OMIT == field_triggerId.get_selection() || field_triggerId.is_value())
  && (OPTIONAL_OMIT == field_mobileId.get_selection() || field_mobileId.is_value())
  && (OPTIONAL_OMIT == field_omcId.get_selection() || field_omcId.is_value())
  && (OPTIONAL_OMIT == field_transactionId.get_selection() || field_transactionId.is_value());
}
int PDU__BSSGP__SGSN__INVOKE__TRACE::size_of() const
{
  int ret_val = 3;
  if (field_triggerId.ispresent()) ret_val++;
  if (field_mobileId.ispresent()) ret_val++;
  if (field_omcId.ispresent()) ret_val++;
  if (field_transactionId.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__SGSN__INVOKE__TRACE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", traceType := ");
field_traceType.log();
TTCN_Logger::log_event_str(", traceReference := ");
field_traceReference.log();
TTCN_Logger::log_event_str(", triggerId := ");
field_triggerId.log();
TTCN_Logger::log_event_str(", mobileId := ");
field_mobileId.log();
TTCN_Logger::log_event_str(", omcId := ");
field_omcId.log();
TTCN_Logger::log_event_str(", transactionId := ");
field_transactionId.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__SGSN__INVOKE__TRACE::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (traceType().is_bound()) traceType().set_implicit_omit();
if (traceReference().is_bound()) traceReference().set_implicit_omit();
if (!triggerId().is_bound()) triggerId() = OMIT_VALUE;
else triggerId().set_implicit_omit();
if (!mobileId().is_bound()) mobileId() = OMIT_VALUE;
else mobileId().set_implicit_omit();
if (!omcId().is_bound()) omcId() = OMIT_VALUE;
else omcId().set_implicit_omit();
if (!transactionId().is_bound()) transactionId() = OMIT_VALUE;
else transactionId().set_implicit_omit();
}

void PDU__BSSGP__SGSN__INVOKE__TRACE::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.PDU_BSSGP_SGSN_INVOKE_TRACE 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) traceType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) traceReference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) triggerId().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) omcId().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) transactionId().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "traceType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          traceType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "traceReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          traceReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "triggerId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          triggerId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "omcId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          omcId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "transactionId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          transactionId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
  }
}

void PDU__BSSGP__SGSN__INVOKE__TRACE::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_traceType.encode_text(text_buf);
field_traceReference.encode_text(text_buf);
field_triggerId.encode_text(text_buf);
field_mobileId.encode_text(text_buf);
field_omcId.encode_text(text_buf);
field_transactionId.encode_text(text_buf);
}

void PDU__BSSGP__SGSN__INVOKE__TRACE::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_traceType.decode_text(text_buf);
field_traceReference.decode_text(text_buf);
field_triggerId.decode_text(text_buf);
field_mobileId.decode_text(text_buf);
field_omcId.decode_text(text_buf);
field_transactionId.decode_text(text_buf);
}

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

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

int PDU__BSSGP__SGSN__INVOKE__TRACE::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, Trace__Type__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_traceType.RAW_decode(Trace__Type__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Trace__Reference__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_traceReference.RAW_decode(Trace__Reference__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_triggerId = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Trigger__Id__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_triggerId().RAW_decode(Trigger__Id__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_triggerId = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_triggerId=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_mobileId = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Mobile__Id__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_mobileId().RAW_decode(Mobile__Id__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_mobileId = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mobileId=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_omcId = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, OMC__Id__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_omcId().RAW_decode(OMC__Id__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_omcId = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_omcId=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_transactionId = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, TransactionId__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_transactionId().RAW_decode(TransactionId__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_transactionId = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_transactionId=OMIT_VALUE;
  if (field_bssgpPduType !=  os_74) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__SGSN__INVOKE__TRACE::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, Trace__Type__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Trace__Reference__BSSGP_descr_.raw);
  if (field_triggerId.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Trigger__Id__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_mobileId.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Mobile__Id__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_omcId.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, OMC__Id__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_transactionId.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, TransactionId__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_traceType.RAW_encode(Trace__Type__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_traceReference.RAW_encode(Trace__Reference__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_triggerId.ispresent()) {
  encoded_length += field_triggerId().RAW_encode(Trigger__Id__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_mobileId.ispresent()) {
  encoded_length += field_mobileId().RAW_encode(Mobile__Id__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_omcId.ispresent()) {
  encoded_length += field_omcId().RAW_encode(OMC__Id__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_transactionId.ispresent()) {
  encoded_length += field_transactionId().RAW_encode(TransactionId__BSSGP_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_bssgpPduType !=  os_74) {
  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_74.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__SGSN__INVOKE__TRACE_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
Trace__Type__BSSGP_template field_traceType;
Trace__Reference__BSSGP_template field_traceReference;
Trigger__Id__BSSGP_template field_triggerId;
Mobile__Id__BSSGP_template field_mobileId;
OMC__Id__BSSGP_template field_omcId;
TransactionId__BSSGP_template field_transactionId;
};

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_traceType = ANY_VALUE;
single_value->field_traceReference = ANY_VALUE;
single_value->field_triggerId = ANY_OR_OMIT;
single_value->field_mobileId = ANY_OR_OMIT;
single_value->field_omcId = ANY_OR_OMIT;
single_value->field_transactionId = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::copy_value(const PDU__BSSGP__SGSN__INVOKE__TRACE& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.traceType().is_bound()) {
  single_value->field_traceType = other_value.traceType();
} else {
  single_value->field_traceType.clean_up();
}
if (other_value.traceReference().is_bound()) {
  single_value->field_traceReference = other_value.traceReference();
} else {
  single_value->field_traceReference.clean_up();
}
if (other_value.triggerId().is_bound()) {
  if (other_value.triggerId().ispresent()) single_value->field_triggerId = other_value.triggerId()();
  else single_value->field_triggerId = OMIT_VALUE;
} else {
  single_value->field_triggerId.clean_up();
}
if (other_value.mobileId().is_bound()) {
  if (other_value.mobileId().ispresent()) single_value->field_mobileId = other_value.mobileId()();
  else single_value->field_mobileId = OMIT_VALUE;
} else {
  single_value->field_mobileId.clean_up();
}
if (other_value.omcId().is_bound()) {
  if (other_value.omcId().ispresent()) single_value->field_omcId = other_value.omcId()();
  else single_value->field_omcId = OMIT_VALUE;
} else {
  single_value->field_omcId.clean_up();
}
if (other_value.transactionId().is_bound()) {
  if (other_value.transactionId().ispresent()) single_value->field_transactionId = other_value.transactionId()();
  else single_value->field_transactionId = OMIT_VALUE;
} else {
  single_value->field_transactionId.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::copy_template(const PDU__BSSGP__SGSN__INVOKE__TRACE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.traceType().get_selection()) {
single_value->field_traceType = other_value.traceType();
} else {
single_value->field_traceType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.traceReference().get_selection()) {
single_value->field_traceReference = other_value.traceReference();
} else {
single_value->field_traceReference.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.triggerId().get_selection()) {
single_value->field_triggerId = other_value.triggerId();
} else {
single_value->field_triggerId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileId().get_selection()) {
single_value->field_mobileId = other_value.mobileId();
} else {
single_value->field_mobileId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.omcId().get_selection()) {
single_value->field_omcId = other_value.omcId();
} else {
single_value->field_omcId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.transactionId().get_selection()) {
single_value->field_transactionId = other_value.transactionId();
} else {
single_value->field_transactionId.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__SGSN__INVOKE__TRACE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__SGSN__INVOKE__TRACE_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__SGSN__INVOKE__TRACE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__SGSN__INVOKE__TRACE_template::PDU__BSSGP__SGSN__INVOKE__TRACE_template()
{
}

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

PDU__BSSGP__SGSN__INVOKE__TRACE_template::PDU__BSSGP__SGSN__INVOKE__TRACE_template(const PDU__BSSGP__SGSN__INVOKE__TRACE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__SGSN__INVOKE__TRACE_template::match(const PDU__BSSGP__SGSN__INVOKE__TRACE& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.traceType().is_bound()) return FALSE;
if(!single_value->field_traceType.match(other_value.traceType(), legacy))return FALSE;
if(!other_value.traceReference().is_bound()) return FALSE;
if(!single_value->field_traceReference.match(other_value.traceReference(), legacy))return FALSE;
if(!other_value.triggerId().is_bound()) return FALSE;
if((other_value.triggerId().ispresent() ? !single_value->field_triggerId.match((const Trigger__Id__BSSGP&)other_value.triggerId(), legacy) : !single_value->field_triggerId.match_omit(legacy)))return FALSE;
if(!other_value.mobileId().is_bound()) return FALSE;
if((other_value.mobileId().ispresent() ? !single_value->field_mobileId.match((const Mobile__Id__BSSGP&)other_value.mobileId(), legacy) : !single_value->field_mobileId.match_omit(legacy)))return FALSE;
if(!other_value.omcId().is_bound()) return FALSE;
if((other_value.omcId().ispresent() ? !single_value->field_omcId.match((const OMC__Id__BSSGP&)other_value.omcId(), legacy) : !single_value->field_omcId.match_omit(legacy)))return FALSE;
if(!other_value.transactionId().is_bound()) return FALSE;
if((other_value.transactionId().ispresent() ? !single_value->field_transactionId.match((const TransactionId__BSSGP&)other_value.transactionId(), legacy) : !single_value->field_transactionId.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
}
return FALSE;
}

boolean PDU__BSSGP__SGSN__INVOKE__TRACE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_traceType.is_bound()
 || single_value->field_traceReference.is_bound()
 || (single_value->field_triggerId.is_omit() || single_value->field_triggerId.is_bound())
 || (single_value->field_mobileId.is_omit() || single_value->field_mobileId.is_bound())
 || (single_value->field_omcId.is_omit() || single_value->field_omcId.is_bound())
 || (single_value->field_transactionId.is_omit() || single_value->field_transactionId.is_bound());
}

boolean PDU__BSSGP__SGSN__INVOKE__TRACE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_traceType.is_value()
 && single_value->field_traceReference.is_value()
 && (single_value->field_triggerId.is_omit() || single_value->field_triggerId.is_value())
 && (single_value->field_mobileId.is_omit() || single_value->field_mobileId.is_value())
 && (single_value->field_omcId.is_omit() || single_value->field_omcId.is_value())
 && (single_value->field_transactionId.is_omit() || single_value->field_transactionId.is_value());
}

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

PDU__BSSGP__SGSN__INVOKE__TRACE PDU__BSSGP__SGSN__INVOKE__TRACE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
PDU__BSSGP__SGSN__INVOKE__TRACE ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_traceType.is_bound()) {
ret_val.traceType() = single_value->field_traceType.valueof();
}
if (single_value->field_traceReference.is_bound()) {
ret_val.traceReference() = single_value->field_traceReference.valueof();
}
if (single_value->field_triggerId.is_omit()) ret_val.triggerId() = OMIT_VALUE;
else if (single_value->field_triggerId.is_bound()) {
ret_val.triggerId() = single_value->field_triggerId.valueof();
}
if (single_value->field_mobileId.is_omit()) ret_val.mobileId() = OMIT_VALUE;
else if (single_value->field_mobileId.is_bound()) {
ret_val.mobileId() = single_value->field_mobileId.valueof();
}
if (single_value->field_omcId.is_omit()) ret_val.omcId() = OMIT_VALUE;
else if (single_value->field_omcId.is_bound()) {
ret_val.omcId() = single_value->field_omcId.valueof();
}
if (single_value->field_transactionId.is_omit()) ret_val.transactionId() = OMIT_VALUE;
else if (single_value->field_transactionId.is_bound()) {
ret_val.transactionId() = single_value->field_transactionId.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
return single_value->field_bssgpPduType;
}

Trace__Type__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::traceType()
{
set_specific();
return single_value->field_traceType;
}

const Trace__Type__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::traceType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field traceType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
return single_value->field_traceType;
}

Trace__Reference__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::traceReference()
{
set_specific();
return single_value->field_traceReference;
}

const Trace__Reference__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::traceReference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field traceReference of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
return single_value->field_traceReference;
}

Trigger__Id__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::triggerId()
{
set_specific();
return single_value->field_triggerId;
}

const Trigger__Id__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::triggerId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field triggerId of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
return single_value->field_triggerId;
}

Mobile__Id__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::mobileId()
{
set_specific();
return single_value->field_mobileId;
}

const Mobile__Id__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::mobileId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileId of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
return single_value->field_mobileId;
}

OMC__Id__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::omcId()
{
set_specific();
return single_value->field_omcId;
}

const OMC__Id__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::omcId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field omcId of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
return single_value->field_omcId;
}

TransactionId__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::transactionId()
{
set_specific();
return single_value->field_transactionId;
}

const TransactionId__BSSGP_template& PDU__BSSGP__SGSN__INVOKE__TRACE_template::transactionId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field transactionId of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
return single_value->field_transactionId;
}

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

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", traceType := ");
single_value->field_traceType.log();
TTCN_Logger::log_event_str(", traceReference := ");
single_value->field_traceReference.log();
TTCN_Logger::log_event_str(", triggerId := ");
single_value->field_triggerId.log();
TTCN_Logger::log_event_str(", mobileId := ");
single_value->field_mobileId.log();
TTCN_Logger::log_event_str(", omcId := ");
single_value->field_omcId.log();
TTCN_Logger::log_event_str(", transactionId := ");
single_value->field_transactionId.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::log_match(const PDU__BSSGP__SGSN__INVOKE__TRACE& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_traceType.match(match_value.traceType(), legacy)){
TTCN_Logger::log_logmatch_info(".traceType");
single_value->field_traceType.log_match(match_value.traceType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_traceReference.match(match_value.traceReference(), legacy)){
TTCN_Logger::log_logmatch_info(".traceReference");
single_value->field_traceReference.log_match(match_value.traceReference(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.triggerId().ispresent()){
if(!single_value->field_triggerId.match(match_value.triggerId(), legacy)){
TTCN_Logger::log_logmatch_info(".triggerId");
single_value->field_triggerId.log_match(match_value.triggerId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_triggerId.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".triggerId := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_triggerId.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileId().ispresent()){
if(!single_value->field_mobileId.match(match_value.mobileId(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileId");
single_value->field_mobileId.log_match(match_value.mobileId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileId.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileId := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileId.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.omcId().ispresent()){
if(!single_value->field_omcId.match(match_value.omcId(), legacy)){
TTCN_Logger::log_logmatch_info(".omcId");
single_value->field_omcId.log_match(match_value.omcId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_omcId.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".omcId := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_omcId.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.transactionId().ispresent()){
if(!single_value->field_transactionId.match(match_value.transactionId(), legacy)){
TTCN_Logger::log_logmatch_info(".transactionId");
single_value->field_transactionId.log_match(match_value.transactionId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_transactionId.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".transactionId := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_transactionId.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", traceType := ");
single_value->field_traceType.log_match(match_value.traceType(), legacy);
TTCN_Logger::log_event_str(", traceReference := ");
single_value->field_traceReference.log_match(match_value.traceReference(), legacy);
TTCN_Logger::log_event_str(", triggerId := ");
if (match_value.triggerId().ispresent()) {
single_value->field_triggerId.log_match(match_value.triggerId(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_triggerId.log();
if (single_value->field_triggerId.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileId := ");
if (match_value.mobileId().ispresent()) {
single_value->field_mobileId.log_match(match_value.mobileId(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileId.log();
if (single_value->field_mobileId.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", omcId := ");
if (match_value.omcId().ispresent()) {
single_value->field_omcId.log_match(match_value.omcId(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_omcId.log();
if (single_value->field_omcId.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", transactionId := ");
if (match_value.transactionId().ispresent()) {
single_value->field_transactionId.log_match(match_value.transactionId(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_transactionId.log();
if (single_value->field_transactionId.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_traceType.decode_text(text_buf);
single_value->field_traceReference.decode_text(text_buf);
single_value->field_triggerId.decode_text(text_buf);
single_value->field_mobileId.decode_text(text_buf);
single_value->field_omcId.decode_text(text_buf);
single_value->field_transactionId.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__SGSN__INVOKE__TRACE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE.");
}
}

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__SGSN__INVOKE__TRACE_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.PDU_BSSGP_SGSN_INVOKE_TRACE 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) traceType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) traceReference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) triggerId().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) omcId().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) transactionId().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "traceType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          traceType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "traceReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          traceReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "triggerId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          triggerId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "omcId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          omcId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "transactionId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          transactionId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__SGSN__INVOKE__TRACE_template* precondition = new PDU__BSSGP__SGSN__INVOKE__TRACE_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__SGSN__INVOKE__TRACE_template* implied_template = new PDU__BSSGP__SGSN__INVOKE__TRACE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__SGSN__INVOKE__TRACE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__SGSN__INVOKE__TRACE_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
single_value->field_traceType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
single_value->field_traceReference.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
single_value->field_triggerId.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
single_value->field_mobileId.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
single_value->field_omcId.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
single_value->field_transactionId.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SGSN_INVOKE_TRACE");
}

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

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

PDU__BSSGP__DOWNLOAD__BSS__PFC::PDU__BSSGP__DOWNLOAD__BSS__PFC()
{
}

PDU__BSSGP__DOWNLOAD__BSS__PFC::PDU__BSSGP__DOWNLOAD__BSS__PFC(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI)
{
}

PDU__BSSGP__DOWNLOAD__BSS__PFC::PDU__BSSGP__DOWNLOAD__BSS__PFC(const PDU__BSSGP__DOWNLOAD__BSS__PFC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
}

void PDU__BSSGP__DOWNLOAD__BSS__PFC::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DOWNLOAD__BSS__PFC::get_descriptor() const { return &PDU__BSSGP__DOWNLOAD__BSS__PFC_descr_; }
PDU__BSSGP__DOWNLOAD__BSS__PFC& PDU__BSSGP__DOWNLOAD__BSS__PFC::operator=(const PDU__BSSGP__DOWNLOAD__BSS__PFC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DOWNLOAD__BSS__PFC::operator==(const PDU__BSSGP__DOWNLOAD__BSS__PFC& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI;
}

boolean PDU__BSSGP__DOWNLOAD__BSS__PFC::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound());
}
boolean PDU__BSSGP__DOWNLOAD__BSS__PFC::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value();
}
void PDU__BSSGP__DOWNLOAD__BSS__PFC::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DOWNLOAD__BSS__PFC::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
}

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

void PDU__BSSGP__DOWNLOAD__BSS__PFC::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
}

void PDU__BSSGP__DOWNLOAD__BSS__PFC::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
}

void PDU__BSSGP__DOWNLOAD__BSS__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 PDU__BSSGP__DOWNLOAD__BSS__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 PDU__BSSGP__DOWNLOAD__BSS__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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_75) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__DOWNLOAD__BSS__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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_75) {
  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_75.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__DOWNLOAD__BSS__PFC_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
};

void PDU__BSSGP__DOWNLOAD__BSS__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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
}
}
}

void PDU__BSSGP__DOWNLOAD__BSS__PFC_template::copy_value(const PDU__BSSGP__DOWNLOAD__BSS__PFC& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DOWNLOAD__BSS__PFC_template::copy_template(const PDU__BSSGP__DOWNLOAD__BSS__PFC_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DOWNLOAD__BSS__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 PDU__BSSGP__DOWNLOAD__BSS__PFC_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DOWNLOAD__BSS__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.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DOWNLOAD__BSS__PFC_template::PDU__BSSGP__DOWNLOAD__BSS__PFC_template()
{
}

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

PDU__BSSGP__DOWNLOAD__BSS__PFC_template::PDU__BSSGP__DOWNLOAD__BSS__PFC_template(const PDU__BSSGP__DOWNLOAD__BSS__PFC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__DOWNLOAD__BSS__PFC_template::match(const PDU__BSSGP__DOWNLOAD__BSS__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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
}
return FALSE;
}

boolean PDU__BSSGP__DOWNLOAD__BSS__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_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound();
}

boolean PDU__BSSGP__DOWNLOAD__BSS__PFC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value();
}

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

PDU__BSSGP__DOWNLOAD__BSS__PFC PDU__BSSGP__DOWNLOAD__BSS__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.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
PDU__BSSGP__DOWNLOAD__BSS__PFC ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__DOWNLOAD__BSS__PFC_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DOWNLOAD__BSS__PFC_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__DOWNLOAD__BSS__PFC_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__DOWNLOAD__BSS__PFC_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__DOWNLOAD__BSS__PFC_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__DOWNLOAD__BSS__PFC_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
return single_value->field_pFI;
}

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

void PDU__BSSGP__DOWNLOAD__BSS__PFC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DOWNLOAD__BSS__PFC_template::log_match(const PDU__BSSGP__DOWNLOAD__BSS__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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__DOWNLOAD__BSS__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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__DOWNLOAD__BSS__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.PDU_BSSGP_DOWNLOAD_BSS_PFC.");
}
}

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

void PDU__BSSGP__DOWNLOAD__BSS__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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_PFC");
single_value->field_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DOWNLOAD_BSS_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.PDU_BSSGP_DOWNLOAD_BSS_PFC");
}

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

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

PDU__BSSGP__CREATE__BSS__PFC::PDU__BSSGP__CREATE__BSS__PFC()
{
}

PDU__BSSGP__CREATE__BSS__PFC::PDU__BSSGP__CREATE__BSS__PFC(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const OPTIONAL< IMSI__BSSGP >& par_iMSI,
    const PFI& par_pFI,
    const GPRS__Timer& par_pFT,
    const ABQP& par_aBQP,
    const OPTIONAL< Service__UTRAN__CCO >& par_service__UTRAN__CCO,
    const OPTIONAL< MS__Radio__Access__Capability >& par_mS__Radio__Access__Capability,
    const OPTIONAL< Priority__BSSGP >& par_allocation__Retention__Priority,
    const OPTIONAL< GPRS__Timer >& par_t10,
    const OPTIONAL< Inter__RAT__Handover__Info__BSSGP >& par_inter__RAT__Handover__Info,
    const OPTIONAL< E__UTRAN__Inter__RAT__Handover__Info >& par_e__UTRAN__Inter__RAT__Handover__Info,
    const OPTIONAL< Subscriber__Profile__ID__For__RAT__Priority >& par_subscriber__Profile__ID__For__RAT)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_iMSI(par_iMSI),
  field_pFI(par_pFI),
  field_pFT(par_pFT),
  field_aBQP(par_aBQP),
  field_service__UTRAN__CCO(par_service__UTRAN__CCO),
  field_mS__Radio__Access__Capability(par_mS__Radio__Access__Capability),
  field_allocation__Retention__Priority(par_allocation__Retention__Priority),
  field_t10(par_t10),
  field_inter__RAT__Handover__Info(par_inter__RAT__Handover__Info),
  field_e__UTRAN__Inter__RAT__Handover__Info(par_e__UTRAN__Inter__RAT__Handover__Info),
  field_subscriber__Profile__ID__For__RAT(par_subscriber__Profile__ID__For__RAT)
{
}

PDU__BSSGP__CREATE__BSS__PFC::PDU__BSSGP__CREATE__BSS__PFC(const PDU__BSSGP__CREATE__BSS__PFC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.pFT().is_bound()) field_pFT = other_value.pFT();
else field_pFT.clean_up();
if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
else field_aBQP.clean_up();
if (other_value.service__UTRAN__CCO().is_bound()) field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
else field_service__UTRAN__CCO.clean_up();
if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
else field_mS__Radio__Access__Capability.clean_up();
if (other_value.allocation__Retention__Priority().is_bound()) field_allocation__Retention__Priority = other_value.allocation__Retention__Priority();
else field_allocation__Retention__Priority.clean_up();
if (other_value.t10().is_bound()) field_t10 = other_value.t10();
else field_t10.clean_up();
if (other_value.inter__RAT__Handover__Info().is_bound()) field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info();
else field_inter__RAT__Handover__Info.clean_up();
if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
else field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
if (other_value.subscriber__Profile__ID__For__RAT().is_bound()) field_subscriber__Profile__ID__For__RAT = other_value.subscriber__Profile__ID__For__RAT();
else field_subscriber__Profile__ID__For__RAT.clean_up();
}

void PDU__BSSGP__CREATE__BSS__PFC::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_iMSI.clean_up();
field_pFI.clean_up();
field_pFT.clean_up();
field_aBQP.clean_up();
field_service__UTRAN__CCO.clean_up();
field_mS__Radio__Access__Capability.clean_up();
field_allocation__Retention__Priority.clean_up();
field_t10.clean_up();
field_inter__RAT__Handover__Info.clean_up();
field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
field_subscriber__Profile__ID__For__RAT.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__CREATE__BSS__PFC::get_descriptor() const { return &PDU__BSSGP__CREATE__BSS__PFC_descr_; }
PDU__BSSGP__CREATE__BSS__PFC& PDU__BSSGP__CREATE__BSS__PFC::operator=(const PDU__BSSGP__CREATE__BSS__PFC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.pFT().is_bound()) field_pFT = other_value.pFT();
  else field_pFT.clean_up();
  if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
  else field_aBQP.clean_up();
  if (other_value.service__UTRAN__CCO().is_bound()) field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
  else field_service__UTRAN__CCO.clean_up();
  if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
  else field_mS__Radio__Access__Capability.clean_up();
  if (other_value.allocation__Retention__Priority().is_bound()) field_allocation__Retention__Priority = other_value.allocation__Retention__Priority();
  else field_allocation__Retention__Priority.clean_up();
  if (other_value.t10().is_bound()) field_t10 = other_value.t10();
  else field_t10.clean_up();
  if (other_value.inter__RAT__Handover__Info().is_bound()) field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info();
  else field_inter__RAT__Handover__Info.clean_up();
  if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
  else field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
  if (other_value.subscriber__Profile__ID__For__RAT().is_bound()) field_subscriber__Profile__ID__For__RAT = other_value.subscriber__Profile__ID__For__RAT();
  else field_subscriber__Profile__ID__For__RAT.clean_up();
}
return *this;
}

boolean PDU__BSSGP__CREATE__BSS__PFC::operator==(const PDU__BSSGP__CREATE__BSS__PFC& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_iMSI==other_value.field_iMSI
  && field_pFI==other_value.field_pFI
  && field_pFT==other_value.field_pFT
  && field_aBQP==other_value.field_aBQP
  && field_service__UTRAN__CCO==other_value.field_service__UTRAN__CCO
  && field_mS__Radio__Access__Capability==other_value.field_mS__Radio__Access__Capability
  && field_allocation__Retention__Priority==other_value.field_allocation__Retention__Priority
  && field_t10==other_value.field_t10
  && field_inter__RAT__Handover__Info==other_value.field_inter__RAT__Handover__Info
  && field_e__UTRAN__Inter__RAT__Handover__Info==other_value.field_e__UTRAN__Inter__RAT__Handover__Info
  && field_subscriber__Profile__ID__For__RAT==other_value.field_subscriber__Profile__ID__For__RAT;
}

boolean PDU__BSSGP__CREATE__BSS__PFC::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_bound())
  || (field_pFI.is_bound())
  || (field_pFT.is_bound())
  || (field_aBQP.is_bound())
  || (OPTIONAL_OMIT == field_service__UTRAN__CCO.get_selection() || field_service__UTRAN__CCO.is_bound())
  || (OPTIONAL_OMIT == field_mS__Radio__Access__Capability.get_selection() || field_mS__Radio__Access__Capability.is_bound())
  || (OPTIONAL_OMIT == field_allocation__Retention__Priority.get_selection() || field_allocation__Retention__Priority.is_bound())
  || (OPTIONAL_OMIT == field_t10.get_selection() || field_t10.is_bound())
  || (OPTIONAL_OMIT == field_inter__RAT__Handover__Info.get_selection() || field_inter__RAT__Handover__Info.is_bound())
  || (OPTIONAL_OMIT == field_e__UTRAN__Inter__RAT__Handover__Info.get_selection() || field_e__UTRAN__Inter__RAT__Handover__Info.is_bound())
  || (OPTIONAL_OMIT == field_subscriber__Profile__ID__For__RAT.get_selection() || field_subscriber__Profile__ID__For__RAT.is_bound());
}
boolean PDU__BSSGP__CREATE__BSS__PFC::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_value())
  && field_pFI.is_value()
  && field_pFT.is_value()
  && field_aBQP.is_value()
  && (OPTIONAL_OMIT == field_service__UTRAN__CCO.get_selection() || field_service__UTRAN__CCO.is_value())
  && (OPTIONAL_OMIT == field_mS__Radio__Access__Capability.get_selection() || field_mS__Radio__Access__Capability.is_value())
  && (OPTIONAL_OMIT == field_allocation__Retention__Priority.get_selection() || field_allocation__Retention__Priority.is_value())
  && (OPTIONAL_OMIT == field_t10.get_selection() || field_t10.is_value())
  && (OPTIONAL_OMIT == field_inter__RAT__Handover__Info.get_selection() || field_inter__RAT__Handover__Info.is_value())
  && (OPTIONAL_OMIT == field_e__UTRAN__Inter__RAT__Handover__Info.get_selection() || field_e__UTRAN__Inter__RAT__Handover__Info.is_value())
  && (OPTIONAL_OMIT == field_subscriber__Profile__ID__For__RAT.get_selection() || field_subscriber__Profile__ID__For__RAT.is_value());
}
int PDU__BSSGP__CREATE__BSS__PFC::size_of() const
{
  int ret_val = 5;
  if (field_iMSI.ispresent()) ret_val++;
  if (field_service__UTRAN__CCO.ispresent()) ret_val++;
  if (field_mS__Radio__Access__Capability.ispresent()) ret_val++;
  if (field_allocation__Retention__Priority.ispresent()) ret_val++;
  if (field_t10.ispresent()) ret_val++;
  if (field_inter__RAT__Handover__Info.ispresent()) ret_val++;
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) ret_val++;
  if (field_subscriber__Profile__ID__For__RAT.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__CREATE__BSS__PFC::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", pFT := ");
field_pFT.log();
TTCN_Logger::log_event_str(", aBQP := ");
field_aBQP.log();
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(", allocation_Retention_Priority := ");
field_allocation__Retention__Priority.log();
TTCN_Logger::log_event_str(", t10 := ");
field_t10.log();
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info := ");
field_inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT := ");
field_subscriber__Profile__ID__For__RAT.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__CREATE__BSS__PFC::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (!iMSI().is_bound()) iMSI() = OMIT_VALUE;
else iMSI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
if (pFT().is_bound()) pFT().set_implicit_omit();
if (aBQP().is_bound()) aBQP().set_implicit_omit();
if (!service__UTRAN__CCO().is_bound()) service__UTRAN__CCO() = OMIT_VALUE;
else service__UTRAN__CCO().set_implicit_omit();
if (!mS__Radio__Access__Capability().is_bound()) mS__Radio__Access__Capability() = OMIT_VALUE;
else mS__Radio__Access__Capability().set_implicit_omit();
if (!allocation__Retention__Priority().is_bound()) allocation__Retention__Priority() = OMIT_VALUE;
else allocation__Retention__Priority().set_implicit_omit();
if (!t10().is_bound()) t10() = OMIT_VALUE;
else t10().set_implicit_omit();
if (!inter__RAT__Handover__Info().is_bound()) inter__RAT__Handover__Info() = OMIT_VALUE;
else inter__RAT__Handover__Info().set_implicit_omit();
if (!e__UTRAN__Inter__RAT__Handover__Info().is_bound()) e__UTRAN__Inter__RAT__Handover__Info() = OMIT_VALUE;
else e__UTRAN__Inter__RAT__Handover__Info().set_implicit_omit();
if (!subscriber__Profile__ID__For__RAT().is_bound()) subscriber__Profile__ID__For__RAT() = OMIT_VALUE;
else subscriber__Profile__ID__For__RAT().set_implicit_omit();
}

void PDU__BSSGP__CREATE__BSS__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 (13<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFT().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) service__UTRAN__CCO().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) allocation__Retention__Priority().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) t10().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) inter__RAT__Handover__Info().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) e__UTRAN__Inter__RAT__Handover__Info().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) subscriber__Profile__ID__For__RAT().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aBQP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aBQP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_UTRAN_CCO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__UTRAN__CCO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocation_Retention_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocation__Retention__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t10().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "e_UTRAN_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__UTRAN__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "subscriber_Profile_ID_For_RAT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          subscriber__Profile__ID__For__RAT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
  }
}

void PDU__BSSGP__CREATE__BSS__PFC::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_pFT.encode_text(text_buf);
field_aBQP.encode_text(text_buf);
field_service__UTRAN__CCO.encode_text(text_buf);
field_mS__Radio__Access__Capability.encode_text(text_buf);
field_allocation__Retention__Priority.encode_text(text_buf);
field_t10.encode_text(text_buf);
field_inter__RAT__Handover__Info.encode_text(text_buf);
field_e__UTRAN__Inter__RAT__Handover__Info.encode_text(text_buf);
field_subscriber__Profile__ID__For__RAT.encode_text(text_buf);
}

void PDU__BSSGP__CREATE__BSS__PFC::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_pFT.decode_text(text_buf);
field_aBQP.decode_text(text_buf);
field_service__UTRAN__CCO.decode_text(text_buf);
field_mS__Radio__Access__Capability.decode_text(text_buf);
field_allocation__Retention__Priority.decode_text(text_buf);
field_t10.decode_text(text_buf);
field_inter__RAT__Handover__Info.decode_text(text_buf);
field_e__UTRAN__Inter__RAT__Handover__Info.decode_text(text_buf);
field_subscriber__Profile__ID__For__RAT.decode_text(text_buf);
}

void PDU__BSSGP__CREATE__BSS__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 PDU__BSSGP__CREATE__BSS__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 PDU__BSSGP__CREATE__BSS__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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_iMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI().RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_iMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iMSI=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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, GPRS__Timer_descr_.raw->forceomit);
  decoded_field_length = field_pFT.RAW_decode(GPRS__Timer_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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, ABQP_descr_.raw->forceomit);
  decoded_field_length = field_aBQP.RAW_decode(ABQP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_service__UTRAN__CCO = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, Service__UTRAN__CCO_descr_.raw->forceomit);
  decoded_field_length = field_service__UTRAN__CCO().RAW_decode(Service__UTRAN__CCO_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_service__UTRAN__CCO = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_service__UTRAN__CCO=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_mS__Radio__Access__Capability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MS__Radio__Access__Capability_descr_.raw->forceomit);
  decoded_field_length = field_mS__Radio__Access__Capability().RAW_decode(MS__Radio__Access__Capability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_mS__Radio__Access__Capability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mS__Radio__Access__Capability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_allocation__Retention__Priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, Priority__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_allocation__Retention__Priority().RAW_decode(Priority__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_allocation__Retention__Priority = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_allocation__Retention__Priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_t10 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, GPRS__Timer_descr_.raw->forceomit);
  decoded_field_length = field_t10().RAW_decode(GPRS__Timer_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_t10 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_t10=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, Inter__RAT__Handover__Info__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_inter__RAT__Handover__Info().RAW_decode(Inter__RAT__Handover__Info__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_inter__RAT__Handover__Info=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, E__UTRAN__Inter__RAT__Handover__Info_descr_.raw->forceomit);
  decoded_field_length = field_e__UTRAN__Inter__RAT__Handover__Info().RAW_decode(E__UTRAN__Inter__RAT__Handover__Info_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_e__UTRAN__Inter__RAT__Handover__Info=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_subscriber__Profile__ID__For__RAT = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, Subscriber__Profile__ID__For__RAT__Priority_descr_.raw->forceomit);
  decoded_field_length = field_subscriber__Profile__ID__For__RAT().RAW_decode(Subscriber__Profile__ID__For__RAT__Priority_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_subscriber__Profile__ID__For__RAT = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_subscriber__Profile__ID__For__RAT=OMIT_VALUE;
  if (field_bssgpPduType !=  os_78) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__CREATE__BSS__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 = 13;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(13);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  if (field_iMSI.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PFI_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, GPRS__Timer_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ABQP_descr_.raw);
  if (field_service__UTRAN__CCO.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Service__UTRAN__CCO_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_mS__Radio__Access__Capability.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MS__Radio__Access__Capability_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_allocation__Retention__Priority.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, Priority__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_t10.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, GPRS__Timer_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, Inter__RAT__Handover__Info__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, E__UTRAN__Inter__RAT__Handover__Info_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_subscriber__Profile__ID__For__RAT.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, Subscriber__Profile__ID__For__RAT__Priority_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_iMSI.ispresent()) {
  encoded_length += field_iMSI().RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_pFT.RAW_encode(GPRS__Timer_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_aBQP.RAW_encode(ABQP_descr_, *myleaf.body.node.nodes[5]);
  if (field_service__UTRAN__CCO.ispresent()) {
  encoded_length += field_service__UTRAN__CCO().RAW_encode(Service__UTRAN__CCO_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_mS__Radio__Access__Capability.ispresent()) {
  encoded_length += field_mS__Radio__Access__Capability().RAW_encode(MS__Radio__Access__Capability_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_allocation__Retention__Priority.ispresent()) {
  encoded_length += field_allocation__Retention__Priority().RAW_encode(Priority__BSSGP_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_t10.ispresent()) {
  encoded_length += field_t10().RAW_encode(GPRS__Timer_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_inter__RAT__Handover__Info().RAW_encode(Inter__RAT__Handover__Info__BSSGP_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_e__UTRAN__Inter__RAT__Handover__Info().RAW_encode(E__UTRAN__Inter__RAT__Handover__Info_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_subscriber__Profile__ID__For__RAT.ispresent()) {
  encoded_length += field_subscriber__Profile__ID__For__RAT().RAW_encode(Subscriber__Profile__ID__For__RAT__Priority_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_bssgpPduType !=  os_78) {
  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_78.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__CREATE__BSS__PFC_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
IMSI__BSSGP_template field_iMSI;
PFI_template field_pFI;
GPRS__Timer_template field_pFT;
ABQP_template field_aBQP;
Service__UTRAN__CCO_template field_service__UTRAN__CCO;
MS__Radio__Access__Capability_template field_mS__Radio__Access__Capability;
Priority__BSSGP_template field_allocation__Retention__Priority;
GPRS__Timer_template field_t10;
Inter__RAT__Handover__Info__BSSGP_template field_inter__RAT__Handover__Info;
E__UTRAN__Inter__RAT__Handover__Info_template field_e__UTRAN__Inter__RAT__Handover__Info;
Subscriber__Profile__ID__For__RAT__Priority_template field_subscriber__Profile__ID__For__RAT;
};

void PDU__BSSGP__CREATE__BSS__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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_iMSI = ANY_OR_OMIT;
single_value->field_pFI = ANY_VALUE;
single_value->field_pFT = ANY_VALUE;
single_value->field_aBQP = ANY_VALUE;
single_value->field_service__UTRAN__CCO = ANY_OR_OMIT;
single_value->field_mS__Radio__Access__Capability = ANY_OR_OMIT;
single_value->field_allocation__Retention__Priority = ANY_OR_OMIT;
single_value->field_t10 = ANY_OR_OMIT;
single_value->field_inter__RAT__Handover__Info = ANY_OR_OMIT;
single_value->field_e__UTRAN__Inter__RAT__Handover__Info = ANY_OR_OMIT;
single_value->field_subscriber__Profile__ID__For__RAT = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__CREATE__BSS__PFC_template::copy_value(const PDU__BSSGP__CREATE__BSS__PFC& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.iMSI().is_bound()) {
  if (other_value.iMSI().ispresent()) single_value->field_iMSI = other_value.iMSI()();
  else single_value->field_iMSI = OMIT_VALUE;
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.pFT().is_bound()) {
  single_value->field_pFT = other_value.pFT();
} else {
  single_value->field_pFT.clean_up();
}
if (other_value.aBQP().is_bound()) {
  single_value->field_aBQP = other_value.aBQP();
} else {
  single_value->field_aBQP.clean_up();
}
if (other_value.service__UTRAN__CCO().is_bound()) {
  if (other_value.service__UTRAN__CCO().ispresent()) single_value->field_service__UTRAN__CCO = other_value.service__UTRAN__CCO()();
  else single_value->field_service__UTRAN__CCO = OMIT_VALUE;
} else {
  single_value->field_service__UTRAN__CCO.clean_up();
}
if (other_value.mS__Radio__Access__Capability().is_bound()) {
  if (other_value.mS__Radio__Access__Capability().ispresent()) single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability()();
  else single_value->field_mS__Radio__Access__Capability = OMIT_VALUE;
} else {
  single_value->field_mS__Radio__Access__Capability.clean_up();
}
if (other_value.allocation__Retention__Priority().is_bound()) {
  if (other_value.allocation__Retention__Priority().ispresent()) single_value->field_allocation__Retention__Priority = other_value.allocation__Retention__Priority()();
  else single_value->field_allocation__Retention__Priority = OMIT_VALUE;
} else {
  single_value->field_allocation__Retention__Priority.clean_up();
}
if (other_value.t10().is_bound()) {
  if (other_value.t10().ispresent()) single_value->field_t10 = other_value.t10()();
  else single_value->field_t10 = OMIT_VALUE;
} else {
  single_value->field_t10.clean_up();
}
if (other_value.inter__RAT__Handover__Info().is_bound()) {
  if (other_value.inter__RAT__Handover__Info().ispresent()) single_value->field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info()();
  else single_value->field_inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_inter__RAT__Handover__Info.clean_up();
}
if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) {
  if (other_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()) single_value->field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info()();
  else single_value->field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}
if (other_value.subscriber__Profile__ID__For__RAT().is_bound()) {
  if (other_value.subscriber__Profile__ID__For__RAT().ispresent()) single_value->field_subscriber__Profile__ID__For__RAT = other_value.subscriber__Profile__ID__For__RAT()();
  else single_value->field_subscriber__Profile__ID__For__RAT = OMIT_VALUE;
} else {
  single_value->field_subscriber__Profile__ID__For__RAT.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__CREATE__BSS__PFC_template::copy_template(const PDU__BSSGP__CREATE__BSS__PFC_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFT().get_selection()) {
single_value->field_pFT = other_value.pFT();
} else {
single_value->field_pFT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aBQP().get_selection()) {
single_value->field_aBQP = other_value.aBQP();
} else {
single_value->field_aBQP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__UTRAN__CCO().get_selection()) {
single_value->field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
} else {
single_value->field_service__UTRAN__CCO.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__Radio__Access__Capability().get_selection()) {
single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
} else {
single_value->field_mS__Radio__Access__Capability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allocation__Retention__Priority().get_selection()) {
single_value->field_allocation__Retention__Priority = other_value.allocation__Retention__Priority();
} else {
single_value->field_allocation__Retention__Priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t10().get_selection()) {
single_value->field_t10 = other_value.t10();
} else {
single_value->field_t10.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.inter__RAT__Handover__Info().get_selection()) {
single_value->field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info();
} else {
single_value->field_inter__RAT__Handover__Info.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.e__UTRAN__Inter__RAT__Handover__Info().get_selection()) {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
} else {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.subscriber__Profile__ID__For__RAT().get_selection()) {
single_value->field_subscriber__Profile__ID__For__RAT = other_value.subscriber__Profile__ID__For__RAT();
} else {
single_value->field_subscriber__Profile__ID__For__RAT.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__CREATE__BSS__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 PDU__BSSGP__CREATE__BSS__PFC_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__CREATE__BSS__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.PDU_BSSGP_CREATE_BSS_PFC.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__CREATE__BSS__PFC_template::PDU__BSSGP__CREATE__BSS__PFC_template()
{
}

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

PDU__BSSGP__CREATE__BSS__PFC_template::PDU__BSSGP__CREATE__BSS__PFC_template(const PDU__BSSGP__CREATE__BSS__PFC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__CREATE__BSS__PFC_template::match(const PDU__BSSGP__CREATE__BSS__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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if((other_value.iMSI().ispresent() ? !single_value->field_iMSI.match((const IMSI__BSSGP&)other_value.iMSI(), legacy) : !single_value->field_iMSI.match_omit(legacy)))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
if(!other_value.pFT().is_bound()) return FALSE;
if(!single_value->field_pFT.match(other_value.pFT(), legacy))return FALSE;
if(!other_value.aBQP().is_bound()) return FALSE;
if(!single_value->field_aBQP.match(other_value.aBQP(), legacy))return FALSE;
if(!other_value.service__UTRAN__CCO().is_bound()) return FALSE;
if((other_value.service__UTRAN__CCO().ispresent() ? !single_value->field_service__UTRAN__CCO.match((const Service__UTRAN__CCO&)other_value.service__UTRAN__CCO(), legacy) : !single_value->field_service__UTRAN__CCO.match_omit(legacy)))return FALSE;
if(!other_value.mS__Radio__Access__Capability().is_bound()) return FALSE;
if((other_value.mS__Radio__Access__Capability().ispresent() ? !single_value->field_mS__Radio__Access__Capability.match((const MS__Radio__Access__Capability&)other_value.mS__Radio__Access__Capability(), legacy) : !single_value->field_mS__Radio__Access__Capability.match_omit(legacy)))return FALSE;
if(!other_value.allocation__Retention__Priority().is_bound()) return FALSE;
if((other_value.allocation__Retention__Priority().ispresent() ? !single_value->field_allocation__Retention__Priority.match((const Priority__BSSGP&)other_value.allocation__Retention__Priority(), legacy) : !single_value->field_allocation__Retention__Priority.match_omit(legacy)))return FALSE;
if(!other_value.t10().is_bound()) return FALSE;
if((other_value.t10().ispresent() ? !single_value->field_t10.match((const GPRS__Timer&)other_value.t10(), legacy) : !single_value->field_t10.match_omit(legacy)))return FALSE;
if(!other_value.inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.inter__RAT__Handover__Info().ispresent() ? !single_value->field_inter__RAT__Handover__Info.match((const Inter__RAT__Handover__Info__BSSGP&)other_value.inter__RAT__Handover__Info(), legacy) : !single_value->field_inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
if(!other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent() ? !single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match((const E__UTRAN__Inter__RAT__Handover__Info&)other_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy) : !single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
if(!other_value.subscriber__Profile__ID__For__RAT().is_bound()) return FALSE;
if((other_value.subscriber__Profile__ID__For__RAT().ispresent() ? !single_value->field_subscriber__Profile__ID__For__RAT.match((const Subscriber__Profile__ID__For__RAT__Priority&)other_value.subscriber__Profile__ID__For__RAT(), legacy) : !single_value->field_subscriber__Profile__ID__For__RAT.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
}
return FALSE;
}

boolean PDU__BSSGP__CREATE__BSS__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_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_bound())
 || single_value->field_pFI.is_bound()
 || single_value->field_pFT.is_bound()
 || single_value->field_aBQP.is_bound()
 || (single_value->field_service__UTRAN__CCO.is_omit() || single_value->field_service__UTRAN__CCO.is_bound())
 || (single_value->field_mS__Radio__Access__Capability.is_omit() || single_value->field_mS__Radio__Access__Capability.is_bound())
 || (single_value->field_allocation__Retention__Priority.is_omit() || single_value->field_allocation__Retention__Priority.is_bound())
 || (single_value->field_t10.is_omit() || single_value->field_t10.is_bound())
 || (single_value->field_inter__RAT__Handover__Info.is_omit() || single_value->field_inter__RAT__Handover__Info.is_bound())
 || (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit() || single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_bound())
 || (single_value->field_subscriber__Profile__ID__For__RAT.is_omit() || single_value->field_subscriber__Profile__ID__For__RAT.is_bound());
}

boolean PDU__BSSGP__CREATE__BSS__PFC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_value())
 && single_value->field_pFI.is_value()
 && single_value->field_pFT.is_value()
 && single_value->field_aBQP.is_value()
 && (single_value->field_service__UTRAN__CCO.is_omit() || single_value->field_service__UTRAN__CCO.is_value())
 && (single_value->field_mS__Radio__Access__Capability.is_omit() || single_value->field_mS__Radio__Access__Capability.is_value())
 && (single_value->field_allocation__Retention__Priority.is_omit() || single_value->field_allocation__Retention__Priority.is_value())
 && (single_value->field_t10.is_omit() || single_value->field_t10.is_value())
 && (single_value->field_inter__RAT__Handover__Info.is_omit() || single_value->field_inter__RAT__Handover__Info.is_value())
 && (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit() || single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_value())
 && (single_value->field_subscriber__Profile__ID__For__RAT.is_omit() || single_value->field_subscriber__Profile__ID__For__RAT.is_value());
}

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

PDU__BSSGP__CREATE__BSS__PFC PDU__BSSGP__CREATE__BSS__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.PDU_BSSGP_CREATE_BSS_PFC.");
PDU__BSSGP__CREATE__BSS__PFC ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_iMSI.is_omit()) ret_val.iMSI() = OMIT_VALUE;
else if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_pFT.is_bound()) {
ret_val.pFT() = single_value->field_pFT.valueof();
}
if (single_value->field_aBQP.is_bound()) {
ret_val.aBQP() = single_value->field_aBQP.valueof();
}
if (single_value->field_service__UTRAN__CCO.is_omit()) ret_val.service__UTRAN__CCO() = OMIT_VALUE;
else if (single_value->field_service__UTRAN__CCO.is_bound()) {
ret_val.service__UTRAN__CCO() = single_value->field_service__UTRAN__CCO.valueof();
}
if (single_value->field_mS__Radio__Access__Capability.is_omit()) ret_val.mS__Radio__Access__Capability() = OMIT_VALUE;
else if (single_value->field_mS__Radio__Access__Capability.is_bound()) {
ret_val.mS__Radio__Access__Capability() = single_value->field_mS__Radio__Access__Capability.valueof();
}
if (single_value->field_allocation__Retention__Priority.is_omit()) ret_val.allocation__Retention__Priority() = OMIT_VALUE;
else if (single_value->field_allocation__Retention__Priority.is_bound()) {
ret_val.allocation__Retention__Priority() = single_value->field_allocation__Retention__Priority.valueof();
}
if (single_value->field_t10.is_omit()) ret_val.t10() = OMIT_VALUE;
else if (single_value->field_t10.is_bound()) {
ret_val.t10() = single_value->field_t10.valueof();
}
if (single_value->field_inter__RAT__Handover__Info.is_omit()) ret_val.inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_inter__RAT__Handover__Info.is_bound()) {
ret_val.inter__RAT__Handover__Info() = single_value->field_inter__RAT__Handover__Info.valueof();
}
if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit()) ret_val.e__UTRAN__Inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_bound()) {
ret_val.e__UTRAN__Inter__RAT__Handover__Info() = single_value->field_e__UTRAN__Inter__RAT__Handover__Info.valueof();
}
if (single_value->field_subscriber__Profile__ID__For__RAT.is_omit()) ret_val.subscriber__Profile__ID__For__RAT() = OMIT_VALUE;
else if (single_value->field_subscriber__Profile__ID__For__RAT.is_bound()) {
ret_val.subscriber__Profile__ID__For__RAT() = single_value->field_subscriber__Profile__ID__For__RAT.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__CREATE__BSS__PFC_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__CREATE__BSS__PFC_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_tLLI;
}

IMSI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_iMSI;
}

PFI_template& PDU__BSSGP__CREATE__BSS__PFC_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__CREATE__BSS__PFC_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_pFI;
}

GPRS__Timer_template& PDU__BSSGP__CREATE__BSS__PFC_template::pFT()
{
set_specific();
return single_value->field_pFT;
}

const GPRS__Timer_template& PDU__BSSGP__CREATE__BSS__PFC_template::pFT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFT of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_pFT;
}

ABQP_template& PDU__BSSGP__CREATE__BSS__PFC_template::aBQP()
{
set_specific();
return single_value->field_aBQP;
}

const ABQP_template& PDU__BSSGP__CREATE__BSS__PFC_template::aBQP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aBQP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_aBQP;
}

Service__UTRAN__CCO_template& PDU__BSSGP__CREATE__BSS__PFC_template::service__UTRAN__CCO()
{
set_specific();
return single_value->field_service__UTRAN__CCO;
}

const Service__UTRAN__CCO_template& PDU__BSSGP__CREATE__BSS__PFC_template::service__UTRAN__CCO() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_UTRAN_CCO of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_service__UTRAN__CCO;
}

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

const MS__Radio__Access__Capability_template& PDU__BSSGP__CREATE__BSS__PFC_template::mS__Radio__Access__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_Radio_Access_Capability of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_mS__Radio__Access__Capability;
}

Priority__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC_template::allocation__Retention__Priority()
{
set_specific();
return single_value->field_allocation__Retention__Priority;
}

const Priority__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC_template::allocation__Retention__Priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocation_Retention_Priority of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_allocation__Retention__Priority;
}

GPRS__Timer_template& PDU__BSSGP__CREATE__BSS__PFC_template::t10()
{
set_specific();
return single_value->field_t10;
}

const GPRS__Timer_template& PDU__BSSGP__CREATE__BSS__PFC_template::t10() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t10 of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_t10;
}

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

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

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

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

Subscriber__Profile__ID__For__RAT__Priority_template& PDU__BSSGP__CREATE__BSS__PFC_template::subscriber__Profile__ID__For__RAT()
{
set_specific();
return single_value->field_subscriber__Profile__ID__For__RAT;
}

const Subscriber__Profile__ID__For__RAT__Priority_template& PDU__BSSGP__CREATE__BSS__PFC_template::subscriber__Profile__ID__For__RAT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field subscriber_Profile_ID_For_RAT of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
return single_value->field_subscriber__Profile__ID__For__RAT;
}

int PDU__BSSGP__CREATE__BSS__PFC_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_iMSI.is_present()) ret_val++;
      if (single_value->field_service__UTRAN__CCO.is_present()) ret_val++;
      if (single_value->field_mS__Radio__Access__Capability.is_present()) ret_val++;
      if (single_value->field_allocation__Retention__Priority.is_present()) ret_val++;
      if (single_value->field_t10.is_present()) ret_val++;
      if (single_value->field_inter__RAT__Handover__Info.is_present()) ret_val++;
      if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_present()) ret_val++;
      if (single_value->field_subscriber__Profile__ID__For__RAT.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_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.PDU_BSSGP_CREATE_BSS_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.PDU_BSSGP_CREATE_BSS_PFC containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
  }
  return 0;
}

void PDU__BSSGP__CREATE__BSS__PFC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", pFT := ");
single_value->field_pFT.log();
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log();
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
single_value->field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
single_value->field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(", allocation_Retention_Priority := ");
single_value->field_allocation__Retention__Priority.log();
TTCN_Logger::log_event_str(", t10 := ");
single_value->field_t10.log();
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info := ");
single_value->field_inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT := ");
single_value->field_subscriber__Profile__ID__For__RAT.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__CREATE__BSS__PFC_template::log_match(const PDU__BSSGP__CREATE__BSS__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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.iMSI().ispresent()){
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFT.match(match_value.pFT(), legacy)){
TTCN_Logger::log_logmatch_info(".pFT");
single_value->field_pFT.log_match(match_value.pFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aBQP.match(match_value.aBQP(), legacy)){
TTCN_Logger::log_logmatch_info(".aBQP");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.service__UTRAN__CCO().ispresent()){
if(!single_value->field_service__UTRAN__CCO.match(match_value.service__UTRAN__CCO(), legacy)){
TTCN_Logger::log_logmatch_info(".service_UTRAN_CCO");
single_value->field_service__UTRAN__CCO.log_match(match_value.service__UTRAN__CCO(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_service__UTRAN__CCO.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".service_UTRAN_CCO := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mS__Radio__Access__Capability().ispresent()){
if(!single_value->field_mS__Radio__Access__Capability.match(match_value.mS__Radio__Access__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_Radio_Access_Capability");
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__Radio__Access__Capability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_Radio_Access_Capability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.allocation__Retention__Priority().ispresent()){
if(!single_value->field_allocation__Retention__Priority.match(match_value.allocation__Retention__Priority(), legacy)){
TTCN_Logger::log_logmatch_info(".allocation_Retention_Priority");
single_value->field_allocation__Retention__Priority.log_match(match_value.allocation__Retention__Priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_allocation__Retention__Priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".allocation_Retention_Priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_allocation__Retention__Priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t10().ispresent()){
if(!single_value->field_t10.match(match_value.t10(), legacy)){
TTCN_Logger::log_logmatch_info(".t10");
single_value->field_t10.log_match(match_value.t10(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t10.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t10 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t10.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_inter__RAT__Handover__Info.match(match_value.inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".inter_RAT_Handover_Info");
single_value->field_inter__RAT__Handover__Info.log_match(match_value.inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".e_UTRAN_Inter_RAT_Handover_Info");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log_match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".e_UTRAN_Inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.subscriber__Profile__ID__For__RAT().ispresent()){
if(!single_value->field_subscriber__Profile__ID__For__RAT.match(match_value.subscriber__Profile__ID__For__RAT(), legacy)){
TTCN_Logger::log_logmatch_info(".subscriber_Profile_ID_For_RAT");
single_value->field_subscriber__Profile__ID__For__RAT.log_match(match_value.subscriber__Profile__ID__For__RAT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_subscriber__Profile__ID__For__RAT.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".subscriber_Profile_ID_For_RAT := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_subscriber__Profile__ID__For__RAT.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
if (match_value.iMSI().ispresent()) {
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iMSI.log();
if (single_value->field_iMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(", pFT := ");
single_value->field_pFT.log_match(match_value.pFT(), legacy);
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
if (match_value.service__UTRAN__CCO().ispresent()) {
single_value->field_service__UTRAN__CCO.log_match(match_value.service__UTRAN__CCO(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_service__UTRAN__CCO.log();
if (single_value->field_service__UTRAN__CCO.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
if (match_value.mS__Radio__Access__Capability().ispresent()) {
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__Capability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__Radio__Access__Capability.log();
if (single_value->field_mS__Radio__Access__Capability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", allocation_Retention_Priority := ");
if (match_value.allocation__Retention__Priority().ispresent()) {
single_value->field_allocation__Retention__Priority.log_match(match_value.allocation__Retention__Priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_allocation__Retention__Priority.log();
if (single_value->field_allocation__Retention__Priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t10 := ");
if (match_value.t10().ispresent()) {
single_value->field_t10.log_match(match_value.t10(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t10.log();
if (single_value->field_t10.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info := ");
if (match_value.inter__RAT__Handover__Info().ispresent()) {
single_value->field_inter__RAT__Handover__Info.log_match(match_value.inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_inter__RAT__Handover__Info.log();
if (single_value->field_inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
if (match_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()) {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log_match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT := ");
if (match_value.subscriber__Profile__ID__For__RAT().ispresent()) {
single_value->field_subscriber__Profile__ID__For__RAT.log_match(match_value.subscriber__Profile__ID__For__RAT(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_subscriber__Profile__ID__For__RAT.log();
if (single_value->field_subscriber__Profile__ID__For__RAT.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__CREATE__BSS__PFC_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_pFI.encode_text(text_buf);
single_value->field_pFT.encode_text(text_buf);
single_value->field_aBQP.encode_text(text_buf);
single_value->field_service__UTRAN__CCO.encode_text(text_buf);
single_value->field_mS__Radio__Access__Capability.encode_text(text_buf);
single_value->field_allocation__Retention__Priority.encode_text(text_buf);
single_value->field_t10.encode_text(text_buf);
single_value->field_inter__RAT__Handover__Info.encode_text(text_buf);
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.encode_text(text_buf);
single_value->field_subscriber__Profile__ID__For__RAT.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC.");
}
}

void PDU__BSSGP__CREATE__BSS__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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
single_value->field_pFT.decode_text(text_buf);
single_value->field_aBQP.decode_text(text_buf);
single_value->field_service__UTRAN__CCO.decode_text(text_buf);
single_value->field_mS__Radio__Access__Capability.decode_text(text_buf);
single_value->field_allocation__Retention__Priority.decode_text(text_buf);
single_value->field_t10.decode_text(text_buf);
single_value->field_inter__RAT__Handover__Info.decode_text(text_buf);
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.decode_text(text_buf);
single_value->field_subscriber__Profile__ID__For__RAT.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__CREATE__BSS__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.PDU_BSSGP_CREATE_BSS_PFC.");
}
}

void PDU__BSSGP__CREATE__BSS__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: {
    PDU__BSSGP__CREATE__BSS__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 (13<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFT().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) service__UTRAN__CCO().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) allocation__Retention__Priority().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) t10().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) inter__RAT__Handover__Info().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) e__UTRAN__Inter__RAT__Handover__Info().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) subscriber__Profile__ID__For__RAT().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aBQP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aBQP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_UTRAN_CCO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__UTRAN__CCO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocation_Retention_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocation__Retention__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t10().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "e_UTRAN_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__UTRAN__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "subscriber_Profile_ID_For_RAT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          subscriber__Profile__ID__For__RAT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__CREATE__BSS__PFC_template* precondition = new PDU__BSSGP__CREATE__BSS__PFC_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__CREATE__BSS__PFC_template* implied_template = new PDU__BSSGP__CREATE__BSS__PFC_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__CREATE__BSS__PFC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__CREATE__BSS__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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_pFT.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_aBQP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_service__UTRAN__CCO.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_mS__Radio__Access__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_allocation__Retention__Priority.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_t10.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC");
single_value->field_subscriber__Profile__ID__For__RAT.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_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.PDU_BSSGP_CREATE_BSS_PFC");
}

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

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

PDU__BSSGP__CREATE__BSS__PFC__ACK::PDU__BSSGP__CREATE__BSS__PFC__ACK()
{
}

PDU__BSSGP__CREATE__BSS__PFC__ACK::PDU__BSSGP__CREATE__BSS__PFC__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI,
    const ABQP& par_aBQP,
    const OPTIONAL< Cause__BSSGP >& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI),
  field_aBQP(par_aBQP),
  field_cause(par_cause)
{
}

PDU__BSSGP__CREATE__BSS__PFC__ACK::PDU__BSSGP__CREATE__BSS__PFC__ACK(const PDU__BSSGP__CREATE__BSS__PFC__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
else field_aBQP.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
field_aBQP.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__CREATE__BSS__PFC__ACK::get_descriptor() const { return &PDU__BSSGP__CREATE__BSS__PFC__ACK_descr_; }
PDU__BSSGP__CREATE__BSS__PFC__ACK& PDU__BSSGP__CREATE__BSS__PFC__ACK::operator=(const PDU__BSSGP__CREATE__BSS__PFC__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
  else field_aBQP.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__CREATE__BSS__PFC__ACK::operator==(const PDU__BSSGP__CREATE__BSS__PFC__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI
  && field_aBQP==other_value.field_aBQP
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__CREATE__BSS__PFC__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound())
  || (field_aBQP.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound());
}
boolean PDU__BSSGP__CREATE__BSS__PFC__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value()
  && field_aBQP.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value());
}
int PDU__BSSGP__CREATE__BSS__PFC__ACK::size_of() const
{
  int ret_val = 4;
  if (field_cause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", aBQP := ");
field_aBQP.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
if (aBQP().is_bound()) aBQP().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aBQP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aBQP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK");
  }
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_aBQP.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_aBQP.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

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

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

int PDU__BSSGP__CREATE__BSS__PFC__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_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, ABQP_descr_.raw->forceomit);
  decoded_field_length = field_aBQP.RAW_decode(ABQP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cause=OMIT_VALUE;
  if (field_bssgpPduType !=  os_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 PDU__BSSGP__CREATE__BSS__PFC__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ABQP_descr_.raw);
  if (field_cause.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Cause__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_aBQP.RAW_encode(ABQP_descr_, *myleaf.body.node.nodes[3]);
  if (field_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_bssgpPduType !=  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 PDU__BSSGP__CREATE__BSS__PFC__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
ABQP_template field_aBQP;
Cause__BSSGP_template field_cause;
};

void PDU__BSSGP__CREATE__BSS__PFC__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
single_value->field_aBQP = ANY_VALUE;
single_value->field_cause = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK_template::copy_value(const PDU__BSSGP__CREATE__BSS__PFC__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.aBQP().is_bound()) {
  single_value->field_aBQP = other_value.aBQP();
} else {
  single_value->field_aBQP.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK_template::copy_template(const PDU__BSSGP__CREATE__BSS__PFC__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aBQP().get_selection()) {
single_value->field_aBQP = other_value.aBQP();
} else {
single_value->field_aBQP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__CREATE__BSS__PFC__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__CREATE__BSS__PFC__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__CREATE__BSS__PFC__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__CREATE__BSS__PFC__ACK_template::PDU__BSSGP__CREATE__BSS__PFC__ACK_template()
{
}

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

PDU__BSSGP__CREATE__BSS__PFC__ACK_template::PDU__BSSGP__CREATE__BSS__PFC__ACK_template(const PDU__BSSGP__CREATE__BSS__PFC__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__CREATE__BSS__PFC__ACK_template::match(const PDU__BSSGP__CREATE__BSS__PFC__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
if(!other_value.aBQP().is_bound()) return FALSE;
if(!single_value->field_aBQP.match(other_value.aBQP(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const Cause__BSSGP&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__CREATE__BSS__PFC__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound()
 || single_value->field_aBQP.is_bound()
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound());
}

boolean PDU__BSSGP__CREATE__BSS__PFC__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value()
 && single_value->field_aBQP.is_value()
 && (single_value->field_cause.is_omit() || single_value->field_cause.is_value());
}

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

PDU__BSSGP__CREATE__BSS__PFC__ACK PDU__BSSGP__CREATE__BSS__PFC__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
PDU__BSSGP__CREATE__BSS__PFC__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_aBQP.is_bound()) {
ret_val.aBQP() = single_value->field_aBQP.valueof();
}
if (single_value->field_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
return single_value->field_pFI;
}

ABQP_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::aBQP()
{
set_specific();
return single_value->field_aBQP;
}

const ABQP_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::aBQP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aBQP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
return single_value->field_aBQP;
}

Cause__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__ACK_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_ACK.");
return single_value->field_cause;
}

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

void PDU__BSSGP__CREATE__BSS__PFC__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__CREATE__BSS__PFC__ACK_template::log_match(const PDU__BSSGP__CREATE__BSS__PFC__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aBQP.match(match_value.aBQP(), legacy)){
TTCN_Logger::log_logmatch_info(".aBQP");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::log_event_str(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__CREATE__BSS__PFC__NACK::PDU__BSSGP__CREATE__BSS__PFC__NACK()
{
}

PDU__BSSGP__CREATE__BSS__PFC__NACK::PDU__BSSGP__CREATE__BSS__PFC__NACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI,
    const Cause__BSSGP& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI),
  field_cause(par_cause)
{
}

PDU__BSSGP__CREATE__BSS__PFC__NACK::PDU__BSSGP__CREATE__BSS__PFC__NACK(const PDU__BSSGP__CREATE__BSS__PFC__NACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__CREATE__BSS__PFC__NACK::get_descriptor() const { return &PDU__BSSGP__CREATE__BSS__PFC__NACK_descr_; }
PDU__BSSGP__CREATE__BSS__PFC__NACK& PDU__BSSGP__CREATE__BSS__PFC__NACK::operator=(const PDU__BSSGP__CREATE__BSS__PFC__NACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__CREATE__BSS__PFC__NACK::operator==(const PDU__BSSGP__CREATE__BSS__PFC__NACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__CREATE__BSS__PFC__NACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound())
  || (field_cause.is_bound());
}
boolean PDU__BSSGP__CREATE__BSS__PFC__NACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value()
  && field_cause.is_value();
}
void PDU__BSSGP__CREATE__BSS__PFC__NACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK");
  }
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

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

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

int PDU__BSSGP__CREATE__BSS__PFC__NACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_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, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_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 PDU__BSSGP__CREATE__BSS__PFC__NACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cause__BSSGP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  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 PDU__BSSGP__CREATE__BSS__PFC__NACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
Cause__BSSGP_template field_cause;
};

void PDU__BSSGP__CREATE__BSS__PFC__NACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
}
}
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK_template::copy_value(const PDU__BSSGP__CREATE__BSS__PFC__NACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK_template::copy_template(const PDU__BSSGP__CREATE__BSS__PFC__NACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__CREATE__BSS__PFC__NACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__CREATE__BSS__PFC__NACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__CREATE__BSS__PFC__NACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__CREATE__BSS__PFC__NACK_template::PDU__BSSGP__CREATE__BSS__PFC__NACK_template()
{
}

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

PDU__BSSGP__CREATE__BSS__PFC__NACK_template::PDU__BSSGP__CREATE__BSS__PFC__NACK_template(const PDU__BSSGP__CREATE__BSS__PFC__NACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__CREATE__BSS__PFC__NACK_template::match(const PDU__BSSGP__CREATE__BSS__PFC__NACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
}
return FALSE;
}

boolean PDU__BSSGP__CREATE__BSS__PFC__NACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound()
 || single_value->field_cause.is_bound();
}

boolean PDU__BSSGP__CREATE__BSS__PFC__NACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value()
 && single_value->field_cause.is_value();
}

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

PDU__BSSGP__CREATE__BSS__PFC__NACK PDU__BSSGP__CREATE__BSS__PFC__NACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
PDU__BSSGP__CREATE__BSS__PFC__NACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
return single_value->field_pFI;
}

Cause__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__CREATE__BSS__PFC__NACK_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_CREATE_BSS_PFC_NACK.");
return single_value->field_cause;
}

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

void PDU__BSSGP__CREATE__BSS__PFC__NACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__CREATE__BSS__PFC__NACK_template::log_match(const PDU__BSSGP__CREATE__BSS__PFC__NACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__MODIFY__BSS__PFC::PDU__BSSGP__MODIFY__BSS__PFC()
{
}

PDU__BSSGP__MODIFY__BSS__PFC::PDU__BSSGP__MODIFY__BSS__PFC(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI,
    const ABQP& par_aBQP)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI),
  field_aBQP(par_aBQP)
{
}

PDU__BSSGP__MODIFY__BSS__PFC::PDU__BSSGP__MODIFY__BSS__PFC(const PDU__BSSGP__MODIFY__BSS__PFC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
else field_aBQP.clean_up();
}

void PDU__BSSGP__MODIFY__BSS__PFC::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
field_aBQP.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__MODIFY__BSS__PFC::get_descriptor() const { return &PDU__BSSGP__MODIFY__BSS__PFC_descr_; }
PDU__BSSGP__MODIFY__BSS__PFC& PDU__BSSGP__MODIFY__BSS__PFC::operator=(const PDU__BSSGP__MODIFY__BSS__PFC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
  else field_aBQP.clean_up();
}
return *this;
}

boolean PDU__BSSGP__MODIFY__BSS__PFC::operator==(const PDU__BSSGP__MODIFY__BSS__PFC& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI
  && field_aBQP==other_value.field_aBQP;
}

boolean PDU__BSSGP__MODIFY__BSS__PFC::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound())
  || (field_aBQP.is_bound());
}
boolean PDU__BSSGP__MODIFY__BSS__PFC::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value()
  && field_aBQP.is_value();
}
void PDU__BSSGP__MODIFY__BSS__PFC::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", aBQP := ");
field_aBQP.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__MODIFY__BSS__PFC::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
if (aBQP().is_bound()) aBQP().set_implicit_omit();
}

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

void PDU__BSSGP__MODIFY__BSS__PFC::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_aBQP.encode_text(text_buf);
}

void PDU__BSSGP__MODIFY__BSS__PFC::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_aBQP.decode_text(text_buf);
}

void PDU__BSSGP__MODIFY__BSS__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 PDU__BSSGP__MODIFY__BSS__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 PDU__BSSGP__MODIFY__BSS__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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_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, ABQP_descr_.raw->forceomit);
  decoded_field_length = field_aBQP.RAW_decode(ABQP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_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 PDU__BSSGP__MODIFY__BSS__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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ABQP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_aBQP.RAW_encode(ABQP_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  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 PDU__BSSGP__MODIFY__BSS__PFC_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
ABQP_template field_aBQP;
};

void PDU__BSSGP__MODIFY__BSS__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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
single_value->field_aBQP = ANY_VALUE;
}
}
}

void PDU__BSSGP__MODIFY__BSS__PFC_template::copy_value(const PDU__BSSGP__MODIFY__BSS__PFC& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.aBQP().is_bound()) {
  single_value->field_aBQP = other_value.aBQP();
} else {
  single_value->field_aBQP.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__MODIFY__BSS__PFC_template::copy_template(const PDU__BSSGP__MODIFY__BSS__PFC_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aBQP().get_selection()) {
single_value->field_aBQP = other_value.aBQP();
} else {
single_value->field_aBQP.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__MODIFY__BSS__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 PDU__BSSGP__MODIFY__BSS__PFC_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__MODIFY__BSS__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.PDU_BSSGP_MODIFY_BSS_PFC.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__MODIFY__BSS__PFC_template::PDU__BSSGP__MODIFY__BSS__PFC_template()
{
}

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

PDU__BSSGP__MODIFY__BSS__PFC_template::PDU__BSSGP__MODIFY__BSS__PFC_template(const PDU__BSSGP__MODIFY__BSS__PFC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__MODIFY__BSS__PFC_template::match(const PDU__BSSGP__MODIFY__BSS__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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
if(!other_value.aBQP().is_bound()) return FALSE;
if(!single_value->field_aBQP.match(other_value.aBQP(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC.");
}
return FALSE;
}

boolean PDU__BSSGP__MODIFY__BSS__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_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound()
 || single_value->field_aBQP.is_bound();
}

boolean PDU__BSSGP__MODIFY__BSS__PFC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value()
 && single_value->field_aBQP.is_value();
}

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

PDU__BSSGP__MODIFY__BSS__PFC PDU__BSSGP__MODIFY__BSS__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.PDU_BSSGP_MODIFY_BSS_PFC.");
PDU__BSSGP__MODIFY__BSS__PFC ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_aBQP.is_bound()) {
ret_val.aBQP() = single_value->field_aBQP.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__MODIFY__BSS__PFC_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__MODIFY__BSS__PFC_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__MODIFY__BSS__PFC_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__MODIFY__BSS__PFC_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__MODIFY__BSS__PFC_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__MODIFY__BSS__PFC_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC.");
return single_value->field_pFI;
}

ABQP_template& PDU__BSSGP__MODIFY__BSS__PFC_template::aBQP()
{
set_specific();
return single_value->field_aBQP;
}

const ABQP_template& PDU__BSSGP__MODIFY__BSS__PFC_template::aBQP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aBQP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC.");
return single_value->field_aBQP;
}

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

void PDU__BSSGP__MODIFY__BSS__PFC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__MODIFY__BSS__PFC_template::log_match(const PDU__BSSGP__MODIFY__BSS__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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aBQP.match(match_value.aBQP(), legacy)){
TTCN_Logger::log_logmatch_info(".aBQP");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__MODIFY__BSS__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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
single_value->field_aBQP.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__MODIFY__BSS__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.PDU_BSSGP_MODIFY_BSS_PFC.");
}
}

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

void PDU__BSSGP__MODIFY__BSS__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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC");
single_value->field_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC");
single_value->field_aBQP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_MODIFY_BSS_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.PDU_BSSGP_MODIFY_BSS_PFC");
}

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

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

PDU__BSSGP__MODIFY__BSS__PFC__ACK::PDU__BSSGP__MODIFY__BSS__PFC__ACK()
{
}

PDU__BSSGP__MODIFY__BSS__PFC__ACK::PDU__BSSGP__MODIFY__BSS__PFC__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI,
    const GPRS__Timer& par_pFT,
    const ABQP& par_aBQP)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI),
  field_pFT(par_pFT),
  field_aBQP(par_aBQP)
{
}

PDU__BSSGP__MODIFY__BSS__PFC__ACK::PDU__BSSGP__MODIFY__BSS__PFC__ACK(const PDU__BSSGP__MODIFY__BSS__PFC__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.pFT().is_bound()) field_pFT = other_value.pFT();
else field_pFT.clean_up();
if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
else field_aBQP.clean_up();
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
field_pFT.clean_up();
field_aBQP.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__MODIFY__BSS__PFC__ACK::get_descriptor() const { return &PDU__BSSGP__MODIFY__BSS__PFC__ACK_descr_; }
PDU__BSSGP__MODIFY__BSS__PFC__ACK& PDU__BSSGP__MODIFY__BSS__PFC__ACK::operator=(const PDU__BSSGP__MODIFY__BSS__PFC__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.pFT().is_bound()) field_pFT = other_value.pFT();
  else field_pFT.clean_up();
  if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
  else field_aBQP.clean_up();
}
return *this;
}

boolean PDU__BSSGP__MODIFY__BSS__PFC__ACK::operator==(const PDU__BSSGP__MODIFY__BSS__PFC__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI
  && field_pFT==other_value.field_pFT
  && field_aBQP==other_value.field_aBQP;
}

boolean PDU__BSSGP__MODIFY__BSS__PFC__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound())
  || (field_pFT.is_bound())
  || (field_aBQP.is_bound());
}
boolean PDU__BSSGP__MODIFY__BSS__PFC__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value()
  && field_pFT.is_value()
  && field_aBQP.is_value();
}
void PDU__BSSGP__MODIFY__BSS__PFC__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", pFT := ");
field_pFT.log();
TTCN_Logger::log_event_str(", aBQP := ");
field_aBQP.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
if (pFT().is_bound()) pFT().set_implicit_omit();
if (aBQP().is_bound()) aBQP().set_implicit_omit();
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pFT().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aBQP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aBQP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK");
  }
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_pFT.encode_text(text_buf);
field_aBQP.encode_text(text_buf);
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_pFT.decode_text(text_buf);
field_aBQP.decode_text(text_buf);
}

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

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

int PDU__BSSGP__MODIFY__BSS__PFC__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, GPRS__Timer_descr_.raw->forceomit);
  decoded_field_length = field_pFT.RAW_decode(GPRS__Timer_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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, ABQP_descr_.raw->forceomit);
  decoded_field_length = field_aBQP.RAW_decode(ABQP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_80) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__MODIFY__BSS__PFC__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRS__Timer_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ABQP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_pFT.RAW_encode(GPRS__Timer_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_aBQP.RAW_encode(ABQP_descr_, *myleaf.body.node.nodes[4]);
  if (field_bssgpPduType !=  os_80) {
  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_80.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
GPRS__Timer_template field_pFT;
ABQP_template field_aBQP;
};

void PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
single_value->field_pFT = ANY_VALUE;
single_value->field_aBQP = ANY_VALUE;
}
}
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::copy_value(const PDU__BSSGP__MODIFY__BSS__PFC__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.pFT().is_bound()) {
  single_value->field_pFT = other_value.pFT();
} else {
  single_value->field_pFT.clean_up();
}
if (other_value.aBQP().is_bound()) {
  single_value->field_aBQP = other_value.aBQP();
} else {
  single_value->field_aBQP.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::copy_template(const PDU__BSSGP__MODIFY__BSS__PFC__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFT().get_selection()) {
single_value->field_pFT = other_value.pFT();
} else {
single_value->field_pFT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aBQP().get_selection()) {
single_value->field_aBQP = other_value.aBQP();
} else {
single_value->field_aBQP.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__MODIFY__BSS__PFC__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__MODIFY__BSS__PFC__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__MODIFY__BSS__PFC__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::PDU__BSSGP__MODIFY__BSS__PFC__ACK_template()
{
}

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

PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::PDU__BSSGP__MODIFY__BSS__PFC__ACK_template(const PDU__BSSGP__MODIFY__BSS__PFC__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::match(const PDU__BSSGP__MODIFY__BSS__PFC__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
if(!other_value.pFT().is_bound()) return FALSE;
if(!single_value->field_pFT.match(other_value.pFT(), legacy))return FALSE;
if(!other_value.aBQP().is_bound()) return FALSE;
if(!single_value->field_aBQP.match(other_value.aBQP(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound()
 || single_value->field_pFT.is_bound()
 || single_value->field_aBQP.is_bound();
}

boolean PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value()
 && single_value->field_pFT.is_value()
 && single_value->field_aBQP.is_value();
}

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

PDU__BSSGP__MODIFY__BSS__PFC__ACK PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
PDU__BSSGP__MODIFY__BSS__PFC__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_pFT.is_bound()) {
ret_val.pFT() = single_value->field_pFT.valueof();
}
if (single_value->field_aBQP.is_bound()) {
ret_val.aBQP() = single_value->field_aBQP.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
return single_value->field_pFI;
}

GPRS__Timer_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::pFT()
{
set_specific();
return single_value->field_pFT;
}

const GPRS__Timer_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::pFT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFT of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
return single_value->field_pFT;
}

ABQP_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::aBQP()
{
set_specific();
return single_value->field_aBQP;
}

const ABQP_template& PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::aBQP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aBQP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_MODIFY_BSS_PFC_ACK.");
return single_value->field_aBQP;
}

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

void PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", pFT := ");
single_value->field_pFT.log();
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__MODIFY__BSS__PFC__ACK_template::log_match(const PDU__BSSGP__MODIFY__BSS__PFC__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFT.match(match_value.pFT(), legacy)){
TTCN_Logger::log_logmatch_info(".pFT");
single_value->field_pFT.log_match(match_value.pFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aBQP.match(match_value.aBQP(), legacy)){
TTCN_Logger::log_logmatch_info(".aBQP");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(", pFT := ");
single_value->field_pFT.log_match(match_value.pFT(), legacy);
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__DELETE__BSS__PFC::PDU__BSSGP__DELETE__BSS__PFC()
{
}

PDU__BSSGP__DELETE__BSS__PFC::PDU__BSSGP__DELETE__BSS__PFC(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI)
{
}

PDU__BSSGP__DELETE__BSS__PFC::PDU__BSSGP__DELETE__BSS__PFC(const PDU__BSSGP__DELETE__BSS__PFC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
}

void PDU__BSSGP__DELETE__BSS__PFC::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DELETE__BSS__PFC::get_descriptor() const { return &PDU__BSSGP__DELETE__BSS__PFC_descr_; }
PDU__BSSGP__DELETE__BSS__PFC& PDU__BSSGP__DELETE__BSS__PFC::operator=(const PDU__BSSGP__DELETE__BSS__PFC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DELETE__BSS__PFC::operator==(const PDU__BSSGP__DELETE__BSS__PFC& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI;
}

boolean PDU__BSSGP__DELETE__BSS__PFC::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound());
}
boolean PDU__BSSGP__DELETE__BSS__PFC::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value();
}
void PDU__BSSGP__DELETE__BSS__PFC::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DELETE__BSS__PFC::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
}

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

void PDU__BSSGP__DELETE__BSS__PFC::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
}

void PDU__BSSGP__DELETE__BSS__PFC::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
}

void PDU__BSSGP__DELETE__BSS__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 PDU__BSSGP__DELETE__BSS__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 PDU__BSSGP__DELETE__BSS__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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_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 PDU__BSSGP__DELETE__BSS__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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  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 PDU__BSSGP__DELETE__BSS__PFC_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
};

void PDU__BSSGP__DELETE__BSS__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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
}
}
}

void PDU__BSSGP__DELETE__BSS__PFC_template::copy_value(const PDU__BSSGP__DELETE__BSS__PFC& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DELETE__BSS__PFC_template::copy_template(const PDU__BSSGP__DELETE__BSS__PFC_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DELETE__BSS__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 PDU__BSSGP__DELETE__BSS__PFC_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DELETE__BSS__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.PDU_BSSGP_DELETE_BSS_PFC.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DELETE__BSS__PFC_template::PDU__BSSGP__DELETE__BSS__PFC_template()
{
}

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

PDU__BSSGP__DELETE__BSS__PFC_template::PDU__BSSGP__DELETE__BSS__PFC_template(const PDU__BSSGP__DELETE__BSS__PFC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__DELETE__BSS__PFC_template::match(const PDU__BSSGP__DELETE__BSS__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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC.");
}
return FALSE;
}

boolean PDU__BSSGP__DELETE__BSS__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_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound();
}

boolean PDU__BSSGP__DELETE__BSS__PFC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value();
}

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

PDU__BSSGP__DELETE__BSS__PFC PDU__BSSGP__DELETE__BSS__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.PDU_BSSGP_DELETE_BSS_PFC.");
PDU__BSSGP__DELETE__BSS__PFC ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__DELETE__BSS__PFC_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DELETE__BSS__PFC_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__DELETE__BSS__PFC_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__DELETE__BSS__PFC_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC.");
return single_value->field_pFI;
}

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

void PDU__BSSGP__DELETE__BSS__PFC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DELETE__BSS__PFC_template::log_match(const PDU__BSSGP__DELETE__BSS__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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__BSSGP__DELETE__BSS__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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__DELETE__BSS__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.PDU_BSSGP_DELETE_BSS_PFC.");
}
}

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

void PDU__BSSGP__DELETE__BSS__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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC");
single_value->field_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DELETE_BSS_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.PDU_BSSGP_DELETE_BSS_PFC");
}

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

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

PDU__BSSGP__DELETE__BSS__PFC__ACK::PDU__BSSGP__DELETE__BSS__PFC__ACK()
{
}

PDU__BSSGP__DELETE__BSS__PFC__ACK::PDU__BSSGP__DELETE__BSS__PFC__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI)
{
}

PDU__BSSGP__DELETE__BSS__PFC__ACK::PDU__BSSGP__DELETE__BSS__PFC__ACK(const PDU__BSSGP__DELETE__BSS__PFC__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DELETE__BSS__PFC__ACK::get_descriptor() const { return &PDU__BSSGP__DELETE__BSS__PFC__ACK_descr_; }
PDU__BSSGP__DELETE__BSS__PFC__ACK& PDU__BSSGP__DELETE__BSS__PFC__ACK::operator=(const PDU__BSSGP__DELETE__BSS__PFC__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DELETE__BSS__PFC__ACK::operator==(const PDU__BSSGP__DELETE__BSS__PFC__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI;
}

boolean PDU__BSSGP__DELETE__BSS__PFC__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound());
}
boolean PDU__BSSGP__DELETE__BSS__PFC__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value();
}
void PDU__BSSGP__DELETE__BSS__PFC__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK");
  }
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
}

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

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

int PDU__BSSGP__DELETE__BSS__PFC__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_82) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__DELETE__BSS__PFC__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_82) {
  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_82.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__DELETE__BSS__PFC__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
};

void PDU__BSSGP__DELETE__BSS__PFC__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
}
}
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK_template::copy_value(const PDU__BSSGP__DELETE__BSS__PFC__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK_template::copy_template(const PDU__BSSGP__DELETE__BSS__PFC__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DELETE__BSS__PFC__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__DELETE__BSS__PFC__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DELETE__BSS__PFC__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DELETE__BSS__PFC__ACK_template::PDU__BSSGP__DELETE__BSS__PFC__ACK_template()
{
}

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

PDU__BSSGP__DELETE__BSS__PFC__ACK_template::PDU__BSSGP__DELETE__BSS__PFC__ACK_template(const PDU__BSSGP__DELETE__BSS__PFC__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__DELETE__BSS__PFC__ACK_template::match(const PDU__BSSGP__DELETE__BSS__PFC__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__DELETE__BSS__PFC__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound();
}

boolean PDU__BSSGP__DELETE__BSS__PFC__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value();
}

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

PDU__BSSGP__DELETE__BSS__PFC__ACK PDU__BSSGP__DELETE__BSS__PFC__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
PDU__BSSGP__DELETE__BSS__PFC__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__DELETE__BSS__PFC__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DELETE__BSS__PFC__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__DELETE__BSS__PFC__ACK_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__DELETE__BSS__PFC__ACK_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_ACK.");
return single_value->field_pFI;
}

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

void PDU__BSSGP__DELETE__BSS__PFC__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DELETE__BSS__PFC__ACK_template::log_match(const PDU__BSSGP__DELETE__BSS__PFC__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__FLOW__CONTROL__PFC::PDU__BSSGP__FLOW__CONTROL__PFC()
{
}

PDU__BSSGP__FLOW__CONTROL__PFC::PDU__BSSGP__FLOW__CONTROL__PFC(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Tag& par_tag,
    const OPTIONAL< MS__Bucket__Size >& par_mS__Bucket__Size,
    const OPTIONAL< Bucket__Leak__Rate >& par_bucket__Leak__Rate,
    const OPTIONAL< Bucket__Full__Ratio >& par_bucket__Full__Ratio,
    const PFC__flow__control__parameters& par_pFC__flow__control__parameters,
    const OPTIONAL< Flow__Control__Granularity >& par_flow__Control__Granularity)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_tag(par_tag),
  field_mS__Bucket__Size(par_mS__Bucket__Size),
  field_bucket__Leak__Rate(par_bucket__Leak__Rate),
  field_bucket__Full__Ratio(par_bucket__Full__Ratio),
  field_pFC__flow__control__parameters(par_pFC__flow__control__parameters),
  field_flow__Control__Granularity(par_flow__Control__Granularity)
{
}

PDU__BSSGP__FLOW__CONTROL__PFC::PDU__BSSGP__FLOW__CONTROL__PFC(const PDU__BSSGP__FLOW__CONTROL__PFC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.mS__Bucket__Size().is_bound()) field_mS__Bucket__Size = other_value.mS__Bucket__Size();
else field_mS__Bucket__Size.clean_up();
if (other_value.bucket__Leak__Rate().is_bound()) field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
else field_bucket__Leak__Rate.clean_up();
if (other_value.bucket__Full__Ratio().is_bound()) field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
else field_bucket__Full__Ratio.clean_up();
if (other_value.pFC__flow__control__parameters().is_bound()) field_pFC__flow__control__parameters = other_value.pFC__flow__control__parameters();
else field_pFC__flow__control__parameters.clean_up();
if (other_value.flow__Control__Granularity().is_bound()) field_flow__Control__Granularity = other_value.flow__Control__Granularity();
else field_flow__Control__Granularity.clean_up();
}

void PDU__BSSGP__FLOW__CONTROL__PFC::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_tag.clean_up();
field_mS__Bucket__Size.clean_up();
field_bucket__Leak__Rate.clean_up();
field_bucket__Full__Ratio.clean_up();
field_pFC__flow__control__parameters.clean_up();
field_flow__Control__Granularity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLOW__CONTROL__PFC::get_descriptor() const { return &PDU__BSSGP__FLOW__CONTROL__PFC_descr_; }
PDU__BSSGP__FLOW__CONTROL__PFC& PDU__BSSGP__FLOW__CONTROL__PFC::operator=(const PDU__BSSGP__FLOW__CONTROL__PFC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.mS__Bucket__Size().is_bound()) field_mS__Bucket__Size = other_value.mS__Bucket__Size();
  else field_mS__Bucket__Size.clean_up();
  if (other_value.bucket__Leak__Rate().is_bound()) field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
  else field_bucket__Leak__Rate.clean_up();
  if (other_value.bucket__Full__Ratio().is_bound()) field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
  else field_bucket__Full__Ratio.clean_up();
  if (other_value.pFC__flow__control__parameters().is_bound()) field_pFC__flow__control__parameters = other_value.pFC__flow__control__parameters();
  else field_pFC__flow__control__parameters.clean_up();
  if (other_value.flow__Control__Granularity().is_bound()) field_flow__Control__Granularity = other_value.flow__Control__Granularity();
  else field_flow__Control__Granularity.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLOW__CONTROL__PFC::operator==(const PDU__BSSGP__FLOW__CONTROL__PFC& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_tag==other_value.field_tag
  && field_mS__Bucket__Size==other_value.field_mS__Bucket__Size
  && field_bucket__Leak__Rate==other_value.field_bucket__Leak__Rate
  && field_bucket__Full__Ratio==other_value.field_bucket__Full__Ratio
  && field_pFC__flow__control__parameters==other_value.field_pFC__flow__control__parameters
  && field_flow__Control__Granularity==other_value.field_flow__Control__Granularity;
}

boolean PDU__BSSGP__FLOW__CONTROL__PFC::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_tag.is_bound())
  || (OPTIONAL_OMIT == field_mS__Bucket__Size.get_selection() || field_mS__Bucket__Size.is_bound())
  || (OPTIONAL_OMIT == field_bucket__Leak__Rate.get_selection() || field_bucket__Leak__Rate.is_bound())
  || (OPTIONAL_OMIT == field_bucket__Full__Ratio.get_selection() || field_bucket__Full__Ratio.is_bound())
  || (field_pFC__flow__control__parameters.is_bound())
  || (OPTIONAL_OMIT == field_flow__Control__Granularity.get_selection() || field_flow__Control__Granularity.is_bound());
}
boolean PDU__BSSGP__FLOW__CONTROL__PFC::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_tag.is_value()
  && (OPTIONAL_OMIT == field_mS__Bucket__Size.get_selection() || field_mS__Bucket__Size.is_value())
  && (OPTIONAL_OMIT == field_bucket__Leak__Rate.get_selection() || field_bucket__Leak__Rate.is_value())
  && (OPTIONAL_OMIT == field_bucket__Full__Ratio.get_selection() || field_bucket__Full__Ratio.is_value())
  && field_pFC__flow__control__parameters.is_value()
  && (OPTIONAL_OMIT == field_flow__Control__Granularity.get_selection() || field_flow__Control__Granularity.is_value());
}
int PDU__BSSGP__FLOW__CONTROL__PFC::size_of() const
{
  int ret_val = 4;
  if (field_mS__Bucket__Size.ispresent()) ret_val++;
  if (field_bucket__Leak__Rate.ispresent()) ret_val++;
  if (field_bucket__Full__Ratio.ispresent()) ret_val++;
  if (field_flow__Control__Granularity.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__FLOW__CONTROL__PFC::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", mS_Bucket_Size := ");
field_mS__Bucket__Size.log();
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
field_bucket__Leak__Rate.log();
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(", pFC_flow_control_parameters := ");
field_pFC__flow__control__parameters.log();
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLOW__CONTROL__PFC::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
if (!mS__Bucket__Size().is_bound()) mS__Bucket__Size() = OMIT_VALUE;
else mS__Bucket__Size().set_implicit_omit();
if (!bucket__Leak__Rate().is_bound()) bucket__Leak__Rate() = OMIT_VALUE;
else bucket__Leak__Rate().set_implicit_omit();
if (!bucket__Full__Ratio().is_bound()) bucket__Full__Ratio() = OMIT_VALUE;
else bucket__Full__Ratio().set_implicit_omit();
if (pFC__flow__control__parameters().is_bound()) pFC__flow__control__parameters().set_implicit_omit();
if (!flow__Control__Granularity().is_bound()) flow__Control__Granularity() = OMIT_VALUE;
else flow__Control__Granularity().set_implicit_omit();
}

void PDU__BSSGP__FLOW__CONTROL__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 (8<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mS__Bucket__Size().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bucket__Leak__Rate().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) bucket__Full__Ratio().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pFC__flow__control__parameters().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) flow__Control__Granularity().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Bucket_Size")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Bucket__Size().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Leak_Rate")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Leak__Rate().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Full_Ratio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Full__Ratio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFC_flow_control_parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFC__flow__control__parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flow_Control_Granularity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flow__Control__Granularity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
  }
}

void PDU__BSSGP__FLOW__CONTROL__PFC::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_tag.encode_text(text_buf);
field_mS__Bucket__Size.encode_text(text_buf);
field_bucket__Leak__Rate.encode_text(text_buf);
field_bucket__Full__Ratio.encode_text(text_buf);
field_pFC__flow__control__parameters.encode_text(text_buf);
field_flow__Control__Granularity.encode_text(text_buf);
}

void PDU__BSSGP__FLOW__CONTROL__PFC::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_tag.decode_text(text_buf);
field_mS__Bucket__Size.decode_text(text_buf);
field_bucket__Leak__Rate.decode_text(text_buf);
field_bucket__Full__Ratio.decode_text(text_buf);
field_pFC__flow__control__parameters.decode_text(text_buf);
field_flow__Control__Granularity.decode_text(text_buf);
}

void PDU__BSSGP__FLOW__CONTROL__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 PDU__BSSGP__FLOW__CONTROL__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 PDU__BSSGP__FLOW__CONTROL__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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Tag_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(Tag_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_mS__Bucket__Size = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MS__Bucket__Size_descr_.raw->forceomit);
  decoded_field_length = field_mS__Bucket__Size().RAW_decode(MS__Bucket__Size_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_mS__Bucket__Size = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mS__Bucket__Size=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_bucket__Leak__Rate = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Bucket__Leak__Rate_descr_.raw->forceomit);
  decoded_field_length = field_bucket__Leak__Rate().RAW_decode(Bucket__Leak__Rate_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_bucket__Leak__Rate = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bucket__Leak__Rate=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_bucket__Full__Ratio = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, Bucket__Full__Ratio_descr_.raw->forceomit);
  decoded_field_length = field_bucket__Full__Ratio().RAW_decode(Bucket__Full__Ratio_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_bucket__Full__Ratio = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_bucket__Full__Ratio=OMIT_VALUE;
  RAW_Force_Omit field_6_force_omit(6, force_omit, PFC__flow__control__parameters_descr_.raw->forceomit);
  decoded_field_length = field_pFC__flow__control__parameters.RAW_decode(PFC__flow__control__parameters_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_flow__Control__Granularity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, Flow__Control__Granularity_descr_.raw->forceomit);
  decoded_field_length = field_flow__Control__Granularity().RAW_decode(Flow__Control__Granularity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_flow__Control__Granularity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_flow__Control__Granularity=OMIT_VALUE;
  if (field_bssgpPduType !=  os_65) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__FLOW__CONTROL__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 = 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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Tag_descr_.raw);
  if (field_mS__Bucket__Size.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MS__Bucket__Size_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_bucket__Leak__Rate.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Bucket__Leak__Rate_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_bucket__Full__Ratio.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Bucket__Full__Ratio_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, PFC__flow__control__parameters_descr_.raw);
  if (field_flow__Control__Granularity.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Flow__Control__Granularity_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[2]);
  if (field_mS__Bucket__Size.ispresent()) {
  encoded_length += field_mS__Bucket__Size().RAW_encode(MS__Bucket__Size_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bucket__Leak__Rate.ispresent()) {
  encoded_length += field_bucket__Leak__Rate().RAW_encode(Bucket__Leak__Rate_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_bucket__Full__Ratio.ispresent()) {
  encoded_length += field_bucket__Full__Ratio().RAW_encode(Bucket__Full__Ratio_descr_, *myleaf.body.node.nodes[5]);
  }
  encoded_length += field_pFC__flow__control__parameters.RAW_encode(PFC__flow__control__parameters_descr_, *myleaf.body.node.nodes[6]);
  if (field_flow__Control__Granularity.ispresent()) {
  encoded_length += field_flow__Control__Granularity().RAW_encode(Flow__Control__Granularity_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_bssgpPduType !=  os_65) {
  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_65.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLOW__CONTROL__PFC_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Tag_template field_tag;
MS__Bucket__Size_template field_mS__Bucket__Size;
Bucket__Leak__Rate_template field_bucket__Leak__Rate;
Bucket__Full__Ratio_template field_bucket__Full__Ratio;
PFC__flow__control__parameters_template field_pFC__flow__control__parameters;
Flow__Control__Granularity_template field_flow__Control__Granularity;
};

void PDU__BSSGP__FLOW__CONTROL__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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_tag = ANY_VALUE;
single_value->field_mS__Bucket__Size = ANY_OR_OMIT;
single_value->field_bucket__Leak__Rate = ANY_OR_OMIT;
single_value->field_bucket__Full__Ratio = ANY_OR_OMIT;
single_value->field_pFC__flow__control__parameters = ANY_VALUE;
single_value->field_flow__Control__Granularity = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__FLOW__CONTROL__PFC_template::copy_value(const PDU__BSSGP__FLOW__CONTROL__PFC& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.mS__Bucket__Size().is_bound()) {
  if (other_value.mS__Bucket__Size().ispresent()) single_value->field_mS__Bucket__Size = other_value.mS__Bucket__Size()();
  else single_value->field_mS__Bucket__Size = OMIT_VALUE;
} else {
  single_value->field_mS__Bucket__Size.clean_up();
}
if (other_value.bucket__Leak__Rate().is_bound()) {
  if (other_value.bucket__Leak__Rate().ispresent()) single_value->field_bucket__Leak__Rate = other_value.bucket__Leak__Rate()();
  else single_value->field_bucket__Leak__Rate = OMIT_VALUE;
} else {
  single_value->field_bucket__Leak__Rate.clean_up();
}
if (other_value.bucket__Full__Ratio().is_bound()) {
  if (other_value.bucket__Full__Ratio().ispresent()) single_value->field_bucket__Full__Ratio = other_value.bucket__Full__Ratio()();
  else single_value->field_bucket__Full__Ratio = OMIT_VALUE;
} else {
  single_value->field_bucket__Full__Ratio.clean_up();
}
if (other_value.pFC__flow__control__parameters().is_bound()) {
  single_value->field_pFC__flow__control__parameters = other_value.pFC__flow__control__parameters();
} else {
  single_value->field_pFC__flow__control__parameters.clean_up();
}
if (other_value.flow__Control__Granularity().is_bound()) {
  if (other_value.flow__Control__Granularity().ispresent()) single_value->field_flow__Control__Granularity = other_value.flow__Control__Granularity()();
  else single_value->field_flow__Control__Granularity = OMIT_VALUE;
} else {
  single_value->field_flow__Control__Granularity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLOW__CONTROL__PFC_template::copy_template(const PDU__BSSGP__FLOW__CONTROL__PFC_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__Bucket__Size().get_selection()) {
single_value->field_mS__Bucket__Size = other_value.mS__Bucket__Size();
} else {
single_value->field_mS__Bucket__Size.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bucket__Leak__Rate().get_selection()) {
single_value->field_bucket__Leak__Rate = other_value.bucket__Leak__Rate();
} else {
single_value->field_bucket__Leak__Rate.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bucket__Full__Ratio().get_selection()) {
single_value->field_bucket__Full__Ratio = other_value.bucket__Full__Ratio();
} else {
single_value->field_bucket__Full__Ratio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFC__flow__control__parameters().get_selection()) {
single_value->field_pFC__flow__control__parameters = other_value.pFC__flow__control__parameters();
} else {
single_value->field_pFC__flow__control__parameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flow__Control__Granularity().get_selection()) {
single_value->field_flow__Control__Granularity = other_value.flow__Control__Granularity();
} else {
single_value->field_flow__Control__Granularity.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__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 PDU__BSSGP__FLOW__CONTROL__PFC_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLOW__CONTROL__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.PDU_BSSGP_FLOW_CONTROL_PFC.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLOW__CONTROL__PFC_template::PDU__BSSGP__FLOW__CONTROL__PFC_template()
{
}

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

PDU__BSSGP__FLOW__CONTROL__PFC_template::PDU__BSSGP__FLOW__CONTROL__PFC_template(const PDU__BSSGP__FLOW__CONTROL__PFC& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLOW__CONTROL__PFC_template::match(const PDU__BSSGP__FLOW__CONTROL__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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.mS__Bucket__Size().is_bound()) return FALSE;
if((other_value.mS__Bucket__Size().ispresent() ? !single_value->field_mS__Bucket__Size.match((const MS__Bucket__Size&)other_value.mS__Bucket__Size(), legacy) : !single_value->field_mS__Bucket__Size.match_omit(legacy)))return FALSE;
if(!other_value.bucket__Leak__Rate().is_bound()) return FALSE;
if((other_value.bucket__Leak__Rate().ispresent() ? !single_value->field_bucket__Leak__Rate.match((const Bucket__Leak__Rate&)other_value.bucket__Leak__Rate(), legacy) : !single_value->field_bucket__Leak__Rate.match_omit(legacy)))return FALSE;
if(!other_value.bucket__Full__Ratio().is_bound()) return FALSE;
if((other_value.bucket__Full__Ratio().ispresent() ? !single_value->field_bucket__Full__Ratio.match((const Bucket__Full__Ratio&)other_value.bucket__Full__Ratio(), legacy) : !single_value->field_bucket__Full__Ratio.match_omit(legacy)))return FALSE;
if(!other_value.pFC__flow__control__parameters().is_bound()) return FALSE;
if(!single_value->field_pFC__flow__control__parameters.match(other_value.pFC__flow__control__parameters(), legacy))return FALSE;
if(!other_value.flow__Control__Granularity().is_bound()) return FALSE;
if((other_value.flow__Control__Granularity().ispresent() ? !single_value->field_flow__Control__Granularity.match((const Flow__Control__Granularity&)other_value.flow__Control__Granularity(), legacy) : !single_value->field_flow__Control__Granularity.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
}
return FALSE;
}

boolean PDU__BSSGP__FLOW__CONTROL__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_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_tag.is_bound()
 || (single_value->field_mS__Bucket__Size.is_omit() || single_value->field_mS__Bucket__Size.is_bound())
 || (single_value->field_bucket__Leak__Rate.is_omit() || single_value->field_bucket__Leak__Rate.is_bound())
 || (single_value->field_bucket__Full__Ratio.is_omit() || single_value->field_bucket__Full__Ratio.is_bound())
 || single_value->field_pFC__flow__control__parameters.is_bound()
 || (single_value->field_flow__Control__Granularity.is_omit() || single_value->field_flow__Control__Granularity.is_bound());
}

boolean PDU__BSSGP__FLOW__CONTROL__PFC_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_tag.is_value()
 && (single_value->field_mS__Bucket__Size.is_omit() || single_value->field_mS__Bucket__Size.is_value())
 && (single_value->field_bucket__Leak__Rate.is_omit() || single_value->field_bucket__Leak__Rate.is_value())
 && (single_value->field_bucket__Full__Ratio.is_omit() || single_value->field_bucket__Full__Ratio.is_value())
 && single_value->field_pFC__flow__control__parameters.is_value()
 && (single_value->field_flow__Control__Granularity.is_omit() || single_value->field_flow__Control__Granularity.is_value());
}

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

PDU__BSSGP__FLOW__CONTROL__PFC PDU__BSSGP__FLOW__CONTROL__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.PDU_BSSGP_FLOW_CONTROL_PFC.");
PDU__BSSGP__FLOW__CONTROL__PFC ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_mS__Bucket__Size.is_omit()) ret_val.mS__Bucket__Size() = OMIT_VALUE;
else if (single_value->field_mS__Bucket__Size.is_bound()) {
ret_val.mS__Bucket__Size() = single_value->field_mS__Bucket__Size.valueof();
}
if (single_value->field_bucket__Leak__Rate.is_omit()) ret_val.bucket__Leak__Rate() = OMIT_VALUE;
else if (single_value->field_bucket__Leak__Rate.is_bound()) {
ret_val.bucket__Leak__Rate() = single_value->field_bucket__Leak__Rate.valueof();
}
if (single_value->field_bucket__Full__Ratio.is_omit()) ret_val.bucket__Full__Ratio() = OMIT_VALUE;
else if (single_value->field_bucket__Full__Ratio.is_bound()) {
ret_val.bucket__Full__Ratio() = single_value->field_bucket__Full__Ratio.valueof();
}
if (single_value->field_pFC__flow__control__parameters.is_bound()) {
ret_val.pFC__flow__control__parameters() = single_value->field_pFC__flow__control__parameters.valueof();
}
if (single_value->field_flow__Control__Granularity.is_omit()) ret_val.flow__Control__Granularity() = OMIT_VALUE;
else if (single_value->field_flow__Control__Granularity.is_bound()) {
ret_val.flow__Control__Granularity() = single_value->field_flow__Control__Granularity.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_tLLI;
}

Tag_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_tag;
}

MS__Bucket__Size_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::mS__Bucket__Size()
{
set_specific();
return single_value->field_mS__Bucket__Size;
}

const MS__Bucket__Size_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::mS__Bucket__Size() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_Bucket_Size of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_mS__Bucket__Size;
}

Bucket__Leak__Rate_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::bucket__Leak__Rate()
{
set_specific();
return single_value->field_bucket__Leak__Rate;
}

const Bucket__Leak__Rate_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::bucket__Leak__Rate() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bucket_Leak_Rate of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_bucket__Leak__Rate;
}

Bucket__Full__Ratio_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::bucket__Full__Ratio()
{
set_specific();
return single_value->field_bucket__Full__Ratio;
}

const Bucket__Full__Ratio_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::bucket__Full__Ratio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bucket_Full_Ratio of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_bucket__Full__Ratio;
}

PFC__flow__control__parameters_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::pFC__flow__control__parameters()
{
set_specific();
return single_value->field_pFC__flow__control__parameters;
}

const PFC__flow__control__parameters_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::pFC__flow__control__parameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFC_flow_control_parameters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_pFC__flow__control__parameters;
}

Flow__Control__Granularity_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::flow__Control__Granularity()
{
set_specific();
return single_value->field_flow__Control__Granularity;
}

const Flow__Control__Granularity_template& PDU__BSSGP__FLOW__CONTROL__PFC_template::flow__Control__Granularity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flow_Control_Granularity of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
return single_value->field_flow__Control__Granularity;
}

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

void PDU__BSSGP__FLOW__CONTROL__PFC_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", mS_Bucket_Size := ");
single_value->field_mS__Bucket__Size.log();
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
single_value->field_bucket__Leak__Rate.log();
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
single_value->field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(", pFC_flow_control_parameters := ");
single_value->field_pFC__flow__control__parameters.log();
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
single_value->field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__FLOW__CONTROL__PFC_template::log_match(const PDU__BSSGP__FLOW__CONTROL__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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mS__Bucket__Size().ispresent()){
if(!single_value->field_mS__Bucket__Size.match(match_value.mS__Bucket__Size(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_Bucket_Size");
single_value->field_mS__Bucket__Size.log_match(match_value.mS__Bucket__Size(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__Bucket__Size.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_Bucket_Size := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__Bucket__Size.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bucket__Leak__Rate().ispresent()){
if(!single_value->field_bucket__Leak__Rate.match(match_value.bucket__Leak__Rate(), legacy)){
TTCN_Logger::log_logmatch_info(".bucket_Leak_Rate");
single_value->field_bucket__Leak__Rate.log_match(match_value.bucket__Leak__Rate(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bucket__Leak__Rate.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bucket_Leak_Rate := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bucket__Leak__Rate.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bucket__Full__Ratio().ispresent()){
if(!single_value->field_bucket__Full__Ratio.match(match_value.bucket__Full__Ratio(), legacy)){
TTCN_Logger::log_logmatch_info(".bucket_Full_Ratio");
single_value->field_bucket__Full__Ratio.log_match(match_value.bucket__Full__Ratio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bucket__Full__Ratio.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bucket_Full_Ratio := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bucket__Full__Ratio.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_pFC__flow__control__parameters.match(match_value.pFC__flow__control__parameters(), legacy)){
TTCN_Logger::log_logmatch_info(".pFC_flow_control_parameters");
single_value->field_pFC__flow__control__parameters.log_match(match_value.pFC__flow__control__parameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.flow__Control__Granularity().ispresent()){
if(!single_value->field_flow__Control__Granularity.match(match_value.flow__Control__Granularity(), legacy)){
TTCN_Logger::log_logmatch_info(".flow_Control_Granularity");
single_value->field_flow__Control__Granularity.log_match(match_value.flow__Control__Granularity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_flow__Control__Granularity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".flow_Control_Granularity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_flow__Control__Granularity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", mS_Bucket_Size := ");
if (match_value.mS__Bucket__Size().ispresent()) {
single_value->field_mS__Bucket__Size.log_match(match_value.mS__Bucket__Size(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__Bucket__Size.log();
if (single_value->field_mS__Bucket__Size.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bucket_Leak_Rate := ");
if (match_value.bucket__Leak__Rate().ispresent()) {
single_value->field_bucket__Leak__Rate.log_match(match_value.bucket__Leak__Rate(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bucket__Leak__Rate.log();
if (single_value->field_bucket__Leak__Rate.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bucket_Full_Ratio := ");
if (match_value.bucket__Full__Ratio().ispresent()) {
single_value->field_bucket__Full__Ratio.log_match(match_value.bucket__Full__Ratio(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bucket__Full__Ratio.log();
if (single_value->field_bucket__Full__Ratio.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pFC_flow_control_parameters := ");
single_value->field_pFC__flow__control__parameters.log_match(match_value.pFC__flow__control__parameters(), legacy);
TTCN_Logger::log_event_str(", flow_Control_Granularity := ");
if (match_value.flow__Control__Granularity().ispresent()) {
single_value->field_flow__Control__Granularity.log_match(match_value.flow__Control__Granularity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_flow__Control__Granularity.log();
if (single_value->field_flow__Control__Granularity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__FLOW__CONTROL__PFC_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_tag.encode_text(text_buf);
single_value->field_mS__Bucket__Size.encode_text(text_buf);
single_value->field_bucket__Leak__Rate.encode_text(text_buf);
single_value->field_bucket__Full__Ratio.encode_text(text_buf);
single_value->field_pFC__flow__control__parameters.encode_text(text_buf);
single_value->field_flow__Control__Granularity.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC.");
}
}

void PDU__BSSGP__FLOW__CONTROL__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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_tag.decode_text(text_buf);
single_value->field_mS__Bucket__Size.decode_text(text_buf);
single_value->field_bucket__Leak__Rate.decode_text(text_buf);
single_value->field_bucket__Full__Ratio.decode_text(text_buf);
single_value->field_pFC__flow__control__parameters.decode_text(text_buf);
single_value->field_flow__Control__Granularity.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__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.PDU_BSSGP_FLOW_CONTROL_PFC.");
}
}

void PDU__BSSGP__FLOW__CONTROL__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: {
    PDU__BSSGP__FLOW__CONTROL__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 (8<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mS__Bucket__Size().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bucket__Leak__Rate().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) bucket__Full__Ratio().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pFC__flow__control__parameters().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) flow__Control__Granularity().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Bucket_Size")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Bucket__Size().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Leak_Rate")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Leak__Rate().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bucket_Full_Ratio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bucket__Full__Ratio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFC_flow_control_parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFC__flow__control__parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flow_Control_Granularity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flow__Control__Granularity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__FLOW__CONTROL__PFC_template* precondition = new PDU__BSSGP__FLOW__CONTROL__PFC_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__FLOW__CONTROL__PFC_template* implied_template = new PDU__BSSGP__FLOW__CONTROL__PFC_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__FLOW__CONTROL__PFC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__FLOW__CONTROL__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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
single_value->field_tag.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
single_value->field_mS__Bucket__Size.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
single_value->field_bucket__Leak__Rate.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
single_value->field_bucket__Full__Ratio.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
single_value->field_pFC__flow__control__parameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC");
single_value->field_flow__Control__Granularity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_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.PDU_BSSGP_FLOW_CONTROL_PFC");
}

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

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

PDU__BSSGP__FLOW__CONTROL__PFC__ACK::PDU__BSSGP__FLOW__CONTROL__PFC__ACK()
{
}

PDU__BSSGP__FLOW__CONTROL__PFC__ACK::PDU__BSSGP__FLOW__CONTROL__PFC__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Tag& par_tag)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_tag(par_tag)
{
}

PDU__BSSGP__FLOW__CONTROL__PFC__ACK::PDU__BSSGP__FLOW__CONTROL__PFC__ACK(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_tag.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__FLOW__CONTROL__PFC__ACK::get_descriptor() const { return &PDU__BSSGP__FLOW__CONTROL__PFC__ACK_descr_; }
PDU__BSSGP__FLOW__CONTROL__PFC__ACK& PDU__BSSGP__FLOW__CONTROL__PFC__ACK::operator=(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
}
return *this;
}

boolean PDU__BSSGP__FLOW__CONTROL__PFC__ACK::operator==(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_tag==other_value.field_tag;
}

boolean PDU__BSSGP__FLOW__CONTROL__PFC__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_tag.is_bound());
}
boolean PDU__BSSGP__FLOW__CONTROL__PFC__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_tag.is_value();
}
void PDU__BSSGP__FLOW__CONTROL__PFC__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK");
  }
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_tag.encode_text(text_buf);
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_tag.decode_text(text_buf);
}

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

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

int PDU__BSSGP__FLOW__CONTROL__PFC__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Tag_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(Tag_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_66) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__FLOW__CONTROL__PFC__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Tag_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_66) {
  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_66.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Tag_template field_tag;
};

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_tag = ANY_VALUE;
}
}
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::copy_value(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::copy_template(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template()
{
}

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

PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::match(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_tag.is_bound();
}

boolean PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_tag.is_value();
}

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

PDU__BSSGP__FLOW__CONTROL__PFC__ACK PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
PDU__BSSGP__FLOW__CONTROL__PFC__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
return single_value->field_tLLI;
}

Tag_template& PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_FLOW_CONTROL_PFC_ACK.");
return single_value->field_tag;
}

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

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__FLOW__CONTROL__PFC__ACK_template::log_match(const PDU__BSSGP__FLOW__CONTROL__PFC__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__DELETE__BSS__PFC__REQ::PDU__BSSGP__DELETE__BSS__PFC__REQ()
{
}

PDU__BSSGP__DELETE__BSS__PFC__REQ::PDU__BSSGP__DELETE__BSS__PFC__REQ(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const PFI& par_pFI,
    const Cause__BSSGP& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_pFI(par_pFI),
  field_cause(par_cause)
{
}

PDU__BSSGP__DELETE__BSS__PFC__REQ::PDU__BSSGP__DELETE__BSS__PFC__REQ(const PDU__BSSGP__DELETE__BSS__PFC__REQ& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_pFI.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DELETE__BSS__PFC__REQ::get_descriptor() const { return &PDU__BSSGP__DELETE__BSS__PFC__REQ_descr_; }
PDU__BSSGP__DELETE__BSS__PFC__REQ& PDU__BSSGP__DELETE__BSS__PFC__REQ::operator=(const PDU__BSSGP__DELETE__BSS__PFC__REQ& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DELETE__BSS__PFC__REQ::operator==(const PDU__BSSGP__DELETE__BSS__PFC__REQ& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_pFI==other_value.field_pFI
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__DELETE__BSS__PFC__REQ::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_pFI.is_bound())
  || (field_cause.is_bound());
}
boolean PDU__BSSGP__DELETE__BSS__PFC__REQ::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_pFI.is_value()
  && field_cause.is_value();
}
void PDU__BSSGP__DELETE__BSS__PFC__REQ::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (pFI().is_bound()) pFI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ");
  }
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

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

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

int PDU__BSSGP__DELETE__BSS__PFC__REQ::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_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, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_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 PDU__BSSGP__DELETE__BSS__PFC__REQ::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFI_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cause__BSSGP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  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 PDU__BSSGP__DELETE__BSS__PFC__REQ_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
PFI_template field_pFI;
Cause__BSSGP_template field_cause;
};

void PDU__BSSGP__DELETE__BSS__PFC__REQ_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_pFI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
}
}
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ_template::copy_value(const PDU__BSSGP__DELETE__BSS__PFC__REQ& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ_template::copy_template(const PDU__BSSGP__DELETE__BSS__PFC__REQ_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DELETE__BSS__PFC__REQ_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__DELETE__BSS__PFC__REQ_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DELETE__BSS__PFC__REQ_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DELETE__BSS__PFC__REQ_template::PDU__BSSGP__DELETE__BSS__PFC__REQ_template()
{
}

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

PDU__BSSGP__DELETE__BSS__PFC__REQ_template::PDU__BSSGP__DELETE__BSS__PFC__REQ_template(const PDU__BSSGP__DELETE__BSS__PFC__REQ& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__DELETE__BSS__PFC__REQ_template::match(const PDU__BSSGP__DELETE__BSS__PFC__REQ& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
}
return FALSE;
}

boolean PDU__BSSGP__DELETE__BSS__PFC__REQ_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_pFI.is_bound()
 || single_value->field_cause.is_bound();
}

boolean PDU__BSSGP__DELETE__BSS__PFC__REQ_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_pFI.is_value()
 && single_value->field_cause.is_value();
}

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

PDU__BSSGP__DELETE__BSS__PFC__REQ PDU__BSSGP__DELETE__BSS__PFC__REQ_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
PDU__BSSGP__DELETE__BSS__PFC__REQ ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
return single_value->field_tLLI;
}

PFI_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
return single_value->field_pFI;
}

Cause__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__DELETE__BSS__PFC__REQ_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DELETE_BSS_PFC_REQ.");
return single_value->field_cause;
}

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

void PDU__BSSGP__DELETE__BSS__PFC__REQ_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DELETE__BSS__PFC__REQ_template::log_match(const PDU__BSSGP__DELETE__BSS__PFC__REQ& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__PS__HANDOVER__REQUIRED::PDU__BSSGP__PS__HANDOVER__REQUIRED()
{
}

PDU__BSSGP__PS__HANDOVER__REQUIRED::PDU__BSSGP__PS__HANDOVER__REQUIRED(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Cause__BSSGP& par_cause,
    const Cell__Identifier& par_source__Cell__Identifier,
    const Cell__or__RNC__Id__with__Transparent__Container__BSSGP& par_cell__or__RNC__Id__with__Transparent__Container,
    const Active__PFCs__List__BSSGP& par_active__PFCs__List,
    const OPTIONAL< ENB__Identifier >& par_target__ENB__Identifier,
    const OPTIONAL< Reliable__Inter__RAT__Handover__Info >& par_reliable__Inter__RAT__Handover__Info,
    const OPTIONAL< CSG__Identifier__TLV >& par_cSG__Identifier,
    const OPTIONAL< Tracking__Area__Code__TLV >& par_tracking__Area__Code)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_cause(par_cause),
  field_source__Cell__Identifier(par_source__Cell__Identifier),
  field_cell__or__RNC__Id__with__Transparent__Container(par_cell__or__RNC__Id__with__Transparent__Container),
  field_active__PFCs__List(par_active__PFCs__List),
  field_target__ENB__Identifier(par_target__ENB__Identifier),
  field_reliable__Inter__RAT__Handover__Info(par_reliable__Inter__RAT__Handover__Info),
  field_cSG__Identifier(par_cSG__Identifier),
  field_tracking__Area__Code(par_tracking__Area__Code)
{
}

PDU__BSSGP__PS__HANDOVER__REQUIRED::PDU__BSSGP__PS__HANDOVER__REQUIRED(const PDU__BSSGP__PS__HANDOVER__REQUIRED& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
else field_source__Cell__Identifier.clean_up();
if (other_value.cell__or__RNC__Id__with__Transparent__Container().is_bound()) field_cell__or__RNC__Id__with__Transparent__Container = other_value.cell__or__RNC__Id__with__Transparent__Container();
else field_cell__or__RNC__Id__with__Transparent__Container.clean_up();
if (other_value.active__PFCs__List().is_bound()) field_active__PFCs__List = other_value.active__PFCs__List();
else field_active__PFCs__List.clean_up();
if (other_value.target__ENB__Identifier().is_bound()) field_target__ENB__Identifier = other_value.target__ENB__Identifier();
else field_target__ENB__Identifier.clean_up();
if (other_value.reliable__Inter__RAT__Handover__Info().is_bound()) field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info();
else field_reliable__Inter__RAT__Handover__Info.clean_up();
if (other_value.cSG__Identifier().is_bound()) field_cSG__Identifier = other_value.cSG__Identifier();
else field_cSG__Identifier.clean_up();
if (other_value.tracking__Area__Code().is_bound()) field_tracking__Area__Code = other_value.tracking__Area__Code();
else field_tracking__Area__Code.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_cause.clean_up();
field_source__Cell__Identifier.clean_up();
field_cell__or__RNC__Id__with__Transparent__Container.clean_up();
field_active__PFCs__List.clean_up();
field_target__ENB__Identifier.clean_up();
field_reliable__Inter__RAT__Handover__Info.clean_up();
field_cSG__Identifier.clean_up();
field_tracking__Area__Code.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__REQUIRED::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__REQUIRED_descr_; }
PDU__BSSGP__PS__HANDOVER__REQUIRED& PDU__BSSGP__PS__HANDOVER__REQUIRED::operator=(const PDU__BSSGP__PS__HANDOVER__REQUIRED& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
  else field_source__Cell__Identifier.clean_up();
  if (other_value.cell__or__RNC__Id__with__Transparent__Container().is_bound()) field_cell__or__RNC__Id__with__Transparent__Container = other_value.cell__or__RNC__Id__with__Transparent__Container();
  else field_cell__or__RNC__Id__with__Transparent__Container.clean_up();
  if (other_value.active__PFCs__List().is_bound()) field_active__PFCs__List = other_value.active__PFCs__List();
  else field_active__PFCs__List.clean_up();
  if (other_value.target__ENB__Identifier().is_bound()) field_target__ENB__Identifier = other_value.target__ENB__Identifier();
  else field_target__ENB__Identifier.clean_up();
  if (other_value.reliable__Inter__RAT__Handover__Info().is_bound()) field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info();
  else field_reliable__Inter__RAT__Handover__Info.clean_up();
  if (other_value.cSG__Identifier().is_bound()) field_cSG__Identifier = other_value.cSG__Identifier();
  else field_cSG__Identifier.clean_up();
  if (other_value.tracking__Area__Code().is_bound()) field_tracking__Area__Code = other_value.tracking__Area__Code();
  else field_tracking__Area__Code.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED::operator==(const PDU__BSSGP__PS__HANDOVER__REQUIRED& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_cause==other_value.field_cause
  && field_source__Cell__Identifier==other_value.field_source__Cell__Identifier
  && field_cell__or__RNC__Id__with__Transparent__Container==other_value.field_cell__or__RNC__Id__with__Transparent__Container
  && field_active__PFCs__List==other_value.field_active__PFCs__List
  && field_target__ENB__Identifier==other_value.field_target__ENB__Identifier
  && field_reliable__Inter__RAT__Handover__Info==other_value.field_reliable__Inter__RAT__Handover__Info
  && field_cSG__Identifier==other_value.field_cSG__Identifier
  && field_tracking__Area__Code==other_value.field_tracking__Area__Code;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_cause.is_bound())
  || (field_source__Cell__Identifier.is_bound())
  || (field_cell__or__RNC__Id__with__Transparent__Container.is_bound())
  || (field_active__PFCs__List.is_bound())
  || (OPTIONAL_OMIT == field_target__ENB__Identifier.get_selection() || field_target__ENB__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_reliable__Inter__RAT__Handover__Info.get_selection() || field_reliable__Inter__RAT__Handover__Info.is_bound())
  || (OPTIONAL_OMIT == field_cSG__Identifier.get_selection() || field_cSG__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_tracking__Area__Code.get_selection() || field_tracking__Area__Code.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__REQUIRED::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_cause.is_value()
  && field_source__Cell__Identifier.is_value()
  && field_cell__or__RNC__Id__with__Transparent__Container.is_value()
  && field_active__PFCs__List.is_value()
  && (OPTIONAL_OMIT == field_target__ENB__Identifier.get_selection() || field_target__ENB__Identifier.is_value())
  && (OPTIONAL_OMIT == field_reliable__Inter__RAT__Handover__Info.get_selection() || field_reliable__Inter__RAT__Handover__Info.is_value())
  && (OPTIONAL_OMIT == field_cSG__Identifier.get_selection() || field_cSG__Identifier.is_value())
  && (OPTIONAL_OMIT == field_tracking__Area__Code.get_selection() || field_tracking__Area__Code.is_value());
}
int PDU__BSSGP__PS__HANDOVER__REQUIRED::size_of() const
{
  int ret_val = 6;
  if (field_target__ENB__Identifier.ispresent()) ret_val++;
  if (field_reliable__Inter__RAT__Handover__Info.ispresent()) ret_val++;
  if (field_cSG__Identifier.ispresent()) ret_val++;
  if (field_tracking__Area__Code.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", cell_or_RNC_Id_with_Transparent_Container := ");
field_cell__or__RNC__Id__with__Transparent__Container.log();
TTCN_Logger::log_event_str(", active_PFCs_List := ");
field_active__PFCs__List.log();
TTCN_Logger::log_event_str(", target_ENB_Identifier := ");
field_target__ENB__Identifier.log();
TTCN_Logger::log_event_str(", reliable_Inter_RAT_Handover_Info := ");
field_reliable__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", cSG_Identifier := ");
field_cSG__Identifier.log();
TTCN_Logger::log_event_str(", tracking_Area_Code := ");
field_tracking__Area__Code.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (source__Cell__Identifier().is_bound()) source__Cell__Identifier().set_implicit_omit();
if (cell__or__RNC__Id__with__Transparent__Container().is_bound()) cell__or__RNC__Id__with__Transparent__Container().set_implicit_omit();
if (active__PFCs__List().is_bound()) active__PFCs__List().set_implicit_omit();
if (!target__ENB__Identifier().is_bound()) target__ENB__Identifier() = OMIT_VALUE;
else target__ENB__Identifier().set_implicit_omit();
if (!reliable__Inter__RAT__Handover__Info().is_bound()) reliable__Inter__RAT__Handover__Info() = OMIT_VALUE;
else reliable__Inter__RAT__Handover__Info().set_implicit_omit();
if (!cSG__Identifier().is_bound()) cSG__Identifier() = OMIT_VALUE;
else cSG__Identifier().set_implicit_omit();
if (!tracking__Area__Code().is_bound()) tracking__Area__Code() = OMIT_VALUE;
else tracking__Area__Code().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED::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.PDU_BSSGP_PS_HANDOVER_REQUIRED 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cell__or__RNC__Id__with__Transparent__Container().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) active__PFCs__List().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) target__ENB__Identifier().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) reliable__Inter__RAT__Handover__Info().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cSG__Identifier().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tracking__Area__Code().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "cell_or_RNC_Id_with_Transparent_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__or__RNC__Id__with__Transparent__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(), "active_PFCs_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          active__PFCs__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_ENB_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__ENB__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(), "reliable_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reliable__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cSG_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cSG__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(), "tracking_Area_Code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tracking__Area__Code().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
  }
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_source__Cell__Identifier.encode_text(text_buf);
field_cell__or__RNC__Id__with__Transparent__Container.encode_text(text_buf);
field_active__PFCs__List.encode_text(text_buf);
field_target__ENB__Identifier.encode_text(text_buf);
field_reliable__Inter__RAT__Handover__Info.encode_text(text_buf);
field_cSG__Identifier.encode_text(text_buf);
field_tracking__Area__Code.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_source__Cell__Identifier.decode_text(text_buf);
field_cell__or__RNC__Id__with__Transparent__Container.decode_text(text_buf);
field_active__PFCs__List.decode_text(text_buf);
field_target__ENB__Identifier.decode_text(text_buf);
field_reliable__Inter__RAT__Handover__Info.decode_text(text_buf);
field_cSG__Identifier.decode_text(text_buf);
field_tracking__Area__Code.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PS__HANDOVER__REQUIRED::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_source__Cell__Identifier.RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, Cell__or__RNC__Id__with__Transparent__Container__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cell__or__RNC__Id__with__Transparent__Container.RAW_decode(Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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, Active__PFCs__List__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_active__PFCs__List.RAW_decode(Active__PFCs__List__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_target__ENB__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ENB__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_target__ENB__Identifier().RAW_decode(ENB__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_target__ENB__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__ENB__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_reliable__Inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, Reliable__Inter__RAT__Handover__Info_descr_.raw->forceomit);
  decoded_field_length = field_reliable__Inter__RAT__Handover__Info().RAW_decode(Reliable__Inter__RAT__Handover__Info_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_reliable__Inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_reliable__Inter__RAT__Handover__Info=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_cSG__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, CSG__Identifier__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cSG__Identifier().RAW_decode(CSG__Identifier__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_cSG__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cSG__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_tracking__Area__Code = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, Tracking__Area__Code__TLV_descr_.raw->forceomit);
  decoded_field_length = field_tracking__Area__Code().RAW_decode(Tracking__Area__Code__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_tracking__Area__Code = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_tracking__Area__Code=OMIT_VALUE;
  if (field_bssgpPduType !=  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 PDU__BSSGP__PS__HANDOVER__REQUIRED::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 10;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(10);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Cause__BSSGP_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Cell__or__RNC__Id__with__Transparent__Container__BSSGP_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Active__PFCs__List__BSSGP_descr_.raw);
  if (field_target__ENB__Identifier.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ENB__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_reliable__Inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Reliable__Inter__RAT__Handover__Info_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_cSG__Identifier.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, CSG__Identifier__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_tracking__Area__Code.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, Tracking__Area__Code__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_source__Cell__Identifier.RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_cell__or__RNC__Id__with__Transparent__Container.RAW_encode(Cell__or__RNC__Id__with__Transparent__Container__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_active__PFCs__List.RAW_encode(Active__PFCs__List__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  if (field_target__ENB__Identifier.ispresent()) {
  encoded_length += field_target__ENB__Identifier().RAW_encode(ENB__Identifier_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_reliable__Inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_reliable__Inter__RAT__Handover__Info().RAW_encode(Reliable__Inter__RAT__Handover__Info_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_cSG__Identifier.ispresent()) {
  encoded_length += field_cSG__Identifier().RAW_encode(CSG__Identifier__TLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_tracking__Area__Code.ispresent()) {
  encoded_length += field_tracking__Area__Code().RAW_encode(Tracking__Area__Code__TLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_bssgpPduType !=  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 PDU__BSSGP__PS__HANDOVER__REQUIRED_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Cause__BSSGP_template field_cause;
Cell__Identifier_template field_source__Cell__Identifier;
Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template field_cell__or__RNC__Id__with__Transparent__Container;
Active__PFCs__List__BSSGP_template field_active__PFCs__List;
ENB__Identifier_template field_target__ENB__Identifier;
Reliable__Inter__RAT__Handover__Info_template field_reliable__Inter__RAT__Handover__Info;
CSG__Identifier__TLV_template field_cSG__Identifier;
Tracking__Area__Code__TLV_template field_tracking__Area__Code;
};

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_source__Cell__Identifier = ANY_VALUE;
single_value->field_cell__or__RNC__Id__with__Transparent__Container = ANY_VALUE;
single_value->field_active__PFCs__List = ANY_VALUE;
single_value->field_target__ENB__Identifier = ANY_OR_OMIT;
single_value->field_reliable__Inter__RAT__Handover__Info = ANY_OR_OMIT;
single_value->field_cSG__Identifier = ANY_OR_OMIT;
single_value->field_tracking__Area__Code = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::copy_value(const PDU__BSSGP__PS__HANDOVER__REQUIRED& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.source__Cell__Identifier().is_bound()) {
  single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
  single_value->field_source__Cell__Identifier.clean_up();
}
if (other_value.cell__or__RNC__Id__with__Transparent__Container().is_bound()) {
  single_value->field_cell__or__RNC__Id__with__Transparent__Container = other_value.cell__or__RNC__Id__with__Transparent__Container();
} else {
  single_value->field_cell__or__RNC__Id__with__Transparent__Container.clean_up();
}
if (other_value.active__PFCs__List().is_bound()) {
  single_value->field_active__PFCs__List = other_value.active__PFCs__List();
} else {
  single_value->field_active__PFCs__List.clean_up();
}
if (other_value.target__ENB__Identifier().is_bound()) {
  if (other_value.target__ENB__Identifier().ispresent()) single_value->field_target__ENB__Identifier = other_value.target__ENB__Identifier()();
  else single_value->field_target__ENB__Identifier = OMIT_VALUE;
} else {
  single_value->field_target__ENB__Identifier.clean_up();
}
if (other_value.reliable__Inter__RAT__Handover__Info().is_bound()) {
  if (other_value.reliable__Inter__RAT__Handover__Info().ispresent()) single_value->field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info()();
  else single_value->field_reliable__Inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_reliable__Inter__RAT__Handover__Info.clean_up();
}
if (other_value.cSG__Identifier().is_bound()) {
  if (other_value.cSG__Identifier().ispresent()) single_value->field_cSG__Identifier = other_value.cSG__Identifier()();
  else single_value->field_cSG__Identifier = OMIT_VALUE;
} else {
  single_value->field_cSG__Identifier.clean_up();
}
if (other_value.tracking__Area__Code().is_bound()) {
  if (other_value.tracking__Area__Code().ispresent()) single_value->field_tracking__Area__Code = other_value.tracking__Area__Code()();
  else single_value->field_tracking__Area__Code = OMIT_VALUE;
} else {
  single_value->field_tracking__Area__Code.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::copy_template(const PDU__BSSGP__PS__HANDOVER__REQUIRED_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__Cell__Identifier().get_selection()) {
single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
single_value->field_source__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__or__RNC__Id__with__Transparent__Container().get_selection()) {
single_value->field_cell__or__RNC__Id__with__Transparent__Container = other_value.cell__or__RNC__Id__with__Transparent__Container();
} else {
single_value->field_cell__or__RNC__Id__with__Transparent__Container.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.active__PFCs__List().get_selection()) {
single_value->field_active__PFCs__List = other_value.active__PFCs__List();
} else {
single_value->field_active__PFCs__List.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__ENB__Identifier().get_selection()) {
single_value->field_target__ENB__Identifier = other_value.target__ENB__Identifier();
} else {
single_value->field_target__ENB__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reliable__Inter__RAT__Handover__Info().get_selection()) {
single_value->field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info();
} else {
single_value->field_reliable__Inter__RAT__Handover__Info.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cSG__Identifier().get_selection()) {
single_value->field_cSG__Identifier = other_value.cSG__Identifier();
} else {
single_value->field_cSG__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tracking__Area__Code().get_selection()) {
single_value->field_tracking__Area__Code = other_value.tracking__Area__Code();
} else {
single_value->field_tracking__Area__Code.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUIRED_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__REQUIRED_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__REQUIRED_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__REQUIRED_template::PDU__BSSGP__PS__HANDOVER__REQUIRED_template()
{
}

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

PDU__BSSGP__PS__HANDOVER__REQUIRED_template::PDU__BSSGP__PS__HANDOVER__REQUIRED_template(const PDU__BSSGP__PS__HANDOVER__REQUIRED& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED_template::match(const PDU__BSSGP__PS__HANDOVER__REQUIRED& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.source__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_source__Cell__Identifier.match(other_value.source__Cell__Identifier(), legacy))return FALSE;
if(!other_value.cell__or__RNC__Id__with__Transparent__Container().is_bound()) return FALSE;
if(!single_value->field_cell__or__RNC__Id__with__Transparent__Container.match(other_value.cell__or__RNC__Id__with__Transparent__Container(), legacy))return FALSE;
if(!other_value.active__PFCs__List().is_bound()) return FALSE;
if(!single_value->field_active__PFCs__List.match(other_value.active__PFCs__List(), legacy))return FALSE;
if(!other_value.target__ENB__Identifier().is_bound()) return FALSE;
if((other_value.target__ENB__Identifier().ispresent() ? !single_value->field_target__ENB__Identifier.match((const ENB__Identifier&)other_value.target__ENB__Identifier(), legacy) : !single_value->field_target__ENB__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.reliable__Inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.reliable__Inter__RAT__Handover__Info().ispresent() ? !single_value->field_reliable__Inter__RAT__Handover__Info.match((const Reliable__Inter__RAT__Handover__Info&)other_value.reliable__Inter__RAT__Handover__Info(), legacy) : !single_value->field_reliable__Inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
if(!other_value.cSG__Identifier().is_bound()) return FALSE;
if((other_value.cSG__Identifier().ispresent() ? !single_value->field_cSG__Identifier.match((const CSG__Identifier__TLV&)other_value.cSG__Identifier(), legacy) : !single_value->field_cSG__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.tracking__Area__Code().is_bound()) return FALSE;
if((other_value.tracking__Area__Code().ispresent() ? !single_value->field_tracking__Area__Code.match((const Tracking__Area__Code__TLV&)other_value.tracking__Area__Code(), legacy) : !single_value->field_tracking__Area__Code.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_cause.is_bound()
 || single_value->field_source__Cell__Identifier.is_bound()
 || single_value->field_cell__or__RNC__Id__with__Transparent__Container.is_bound()
 || single_value->field_active__PFCs__List.is_bound()
 || (single_value->field_target__ENB__Identifier.is_omit() || single_value->field_target__ENB__Identifier.is_bound())
 || (single_value->field_reliable__Inter__RAT__Handover__Info.is_omit() || single_value->field_reliable__Inter__RAT__Handover__Info.is_bound())
 || (single_value->field_cSG__Identifier.is_omit() || single_value->field_cSG__Identifier.is_bound())
 || (single_value->field_tracking__Area__Code.is_omit() || single_value->field_tracking__Area__Code.is_bound());
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_cause.is_value()
 && single_value->field_source__Cell__Identifier.is_value()
 && single_value->field_cell__or__RNC__Id__with__Transparent__Container.is_value()
 && single_value->field_active__PFCs__List.is_value()
 && (single_value->field_target__ENB__Identifier.is_omit() || single_value->field_target__ENB__Identifier.is_value())
 && (single_value->field_reliable__Inter__RAT__Handover__Info.is_omit() || single_value->field_reliable__Inter__RAT__Handover__Info.is_value())
 && (single_value->field_cSG__Identifier.is_omit() || single_value->field_cSG__Identifier.is_value())
 && (single_value->field_tracking__Area__Code.is_omit() || single_value->field_tracking__Area__Code.is_value());
}

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

PDU__BSSGP__PS__HANDOVER__REQUIRED PDU__BSSGP__PS__HANDOVER__REQUIRED_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
PDU__BSSGP__PS__HANDOVER__REQUIRED ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_source__Cell__Identifier.is_bound()) {
ret_val.source__Cell__Identifier() = single_value->field_source__Cell__Identifier.valueof();
}
if (single_value->field_cell__or__RNC__Id__with__Transparent__Container.is_bound()) {
ret_val.cell__or__RNC__Id__with__Transparent__Container() = single_value->field_cell__or__RNC__Id__with__Transparent__Container.valueof();
}
if (single_value->field_active__PFCs__List.is_bound()) {
ret_val.active__PFCs__List() = single_value->field_active__PFCs__List.valueof();
}
if (single_value->field_target__ENB__Identifier.is_omit()) ret_val.target__ENB__Identifier() = OMIT_VALUE;
else if (single_value->field_target__ENB__Identifier.is_bound()) {
ret_val.target__ENB__Identifier() = single_value->field_target__ENB__Identifier.valueof();
}
if (single_value->field_reliable__Inter__RAT__Handover__Info.is_omit()) ret_val.reliable__Inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_reliable__Inter__RAT__Handover__Info.is_bound()) {
ret_val.reliable__Inter__RAT__Handover__Info() = single_value->field_reliable__Inter__RAT__Handover__Info.valueof();
}
if (single_value->field_cSG__Identifier.is_omit()) ret_val.cSG__Identifier() = OMIT_VALUE;
else if (single_value->field_cSG__Identifier.is_bound()) {
ret_val.cSG__Identifier() = single_value->field_cSG__Identifier.valueof();
}
if (single_value->field_tracking__Area__Code.is_omit()) ret_val.tracking__Area__Code() = OMIT_VALUE;
else if (single_value->field_tracking__Area__Code.is_bound()) {
ret_val.tracking__Area__Code() = single_value->field_tracking__Area__Code.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_tLLI;
}

Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_cause;
}

Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::source__Cell__Identifier()
{
set_specific();
return single_value->field_source__Cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::source__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_source__Cell__Identifier;
}

Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::cell__or__RNC__Id__with__Transparent__Container()
{
set_specific();
return single_value->field_cell__or__RNC__Id__with__Transparent__Container;
}

const Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::cell__or__RNC__Id__with__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_or_RNC_Id_with_Transparent_Container of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_cell__or__RNC__Id__with__Transparent__Container;
}

Active__PFCs__List__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::active__PFCs__List()
{
set_specific();
return single_value->field_active__PFCs__List;
}

const Active__PFCs__List__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::active__PFCs__List() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field active_PFCs_List of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_active__PFCs__List;
}

ENB__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::target__ENB__Identifier()
{
set_specific();
return single_value->field_target__ENB__Identifier;
}

const ENB__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::target__ENB__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_ENB_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_target__ENB__Identifier;
}

Reliable__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::reliable__Inter__RAT__Handover__Info()
{
set_specific();
return single_value->field_reliable__Inter__RAT__Handover__Info;
}

const Reliable__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::reliable__Inter__RAT__Handover__Info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reliable_Inter_RAT_Handover_Info of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_reliable__Inter__RAT__Handover__Info;
}

CSG__Identifier__TLV_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::cSG__Identifier()
{
set_specific();
return single_value->field_cSG__Identifier;
}

const CSG__Identifier__TLV_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::cSG__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cSG_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_cSG__Identifier;
}

Tracking__Area__Code__TLV_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::tracking__Area__Code()
{
set_specific();
return single_value->field_tracking__Area__Code;
}

const Tracking__Area__Code__TLV_template& PDU__BSSGP__PS__HANDOVER__REQUIRED_template::tracking__Area__Code() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tracking_Area_Code of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
return single_value->field_tracking__Area__Code;
}

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

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", cell_or_RNC_Id_with_Transparent_Container := ");
single_value->field_cell__or__RNC__Id__with__Transparent__Container.log();
TTCN_Logger::log_event_str(", active_PFCs_List := ");
single_value->field_active__PFCs__List.log();
TTCN_Logger::log_event_str(", target_ENB_Identifier := ");
single_value->field_target__ENB__Identifier.log();
TTCN_Logger::log_event_str(", reliable_Inter_RAT_Handover_Info := ");
single_value->field_reliable__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", cSG_Identifier := ");
single_value->field_cSG__Identifier.log();
TTCN_Logger::log_event_str(", tracking_Area_Code := ");
single_value->field_tracking__Area__Code.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::log_match(const PDU__BSSGP__PS__HANDOVER__REQUIRED& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_source__Cell__Identifier.match(match_value.source__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".source_Cell_Identifier");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__or__RNC__Id__with__Transparent__Container.match(match_value.cell__or__RNC__Id__with__Transparent__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_or_RNC_Id_with_Transparent_Container");
single_value->field_cell__or__RNC__Id__with__Transparent__Container.log_match(match_value.cell__or__RNC__Id__with__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_active__PFCs__List.match(match_value.active__PFCs__List(), legacy)){
TTCN_Logger::log_logmatch_info(".active_PFCs_List");
single_value->field_active__PFCs__List.log_match(match_value.active__PFCs__List(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.target__ENB__Identifier().ispresent()){
if(!single_value->field_target__ENB__Identifier.match(match_value.target__ENB__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_ENB_Identifier");
single_value->field_target__ENB__Identifier.log_match(match_value.target__ENB__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__ENB__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_ENB_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__ENB__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.reliable__Inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_reliable__Inter__RAT__Handover__Info.match(match_value.reliable__Inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".reliable_Inter_RAT_Handover_Info");
single_value->field_reliable__Inter__RAT__Handover__Info.log_match(match_value.reliable__Inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_reliable__Inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".reliable_Inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_reliable__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cSG__Identifier().ispresent()){
if(!single_value->field_cSG__Identifier.match(match_value.cSG__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".cSG_Identifier");
single_value->field_cSG__Identifier.log_match(match_value.cSG__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cSG__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cSG_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cSG__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tracking__Area__Code().ispresent()){
if(!single_value->field_tracking__Area__Code.match(match_value.tracking__Area__Code(), legacy)){
TTCN_Logger::log_logmatch_info(".tracking_Area_Code");
single_value->field_tracking__Area__Code.log_match(match_value.tracking__Area__Code(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tracking__Area__Code.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tracking_Area_Code := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tracking__Area__Code.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", cell_or_RNC_Id_with_Transparent_Container := ");
single_value->field_cell__or__RNC__Id__with__Transparent__Container.log_match(match_value.cell__or__RNC__Id__with__Transparent__Container(), legacy);
TTCN_Logger::log_event_str(", active_PFCs_List := ");
single_value->field_active__PFCs__List.log_match(match_value.active__PFCs__List(), legacy);
TTCN_Logger::log_event_str(", target_ENB_Identifier := ");
if (match_value.target__ENB__Identifier().ispresent()) {
single_value->field_target__ENB__Identifier.log_match(match_value.target__ENB__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__ENB__Identifier.log();
if (single_value->field_target__ENB__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", reliable_Inter_RAT_Handover_Info := ");
if (match_value.reliable__Inter__RAT__Handover__Info().ispresent()) {
single_value->field_reliable__Inter__RAT__Handover__Info.log_match(match_value.reliable__Inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_reliable__Inter__RAT__Handover__Info.log();
if (single_value->field_reliable__Inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cSG_Identifier := ");
if (match_value.cSG__Identifier().ispresent()) {
single_value->field_cSG__Identifier.log_match(match_value.cSG__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cSG__Identifier.log();
if (single_value->field_cSG__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tracking_Area_Code := ");
if (match_value.tracking__Area__Code().ispresent()) {
single_value->field_tracking__Area__Code.log_match(match_value.tracking__Area__Code(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tracking__Area__Code.log();
if (single_value->field_tracking__Area__Code.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_source__Cell__Identifier.encode_text(text_buf);
single_value->field_cell__or__RNC__Id__with__Transparent__Container.encode_text(text_buf);
single_value->field_active__PFCs__List.encode_text(text_buf);
single_value->field_target__ENB__Identifier.encode_text(text_buf);
single_value->field_reliable__Inter__RAT__Handover__Info.encode_text(text_buf);
single_value->field_cSG__Identifier.encode_text(text_buf);
single_value->field_tracking__Area__Code.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_source__Cell__Identifier.decode_text(text_buf);
single_value->field_cell__or__RNC__Id__with__Transparent__Container.decode_text(text_buf);
single_value->field_active__PFCs__List.decode_text(text_buf);
single_value->field_target__ENB__Identifier.decode_text(text_buf);
single_value->field_reliable__Inter__RAT__Handover__Info.decode_text(text_buf);
single_value->field_cSG__Identifier.decode_text(text_buf);
single_value->field_tracking__Area__Code.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUIRED_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED.");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PS__HANDOVER__REQUIRED_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.PDU_BSSGP_PS_HANDOVER_REQUIRED 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cell__or__RNC__Id__with__Transparent__Container().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) active__PFCs__List().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) target__ENB__Identifier().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) reliable__Inter__RAT__Handover__Info().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cSG__Identifier().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tracking__Area__Code().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "cell_or_RNC_Id_with_Transparent_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__or__RNC__Id__with__Transparent__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(), "active_PFCs_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          active__PFCs__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_ENB_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__ENB__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(), "reliable_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reliable__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cSG_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cSG__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(), "tracking_Area_Code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tracking__Area__Code().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PS__HANDOVER__REQUIRED_template* precondition = new PDU__BSSGP__PS__HANDOVER__REQUIRED_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PS__HANDOVER__REQUIRED_template* implied_template = new PDU__BSSGP__PS__HANDOVER__REQUIRED_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PS__HANDOVER__REQUIRED_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_source__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_cell__or__RNC__Id__with__Transparent__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_active__PFCs__List.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_target__ENB__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_reliable__Inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_cSG__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
single_value->field_tracking__Area__Code.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED");
}

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

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

PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK()
{
}

PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const List__of__set__up__PFCs__BSSGP& par_list__of__set__up__PFCs,
    const OPTIONAL< Target__BSS__to__Source__BSS__Transparent__Container >& par_target__BSS__to__Source__BSS__Transparent__Container,
    const OPTIONAL< Target__to__Source__Transparent__Container >& par_target__to__Source__Transparent__Container)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_list__of__set__up__PFCs(par_list__of__set__up__PFCs),
  field_target__BSS__to__Source__BSS__Transparent__Container(par_target__BSS__to__Source__BSS__Transparent__Container),
  field_target__to__Source__Transparent__Container(par_target__to__Source__Transparent__Container)
{
}

PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.list__of__set__up__PFCs().is_bound()) field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
else field_list__of__set__up__PFCs.clean_up();
if (other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container();
else field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
if (other_value.target__to__Source__Transparent__Container().is_bound()) field_target__to__Source__Transparent__Container = other_value.target__to__Source__Transparent__Container();
else field_target__to__Source__Transparent__Container.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_list__of__set__up__PFCs.clean_up();
field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
field_target__to__Source__Transparent__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_descr_; }
PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::operator=(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.list__of__set__up__PFCs().is_bound()) field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
  else field_list__of__set__up__PFCs.clean_up();
  if (other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container();
  else field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
  if (other_value.target__to__Source__Transparent__Container().is_bound()) field_target__to__Source__Transparent__Container = other_value.target__to__Source__Transparent__Container();
  else field_target__to__Source__Transparent__Container.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::operator==(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_list__of__set__up__PFCs==other_value.field_list__of__set__up__PFCs
  && field_target__BSS__to__Source__BSS__Transparent__Container==other_value.field_target__BSS__to__Source__BSS__Transparent__Container
  && field_target__to__Source__Transparent__Container==other_value.field_target__to__Source__Transparent__Container;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_list__of__set__up__PFCs.is_bound())
  || (OPTIONAL_OMIT == field_target__BSS__to__Source__BSS__Transparent__Container.get_selection() || field_target__BSS__to__Source__BSS__Transparent__Container.is_bound())
  || (OPTIONAL_OMIT == field_target__to__Source__Transparent__Container.get_selection() || field_target__to__Source__Transparent__Container.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_list__of__set__up__PFCs.is_value()
  && (OPTIONAL_OMIT == field_target__BSS__to__Source__BSS__Transparent__Container.get_selection() || field_target__BSS__to__Source__BSS__Transparent__Container.is_value())
  && (OPTIONAL_OMIT == field_target__to__Source__Transparent__Container.get_selection() || field_target__to__Source__Transparent__Container.is_value());
}
int PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::size_of() const
{
  int ret_val = 3;
  if (field_target__BSS__to__Source__BSS__Transparent__Container.ispresent()) ret_val++;
  if (field_target__to__Source__Transparent__Container.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", list_of_set_up_PFCs := ");
field_list__of__set__up__PFCs.log();
TTCN_Logger::log_event_str(", target_BSS_to_Source_BSS_Transparent_Container := ");
field_target__BSS__to__Source__BSS__Transparent__Container.log();
TTCN_Logger::log_event_str(", target_to_Source_Transparent_Container := ");
field_target__to__Source__Transparent__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (list__of__set__up__PFCs().is_bound()) list__of__set__up__PFCs().set_implicit_omit();
if (!target__BSS__to__Source__BSS__Transparent__Container().is_bound()) target__BSS__to__Source__BSS__Transparent__Container() = OMIT_VALUE;
else target__BSS__to__Source__BSS__Transparent__Container().set_implicit_omit();
if (!target__to__Source__Transparent__Container().is_bound()) target__to__Source__Transparent__Container() = OMIT_VALUE;
else target__to__Source__Transparent__Container().set_implicit_omit();
}

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

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_list__of__set__up__PFCs.encode_text(text_buf);
field_target__BSS__to__Source__BSS__Transparent__Container.encode_text(text_buf);
field_target__to__Source__Transparent__Container.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_list__of__set__up__PFCs.decode_text(text_buf);
field_target__BSS__to__Source__BSS__Transparent__Container.decode_text(text_buf);
field_target__to__Source__Transparent__Container.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, List__of__set__up__PFCs__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_list__of__set__up__PFCs.RAW_decode(List__of__set__up__PFCs__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_target__BSS__to__Source__BSS__Transparent__Container = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Target__BSS__to__Source__BSS__Transparent__Container_descr_.raw->forceomit);
  decoded_field_length = field_target__BSS__to__Source__BSS__Transparent__Container().RAW_decode(Target__BSS__to__Source__BSS__Transparent__Container_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_target__BSS__to__Source__BSS__Transparent__Container = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__BSS__to__Source__BSS__Transparent__Container=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_target__to__Source__Transparent__Container = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Target__to__Source__Transparent__Container_descr_.raw->forceomit);
  decoded_field_length = field_target__to__Source__Transparent__Container().RAW_decode(Target__to__Source__Transparent__Container_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_target__to__Source__Transparent__Container = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__to__Source__Transparent__Container=OMIT_VALUE;
  if (field_bssgpPduType !=  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 PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, List__of__set__up__PFCs__BSSGP_descr_.raw);
  if (field_target__BSS__to__Source__BSS__Transparent__Container.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Target__BSS__to__Source__BSS__Transparent__Container_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_target__to__Source__Transparent__Container.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Target__to__Source__Transparent__Container_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_list__of__set__up__PFCs.RAW_encode(List__of__set__up__PFCs__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_target__BSS__to__Source__BSS__Transparent__Container.ispresent()) {
  encoded_length += field_target__BSS__to__Source__BSS__Transparent__Container().RAW_encode(Target__BSS__to__Source__BSS__Transparent__Container_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_target__to__Source__Transparent__Container.ispresent()) {
  encoded_length += field_target__to__Source__Transparent__Container().RAW_encode(Target__to__Source__Transparent__Container_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_bssgpPduType !=  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 PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
List__of__set__up__PFCs__BSSGP_template field_list__of__set__up__PFCs;
Target__BSS__to__Source__BSS__Transparent__Container_template field_target__BSS__to__Source__BSS__Transparent__Container;
Target__to__Source__Transparent__Container_template field_target__to__Source__Transparent__Container;
};

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_list__of__set__up__PFCs = ANY_VALUE;
single_value->field_target__BSS__to__Source__BSS__Transparent__Container = ANY_OR_OMIT;
single_value->field_target__to__Source__Transparent__Container = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::copy_value(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.list__of__set__up__PFCs().is_bound()) {
  single_value->field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
} else {
  single_value->field_list__of__set__up__PFCs.clean_up();
}
if (other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) {
  if (other_value.target__BSS__to__Source__BSS__Transparent__Container().ispresent()) single_value->field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container()();
  else single_value->field_target__BSS__to__Source__BSS__Transparent__Container = OMIT_VALUE;
} else {
  single_value->field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
}
if (other_value.target__to__Source__Transparent__Container().is_bound()) {
  if (other_value.target__to__Source__Transparent__Container().ispresent()) single_value->field_target__to__Source__Transparent__Container = other_value.target__to__Source__Transparent__Container()();
  else single_value->field_target__to__Source__Transparent__Container = OMIT_VALUE;
} else {
  single_value->field_target__to__Source__Transparent__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::copy_template(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.list__of__set__up__PFCs().get_selection()) {
single_value->field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
} else {
single_value->field_list__of__set__up__PFCs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__BSS__to__Source__BSS__Transparent__Container().get_selection()) {
single_value->field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container();
} else {
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__to__Source__Transparent__Container().get_selection()) {
single_value->field_target__to__Source__Transparent__Container = other_value.target__to__Source__Transparent__Container();
} else {
single_value->field_target__to__Source__Transparent__Container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template()
{
}

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

PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::match(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.list__of__set__up__PFCs().is_bound()) return FALSE;
if(!single_value->field_list__of__set__up__PFCs.match(other_value.list__of__set__up__PFCs(), legacy))return FALSE;
if(!other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) return FALSE;
if((other_value.target__BSS__to__Source__BSS__Transparent__Container().ispresent() ? !single_value->field_target__BSS__to__Source__BSS__Transparent__Container.match((const Target__BSS__to__Source__BSS__Transparent__Container&)other_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy) : !single_value->field_target__BSS__to__Source__BSS__Transparent__Container.match_omit(legacy)))return FALSE;
if(!other_value.target__to__Source__Transparent__Container().is_bound()) return FALSE;
if((other_value.target__to__Source__Transparent__Container().ispresent() ? !single_value->field_target__to__Source__Transparent__Container.match((const Target__to__Source__Transparent__Container&)other_value.target__to__Source__Transparent__Container(), legacy) : !single_value->field_target__to__Source__Transparent__Container.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_list__of__set__up__PFCs.is_bound()
 || (single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_omit() || single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_bound())
 || (single_value->field_target__to__Source__Transparent__Container.is_omit() || single_value->field_target__to__Source__Transparent__Container.is_bound());
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_list__of__set__up__PFCs.is_value()
 && (single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_omit() || single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_value())
 && (single_value->field_target__to__Source__Transparent__Container.is_omit() || single_value->field_target__to__Source__Transparent__Container.is_value());
}

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

PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_list__of__set__up__PFCs.is_bound()) {
ret_val.list__of__set__up__PFCs() = single_value->field_list__of__set__up__PFCs.valueof();
}
if (single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_omit()) ret_val.target__BSS__to__Source__BSS__Transparent__Container() = OMIT_VALUE;
else if (single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_bound()) {
ret_val.target__BSS__to__Source__BSS__Transparent__Container() = single_value->field_target__BSS__to__Source__BSS__Transparent__Container.valueof();
}
if (single_value->field_target__to__Source__Transparent__Container.is_omit()) ret_val.target__to__Source__Transparent__Container() = OMIT_VALUE;
else if (single_value->field_target__to__Source__Transparent__Container.is_bound()) {
ret_val.target__to__Source__Transparent__Container() = single_value->field_target__to__Source__Transparent__Container.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
return single_value->field_tLLI;
}

List__of__set__up__PFCs__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::list__of__set__up__PFCs()
{
set_specific();
return single_value->field_list__of__set__up__PFCs;
}

const List__of__set__up__PFCs__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::list__of__set__up__PFCs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field list_of_set_up_PFCs of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
return single_value->field_list__of__set__up__PFCs;
}

Target__BSS__to__Source__BSS__Transparent__Container_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::target__BSS__to__Source__BSS__Transparent__Container()
{
set_specific();
return single_value->field_target__BSS__to__Source__BSS__Transparent__Container;
}

const Target__BSS__to__Source__BSS__Transparent__Container_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::target__BSS__to__Source__BSS__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_BSS_to_Source_BSS_Transparent_Container of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
return single_value->field_target__BSS__to__Source__BSS__Transparent__Container;
}

Target__to__Source__Transparent__Container_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::target__to__Source__Transparent__Container()
{
set_specific();
return single_value->field_target__to__Source__Transparent__Container;
}

const Target__to__Source__Transparent__Container_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::target__to__Source__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_to_Source_Transparent_Container of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_ACK.");
return single_value->field_target__to__Source__Transparent__Container;
}

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

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", list_of_set_up_PFCs := ");
single_value->field_list__of__set__up__PFCs.log();
TTCN_Logger::log_event_str(", target_BSS_to_Source_BSS_Transparent_Container := ");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log();
TTCN_Logger::log_event_str(", target_to_Source_Transparent_Container := ");
single_value->field_target__to__Source__Transparent__Container.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK_template::log_match(const PDU__BSSGP__PS__HANDOVER__REQUIRED__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_list__of__set__up__PFCs.match(match_value.list__of__set__up__PFCs(), legacy)){
TTCN_Logger::log_logmatch_info(".list_of_set_up_PFCs");
single_value->field_list__of__set__up__PFCs.log_match(match_value.list__of__set__up__PFCs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.target__BSS__to__Source__BSS__Transparent__Container().ispresent()){
if(!single_value->field_target__BSS__to__Source__BSS__Transparent__Container.match(match_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".target_BSS_to_Source_BSS_Transparent_Container");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log_match(match_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__BSS__to__Source__BSS__Transparent__Container.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_BSS_to_Source_BSS_Transparent_Container := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.target__to__Source__Transparent__Container().ispresent()){
if(!single_value->field_target__to__Source__Transparent__Container.match(match_value.target__to__Source__Transparent__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".target_to_Source_Transparent_Container");
single_value->field_target__to__Source__Transparent__Container.log_match(match_value.target__to__Source__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__to__Source__Transparent__Container.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_to_Source_Transparent_Container := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__to__Source__Transparent__Container.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", list_of_set_up_PFCs := ");
single_value->field_list__of__set__up__PFCs.log_match(match_value.list__of__set__up__PFCs(), legacy);
TTCN_Logger::log_event_str(", target_BSS_to_Source_BSS_Transparent_Container := ");
if (match_value.target__BSS__to__Source__BSS__Transparent__Container().ispresent()) {
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log_match(match_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log();
if (single_value->field_target__BSS__to__Source__BSS__Transparent__Container.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", target_to_Source_Transparent_Container := ");
if (match_value.target__to__Source__Transparent__Container().ispresent()) {
single_value->field_target__to__Source__Transparent__Container.log_match(match_value.target__to__Source__Transparent__Container(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__to__Source__Transparent__Container.log();
if (single_value->field_target__to__Source__Transparent__Container.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK()
{
}

PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Cause__BSSGP& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_cause(par_cause)
{
}

PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_descr_; }
PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::operator=(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::operator==(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_cause.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_cause.is_value();
}
void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK");
  }
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

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

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

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

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
}
}
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::copy_value(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::copy_template(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template()
{
}

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

PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::match(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_cause.is_bound();
}

boolean PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_cause.is_value();
}

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

PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
return single_value->field_tLLI;
}

Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUIRED_NACK.");
return single_value->field_cause;
}

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

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK_template::log_match(const PDU__BSSGP__PS__HANDOVER__REQUIRED__NACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__PS__HANDOVER__REQUEST::PDU__BSSGP__PS__HANDOVER__REQUEST()
{
}

PDU__BSSGP__PS__HANDOVER__REQUEST::PDU__BSSGP__PS__HANDOVER__REQUEST(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const IMSI__BSSGP& par_iMSI,
    const Cause__BSSGP& par_cause,
    const OPTIONAL< Cell__Identifier >& par_source__Cell__Identifier,
    const OPTIONAL< RNC__Identifier__BSSGP >& par_source__RNC__Identifier,
    const OPTIONAL< Cell__Identifier >& par_target__Cell__Identifier,
    const Source__BSS__to__Target__BSS__Transparent__Container__BSSGP& par_source__BSS__to__Target__BSS__Transparent__Container__BSSGP,
    const PFCs__to__be__set__up__list& par_pFCs__to__be__set__up__list,
    const OPTIONAL< NAS__container__for__PS__Handover >& par_nAS__container__for__PS__Handover,
    const OPTIONAL< Service__UTRAN__CCO >& par_service__UTRAN__CCO,
    const OPTIONAL< Subscriber__Profile__ID__For__RAT__Priority >& par_subscriber__Profile__ID__For__RAT__Priority,
    const OPTIONAL< Reliable__Inter__RAT__Handover__Info >& par_reliable__Inter__RAT__Handover__Info)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_iMSI(par_iMSI),
  field_cause(par_cause),
  field_source__Cell__Identifier(par_source__Cell__Identifier),
  field_source__RNC__Identifier(par_source__RNC__Identifier),
  field_target__Cell__Identifier(par_target__Cell__Identifier),
  field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP(par_source__BSS__to__Target__BSS__Transparent__Container__BSSGP),
  field_pFCs__to__be__set__up__list(par_pFCs__to__be__set__up__list),
  field_nAS__container__for__PS__Handover(par_nAS__container__for__PS__Handover),
  field_service__UTRAN__CCO(par_service__UTRAN__CCO),
  field_subscriber__Profile__ID__For__RAT__Priority(par_subscriber__Profile__ID__For__RAT__Priority),
  field_reliable__Inter__RAT__Handover__Info(par_reliable__Inter__RAT__Handover__Info)
{
}

PDU__BSSGP__PS__HANDOVER__REQUEST::PDU__BSSGP__PS__HANDOVER__REQUEST(const PDU__BSSGP__PS__HANDOVER__REQUEST& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
else field_source__Cell__Identifier.clean_up();
if (other_value.source__RNC__Identifier().is_bound()) field_source__RNC__Identifier = other_value.source__RNC__Identifier();
else field_source__RNC__Identifier.clean_up();
if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
else field_target__Cell__Identifier.clean_up();
if (other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP().is_bound()) field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP = other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP();
else field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.clean_up();
if (other_value.pFCs__to__be__set__up__list().is_bound()) field_pFCs__to__be__set__up__list = other_value.pFCs__to__be__set__up__list();
else field_pFCs__to__be__set__up__list.clean_up();
if (other_value.nAS__container__for__PS__Handover().is_bound()) field_nAS__container__for__PS__Handover = other_value.nAS__container__for__PS__Handover();
else field_nAS__container__for__PS__Handover.clean_up();
if (other_value.service__UTRAN__CCO().is_bound()) field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
else field_service__UTRAN__CCO.clean_up();
if (other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority();
else field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
if (other_value.reliable__Inter__RAT__Handover__Info().is_bound()) field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info();
else field_reliable__Inter__RAT__Handover__Info.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_iMSI.clean_up();
field_cause.clean_up();
field_source__Cell__Identifier.clean_up();
field_source__RNC__Identifier.clean_up();
field_target__Cell__Identifier.clean_up();
field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.clean_up();
field_pFCs__to__be__set__up__list.clean_up();
field_nAS__container__for__PS__Handover.clean_up();
field_service__UTRAN__CCO.clean_up();
field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
field_reliable__Inter__RAT__Handover__Info.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__REQUEST::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__REQUEST_descr_; }
PDU__BSSGP__PS__HANDOVER__REQUEST& PDU__BSSGP__PS__HANDOVER__REQUEST::operator=(const PDU__BSSGP__PS__HANDOVER__REQUEST& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
  else field_source__Cell__Identifier.clean_up();
  if (other_value.source__RNC__Identifier().is_bound()) field_source__RNC__Identifier = other_value.source__RNC__Identifier();
  else field_source__RNC__Identifier.clean_up();
  if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
  else field_target__Cell__Identifier.clean_up();
  if (other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP().is_bound()) field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP = other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP();
  else field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.clean_up();
  if (other_value.pFCs__to__be__set__up__list().is_bound()) field_pFCs__to__be__set__up__list = other_value.pFCs__to__be__set__up__list();
  else field_pFCs__to__be__set__up__list.clean_up();
  if (other_value.nAS__container__for__PS__Handover().is_bound()) field_nAS__container__for__PS__Handover = other_value.nAS__container__for__PS__Handover();
  else field_nAS__container__for__PS__Handover.clean_up();
  if (other_value.service__UTRAN__CCO().is_bound()) field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
  else field_service__UTRAN__CCO.clean_up();
  if (other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority();
  else field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
  if (other_value.reliable__Inter__RAT__Handover__Info().is_bound()) field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info();
  else field_reliable__Inter__RAT__Handover__Info.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST::operator==(const PDU__BSSGP__PS__HANDOVER__REQUEST& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_iMSI==other_value.field_iMSI
  && field_cause==other_value.field_cause
  && field_source__Cell__Identifier==other_value.field_source__Cell__Identifier
  && field_source__RNC__Identifier==other_value.field_source__RNC__Identifier
  && field_target__Cell__Identifier==other_value.field_target__Cell__Identifier
  && field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP==other_value.field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP
  && field_pFCs__to__be__set__up__list==other_value.field_pFCs__to__be__set__up__list
  && field_nAS__container__for__PS__Handover==other_value.field_nAS__container__for__PS__Handover
  && field_service__UTRAN__CCO==other_value.field_service__UTRAN__CCO
  && field_subscriber__Profile__ID__For__RAT__Priority==other_value.field_subscriber__Profile__ID__For__RAT__Priority
  && field_reliable__Inter__RAT__Handover__Info==other_value.field_reliable__Inter__RAT__Handover__Info;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_iMSI.is_bound())
  || (field_cause.is_bound())
  || (OPTIONAL_OMIT == field_source__Cell__Identifier.get_selection() || field_source__Cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_source__RNC__Identifier.get_selection() || field_source__RNC__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_target__Cell__Identifier.get_selection() || field_target__Cell__Identifier.is_bound())
  || (field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.is_bound())
  || (field_pFCs__to__be__set__up__list.is_bound())
  || (OPTIONAL_OMIT == field_nAS__container__for__PS__Handover.get_selection() || field_nAS__container__for__PS__Handover.is_bound())
  || (OPTIONAL_OMIT == field_service__UTRAN__CCO.get_selection() || field_service__UTRAN__CCO.is_bound())
  || (OPTIONAL_OMIT == field_subscriber__Profile__ID__For__RAT__Priority.get_selection() || field_subscriber__Profile__ID__For__RAT__Priority.is_bound())
  || (OPTIONAL_OMIT == field_reliable__Inter__RAT__Handover__Info.get_selection() || field_reliable__Inter__RAT__Handover__Info.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__REQUEST::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_iMSI.is_value()
  && field_cause.is_value()
  && (OPTIONAL_OMIT == field_source__Cell__Identifier.get_selection() || field_source__Cell__Identifier.is_value())
  && (OPTIONAL_OMIT == field_source__RNC__Identifier.get_selection() || field_source__RNC__Identifier.is_value())
  && (OPTIONAL_OMIT == field_target__Cell__Identifier.get_selection() || field_target__Cell__Identifier.is_value())
  && field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.is_value()
  && field_pFCs__to__be__set__up__list.is_value()
  && (OPTIONAL_OMIT == field_nAS__container__for__PS__Handover.get_selection() || field_nAS__container__for__PS__Handover.is_value())
  && (OPTIONAL_OMIT == field_service__UTRAN__CCO.get_selection() || field_service__UTRAN__CCO.is_value())
  && (OPTIONAL_OMIT == field_subscriber__Profile__ID__For__RAT__Priority.get_selection() || field_subscriber__Profile__ID__For__RAT__Priority.is_value())
  && (OPTIONAL_OMIT == field_reliable__Inter__RAT__Handover__Info.get_selection() || field_reliable__Inter__RAT__Handover__Info.is_value());
}
int PDU__BSSGP__PS__HANDOVER__REQUEST::size_of() const
{
  int ret_val = 6;
  if (field_source__Cell__Identifier.ispresent()) ret_val++;
  if (field_source__RNC__Identifier.ispresent()) ret_val++;
  if (field_target__Cell__Identifier.ispresent()) ret_val++;
  if (field_nAS__container__for__PS__Handover.ispresent()) ret_val++;
  if (field_service__UTRAN__CCO.ispresent()) ret_val++;
  if (field_subscriber__Profile__ID__For__RAT__Priority.ispresent()) ret_val++;
  if (field_reliable__Inter__RAT__Handover__Info.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__REQUEST::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_RNC_Identifier := ");
field_source__RNC__Identifier.log();
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_BSS_to_Target_BSS_Transparent_Container_BSSGP := ");
field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.log();
TTCN_Logger::log_event_str(", pFCs_to_be_set_up_list := ");
field_pFCs__to__be__set__up__list.log();
TTCN_Logger::log_event_str(", nAS_container_for_PS_Handover := ");
field_nAS__container__for__PS__Handover.log();
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT_Priority := ");
field_subscriber__Profile__ID__For__RAT__Priority.log();
TTCN_Logger::log_event_str(", reliable_Inter_RAT_Handover_Info := ");
field_reliable__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__REQUEST::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!source__Cell__Identifier().is_bound()) source__Cell__Identifier() = OMIT_VALUE;
else source__Cell__Identifier().set_implicit_omit();
if (!source__RNC__Identifier().is_bound()) source__RNC__Identifier() = OMIT_VALUE;
else source__RNC__Identifier().set_implicit_omit();
if (!target__Cell__Identifier().is_bound()) target__Cell__Identifier() = OMIT_VALUE;
else target__Cell__Identifier().set_implicit_omit();
if (source__BSS__to__Target__BSS__Transparent__Container__BSSGP().is_bound()) source__BSS__to__Target__BSS__Transparent__Container__BSSGP().set_implicit_omit();
if (pFCs__to__be__set__up__list().is_bound()) pFCs__to__be__set__up__list().set_implicit_omit();
if (!nAS__container__for__PS__Handover().is_bound()) nAS__container__for__PS__Handover() = OMIT_VALUE;
else nAS__container__for__PS__Handover().set_implicit_omit();
if (!service__UTRAN__CCO().is_bound()) service__UTRAN__CCO() = OMIT_VALUE;
else service__UTRAN__CCO().set_implicit_omit();
if (!subscriber__Profile__ID__For__RAT__Priority().is_bound()) subscriber__Profile__ID__For__RAT__Priority() = OMIT_VALUE;
else subscriber__Profile__ID__For__RAT__Priority().set_implicit_omit();
if (!reliable__Inter__RAT__Handover__Info().is_bound()) reliable__Inter__RAT__Handover__Info() = OMIT_VALUE;
else reliable__Inter__RAT__Handover__Info().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST::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 (13<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) source__RNC__Identifier().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) target__Cell__Identifier().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) source__BSS__to__Target__BSS__Transparent__Container__BSSGP().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) pFCs__to__be__set__up__list().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) nAS__container__for__PS__Handover().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) service__UTRAN__CCO().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) subscriber__Profile__ID__For__RAT__Priority().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) reliable__Inter__RAT__Handover__Info().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_RNC_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__RNC__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_BSS_to_Target_BSS_Transparent_Container_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__BSS__to__Target__BSS__Transparent__Container__BSSGP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFCs_to_be_set_up_list")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFCs__to__be__set__up__list().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nAS_container_for_PS_Handover")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nAS__container__for__PS__Handover().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_UTRAN_CCO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__UTRAN__CCO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "subscriber_Profile_ID_For_RAT_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          subscriber__Profile__ID__For__RAT__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reliable_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reliable__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
  }
}

void PDU__BSSGP__PS__HANDOVER__REQUEST::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_source__Cell__Identifier.encode_text(text_buf);
field_source__RNC__Identifier.encode_text(text_buf);
field_target__Cell__Identifier.encode_text(text_buf);
field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.encode_text(text_buf);
field_pFCs__to__be__set__up__list.encode_text(text_buf);
field_nAS__container__for__PS__Handover.encode_text(text_buf);
field_service__UTRAN__CCO.encode_text(text_buf);
field_subscriber__Profile__ID__For__RAT__Priority.encode_text(text_buf);
field_reliable__Inter__RAT__Handover__Info.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__REQUEST::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_source__Cell__Identifier.decode_text(text_buf);
field_source__RNC__Identifier.decode_text(text_buf);
field_target__Cell__Identifier.decode_text(text_buf);
field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.decode_text(text_buf);
field_pFCs__to__be__set__up__list.decode_text(text_buf);
field_nAS__container__for__PS__Handover.decode_text(text_buf);
field_service__UTRAN__CCO.decode_text(text_buf);
field_subscriber__Profile__ID__For__RAT__Priority.decode_text(text_buf);
field_reliable__Inter__RAT__Handover__Info.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PS__HANDOVER__REQUEST::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_source__Cell__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_source__Cell__Identifier().RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_source__Cell__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_source__Cell__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_source__RNC__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, RNC__Identifier__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_source__RNC__Identifier().RAW_decode(RNC__Identifier__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_source__RNC__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_source__RNC__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_target__Cell__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_target__Cell__Identifier().RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_target__Cell__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__Cell__Identifier=OMIT_VALUE;
  RAW_Force_Omit field_7_force_omit(7, force_omit, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.RAW_decode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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, PFCs__to__be__set__up__list_descr_.raw->forceomit);
  decoded_field_length = field_pFCs__to__be__set__up__list.RAW_decode(PFCs__to__be__set__up__list_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_nAS__container__for__PS__Handover = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, NAS__container__for__PS__Handover_descr_.raw->forceomit);
  decoded_field_length = field_nAS__container__for__PS__Handover().RAW_decode(NAS__container__for__PS__Handover_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_nAS__container__for__PS__Handover = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_nAS__container__for__PS__Handover=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_service__UTRAN__CCO = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, Service__UTRAN__CCO_descr_.raw->forceomit);
  decoded_field_length = field_service__UTRAN__CCO().RAW_decode(Service__UTRAN__CCO_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_service__UTRAN__CCO = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_service__UTRAN__CCO=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_subscriber__Profile__ID__For__RAT__Priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, Subscriber__Profile__ID__For__RAT__Priority_descr_.raw->forceomit);
  decoded_field_length = field_subscriber__Profile__ID__For__RAT__Priority().RAW_decode(Subscriber__Profile__ID__For__RAT__Priority_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_subscriber__Profile__ID__For__RAT__Priority = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_subscriber__Profile__ID__For__RAT__Priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_reliable__Inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, Reliable__Inter__RAT__Handover__Info_descr_.raw->forceomit);
  decoded_field_length = field_reliable__Inter__RAT__Handover__Info().RAW_decode(Reliable__Inter__RAT__Handover__Info_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_reliable__Inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_reliable__Inter__RAT__Handover__Info=OMIT_VALUE;
  if (field_bssgpPduType !=  os_28) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PS__HANDOVER__REQUEST::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 = 13;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(13);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMSI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cause__BSSGP_descr_.raw);
  if (field_source__Cell__Identifier.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Cell__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_source__RNC__Identifier.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RNC__Identifier__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_target__Cell__Identifier.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Cell__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, PFCs__to__be__set__up__list_descr_.raw);
  if (field_nAS__container__for__PS__Handover.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, NAS__container__for__PS__Handover_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_service__UTRAN__CCO.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, Service__UTRAN__CCO_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_subscriber__Profile__ID__For__RAT__Priority.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, Subscriber__Profile__ID__For__RAT__Priority_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_reliable__Inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, Reliable__Inter__RAT__Handover__Info_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  if (field_source__Cell__Identifier.ispresent()) {
  encoded_length += field_source__Cell__Identifier().RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_source__RNC__Identifier.ispresent()) {
  encoded_length += field_source__RNC__Identifier().RAW_encode(RNC__Identifier__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_target__Cell__Identifier.ispresent()) {
  encoded_length += field_target__Cell__Identifier().RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[6]);
  }
  encoded_length += field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.RAW_encode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_pFCs__to__be__set__up__list.RAW_encode(PFCs__to__be__set__up__list_descr_, *myleaf.body.node.nodes[8]);
  if (field_nAS__container__for__PS__Handover.ispresent()) {
  encoded_length += field_nAS__container__for__PS__Handover().RAW_encode(NAS__container__for__PS__Handover_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_service__UTRAN__CCO.ispresent()) {
  encoded_length += field_service__UTRAN__CCO().RAW_encode(Service__UTRAN__CCO_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_subscriber__Profile__ID__For__RAT__Priority.ispresent()) {
  encoded_length += field_subscriber__Profile__ID__For__RAT__Priority().RAW_encode(Subscriber__Profile__ID__For__RAT__Priority_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_reliable__Inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_reliable__Inter__RAT__Handover__Info().RAW_encode(Reliable__Inter__RAT__Handover__Info_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_bssgpPduType !=  os_28) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_28.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PS__HANDOVER__REQUEST_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
IMSI__BSSGP_template field_iMSI;
Cause__BSSGP_template field_cause;
Cell__Identifier_template field_source__Cell__Identifier;
RNC__Identifier__BSSGP_template field_source__RNC__Identifier;
Cell__Identifier_template field_target__Cell__Identifier;
Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP;
PFCs__to__be__set__up__list_template field_pFCs__to__be__set__up__list;
NAS__container__for__PS__Handover_template field_nAS__container__for__PS__Handover;
Service__UTRAN__CCO_template field_service__UTRAN__CCO;
Subscriber__Profile__ID__For__RAT__Priority_template field_subscriber__Profile__ID__For__RAT__Priority;
Reliable__Inter__RAT__Handover__Info_template field_reliable__Inter__RAT__Handover__Info;
};

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_source__Cell__Identifier = ANY_OR_OMIT;
single_value->field_source__RNC__Identifier = ANY_OR_OMIT;
single_value->field_target__Cell__Identifier = ANY_OR_OMIT;
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP = ANY_VALUE;
single_value->field_pFCs__to__be__set__up__list = ANY_VALUE;
single_value->field_nAS__container__for__PS__Handover = ANY_OR_OMIT;
single_value->field_service__UTRAN__CCO = ANY_OR_OMIT;
single_value->field_subscriber__Profile__ID__For__RAT__Priority = ANY_OR_OMIT;
single_value->field_reliable__Inter__RAT__Handover__Info = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::copy_value(const PDU__BSSGP__PS__HANDOVER__REQUEST& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.source__Cell__Identifier().is_bound()) {
  if (other_value.source__Cell__Identifier().ispresent()) single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier()();
  else single_value->field_source__Cell__Identifier = OMIT_VALUE;
} else {
  single_value->field_source__Cell__Identifier.clean_up();
}
if (other_value.source__RNC__Identifier().is_bound()) {
  if (other_value.source__RNC__Identifier().ispresent()) single_value->field_source__RNC__Identifier = other_value.source__RNC__Identifier()();
  else single_value->field_source__RNC__Identifier = OMIT_VALUE;
} else {
  single_value->field_source__RNC__Identifier.clean_up();
}
if (other_value.target__Cell__Identifier().is_bound()) {
  if (other_value.target__Cell__Identifier().ispresent()) single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier()();
  else single_value->field_target__Cell__Identifier = OMIT_VALUE;
} else {
  single_value->field_target__Cell__Identifier.clean_up();
}
if (other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP().is_bound()) {
  single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP = other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP();
} else {
  single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.clean_up();
}
if (other_value.pFCs__to__be__set__up__list().is_bound()) {
  single_value->field_pFCs__to__be__set__up__list = other_value.pFCs__to__be__set__up__list();
} else {
  single_value->field_pFCs__to__be__set__up__list.clean_up();
}
if (other_value.nAS__container__for__PS__Handover().is_bound()) {
  if (other_value.nAS__container__for__PS__Handover().ispresent()) single_value->field_nAS__container__for__PS__Handover = other_value.nAS__container__for__PS__Handover()();
  else single_value->field_nAS__container__for__PS__Handover = OMIT_VALUE;
} else {
  single_value->field_nAS__container__for__PS__Handover.clean_up();
}
if (other_value.service__UTRAN__CCO().is_bound()) {
  if (other_value.service__UTRAN__CCO().ispresent()) single_value->field_service__UTRAN__CCO = other_value.service__UTRAN__CCO()();
  else single_value->field_service__UTRAN__CCO = OMIT_VALUE;
} else {
  single_value->field_service__UTRAN__CCO.clean_up();
}
if (other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) {
  if (other_value.subscriber__Profile__ID__For__RAT__Priority().ispresent()) single_value->field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority()();
  else single_value->field_subscriber__Profile__ID__For__RAT__Priority = OMIT_VALUE;
} else {
  single_value->field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
}
if (other_value.reliable__Inter__RAT__Handover__Info().is_bound()) {
  if (other_value.reliable__Inter__RAT__Handover__Info().ispresent()) single_value->field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info()();
  else single_value->field_reliable__Inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_reliable__Inter__RAT__Handover__Info.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::copy_template(const PDU__BSSGP__PS__HANDOVER__REQUEST_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__Cell__Identifier().get_selection()) {
single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
single_value->field_source__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__RNC__Identifier().get_selection()) {
single_value->field_source__RNC__Identifier = other_value.source__RNC__Identifier();
} else {
single_value->field_source__RNC__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__Cell__Identifier().get_selection()) {
single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier();
} else {
single_value->field_target__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP().get_selection()) {
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP = other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP();
} else {
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFCs__to__be__set__up__list().get_selection()) {
single_value->field_pFCs__to__be__set__up__list = other_value.pFCs__to__be__set__up__list();
} else {
single_value->field_pFCs__to__be__set__up__list.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nAS__container__for__PS__Handover().get_selection()) {
single_value->field_nAS__container__for__PS__Handover = other_value.nAS__container__for__PS__Handover();
} else {
single_value->field_nAS__container__for__PS__Handover.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__UTRAN__CCO().get_selection()) {
single_value->field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
} else {
single_value->field_service__UTRAN__CCO.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.subscriber__Profile__ID__For__RAT__Priority().get_selection()) {
single_value->field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority();
} else {
single_value->field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reliable__Inter__RAT__Handover__Info().get_selection()) {
single_value->field_reliable__Inter__RAT__Handover__Info = other_value.reliable__Inter__RAT__Handover__Info();
} else {
single_value->field_reliable__Inter__RAT__Handover__Info.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUEST_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__REQUEST_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__REQUEST_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__REQUEST_template::PDU__BSSGP__PS__HANDOVER__REQUEST_template()
{
}

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

PDU__BSSGP__PS__HANDOVER__REQUEST_template::PDU__BSSGP__PS__HANDOVER__REQUEST_template(const PDU__BSSGP__PS__HANDOVER__REQUEST& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__PS__HANDOVER__REQUEST_template::match(const PDU__BSSGP__PS__HANDOVER__REQUEST& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.source__Cell__Identifier().is_bound()) return FALSE;
if((other_value.source__Cell__Identifier().ispresent() ? !single_value->field_source__Cell__Identifier.match((const Cell__Identifier&)other_value.source__Cell__Identifier(), legacy) : !single_value->field_source__Cell__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.source__RNC__Identifier().is_bound()) return FALSE;
if((other_value.source__RNC__Identifier().ispresent() ? !single_value->field_source__RNC__Identifier.match((const RNC__Identifier__BSSGP&)other_value.source__RNC__Identifier(), legacy) : !single_value->field_source__RNC__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.target__Cell__Identifier().is_bound()) return FALSE;
if((other_value.target__Cell__Identifier().ispresent() ? !single_value->field_target__Cell__Identifier.match((const Cell__Identifier&)other_value.target__Cell__Identifier(), legacy) : !single_value->field_target__Cell__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP().is_bound()) return FALSE;
if(!single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.match(other_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP(), legacy))return FALSE;
if(!other_value.pFCs__to__be__set__up__list().is_bound()) return FALSE;
if(!single_value->field_pFCs__to__be__set__up__list.match(other_value.pFCs__to__be__set__up__list(), legacy))return FALSE;
if(!other_value.nAS__container__for__PS__Handover().is_bound()) return FALSE;
if((other_value.nAS__container__for__PS__Handover().ispresent() ? !single_value->field_nAS__container__for__PS__Handover.match((const NAS__container__for__PS__Handover&)other_value.nAS__container__for__PS__Handover(), legacy) : !single_value->field_nAS__container__for__PS__Handover.match_omit(legacy)))return FALSE;
if(!other_value.service__UTRAN__CCO().is_bound()) return FALSE;
if((other_value.service__UTRAN__CCO().ispresent() ? !single_value->field_service__UTRAN__CCO.match((const Service__UTRAN__CCO&)other_value.service__UTRAN__CCO(), legacy) : !single_value->field_service__UTRAN__CCO.match_omit(legacy)))return FALSE;
if(!other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) return FALSE;
if((other_value.subscriber__Profile__ID__For__RAT__Priority().ispresent() ? !single_value->field_subscriber__Profile__ID__For__RAT__Priority.match((const Subscriber__Profile__ID__For__RAT__Priority&)other_value.subscriber__Profile__ID__For__RAT__Priority(), legacy) : !single_value->field_subscriber__Profile__ID__For__RAT__Priority.match_omit(legacy)))return FALSE;
if(!other_value.reliable__Inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.reliable__Inter__RAT__Handover__Info().ispresent() ? !single_value->field_reliable__Inter__RAT__Handover__Info.match((const Reliable__Inter__RAT__Handover__Info&)other_value.reliable__Inter__RAT__Handover__Info(), legacy) : !single_value->field_reliable__Inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_iMSI.is_bound()
 || single_value->field_cause.is_bound()
 || (single_value->field_source__Cell__Identifier.is_omit() || single_value->field_source__Cell__Identifier.is_bound())
 || (single_value->field_source__RNC__Identifier.is_omit() || single_value->field_source__RNC__Identifier.is_bound())
 || (single_value->field_target__Cell__Identifier.is_omit() || single_value->field_target__Cell__Identifier.is_bound())
 || single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.is_bound()
 || single_value->field_pFCs__to__be__set__up__list.is_bound()
 || (single_value->field_nAS__container__for__PS__Handover.is_omit() || single_value->field_nAS__container__for__PS__Handover.is_bound())
 || (single_value->field_service__UTRAN__CCO.is_omit() || single_value->field_service__UTRAN__CCO.is_bound())
 || (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_omit() || single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_bound())
 || (single_value->field_reliable__Inter__RAT__Handover__Info.is_omit() || single_value->field_reliable__Inter__RAT__Handover__Info.is_bound());
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_iMSI.is_value()
 && single_value->field_cause.is_value()
 && (single_value->field_source__Cell__Identifier.is_omit() || single_value->field_source__Cell__Identifier.is_value())
 && (single_value->field_source__RNC__Identifier.is_omit() || single_value->field_source__RNC__Identifier.is_value())
 && (single_value->field_target__Cell__Identifier.is_omit() || single_value->field_target__Cell__Identifier.is_value())
 && single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.is_value()
 && single_value->field_pFCs__to__be__set__up__list.is_value()
 && (single_value->field_nAS__container__for__PS__Handover.is_omit() || single_value->field_nAS__container__for__PS__Handover.is_value())
 && (single_value->field_service__UTRAN__CCO.is_omit() || single_value->field_service__UTRAN__CCO.is_value())
 && (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_omit() || single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_value())
 && (single_value->field_reliable__Inter__RAT__Handover__Info.is_omit() || single_value->field_reliable__Inter__RAT__Handover__Info.is_value());
}

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

PDU__BSSGP__PS__HANDOVER__REQUEST PDU__BSSGP__PS__HANDOVER__REQUEST_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
PDU__BSSGP__PS__HANDOVER__REQUEST ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_source__Cell__Identifier.is_omit()) ret_val.source__Cell__Identifier() = OMIT_VALUE;
else if (single_value->field_source__Cell__Identifier.is_bound()) {
ret_val.source__Cell__Identifier() = single_value->field_source__Cell__Identifier.valueof();
}
if (single_value->field_source__RNC__Identifier.is_omit()) ret_val.source__RNC__Identifier() = OMIT_VALUE;
else if (single_value->field_source__RNC__Identifier.is_bound()) {
ret_val.source__RNC__Identifier() = single_value->field_source__RNC__Identifier.valueof();
}
if (single_value->field_target__Cell__Identifier.is_omit()) ret_val.target__Cell__Identifier() = OMIT_VALUE;
else if (single_value->field_target__Cell__Identifier.is_bound()) {
ret_val.target__Cell__Identifier() = single_value->field_target__Cell__Identifier.valueof();
}
if (single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.is_bound()) {
ret_val.source__BSS__to__Target__BSS__Transparent__Container__BSSGP() = single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.valueof();
}
if (single_value->field_pFCs__to__be__set__up__list.is_bound()) {
ret_val.pFCs__to__be__set__up__list() = single_value->field_pFCs__to__be__set__up__list.valueof();
}
if (single_value->field_nAS__container__for__PS__Handover.is_omit()) ret_val.nAS__container__for__PS__Handover() = OMIT_VALUE;
else if (single_value->field_nAS__container__for__PS__Handover.is_bound()) {
ret_val.nAS__container__for__PS__Handover() = single_value->field_nAS__container__for__PS__Handover.valueof();
}
if (single_value->field_service__UTRAN__CCO.is_omit()) ret_val.service__UTRAN__CCO() = OMIT_VALUE;
else if (single_value->field_service__UTRAN__CCO.is_bound()) {
ret_val.service__UTRAN__CCO() = single_value->field_service__UTRAN__CCO.valueof();
}
if (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_omit()) ret_val.subscriber__Profile__ID__For__RAT__Priority() = OMIT_VALUE;
else if (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_bound()) {
ret_val.subscriber__Profile__ID__For__RAT__Priority() = single_value->field_subscriber__Profile__ID__For__RAT__Priority.valueof();
}
if (single_value->field_reliable__Inter__RAT__Handover__Info.is_omit()) ret_val.reliable__Inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_reliable__Inter__RAT__Handover__Info.is_bound()) {
ret_val.reliable__Inter__RAT__Handover__Info() = single_value->field_reliable__Inter__RAT__Handover__Info.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_tLLI;
}

IMSI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_iMSI;
}

Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_cause;
}

Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::source__Cell__Identifier()
{
set_specific();
return single_value->field_source__Cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::source__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_source__Cell__Identifier;
}

RNC__Identifier__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::source__RNC__Identifier()
{
set_specific();
return single_value->field_source__RNC__Identifier;
}

const RNC__Identifier__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::source__RNC__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_RNC_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_source__RNC__Identifier;
}

Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::target__Cell__Identifier()
{
set_specific();
return single_value->field_target__Cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::target__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_target__Cell__Identifier;
}

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::source__BSS__to__Target__BSS__Transparent__Container__BSSGP()
{
set_specific();
return single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP;
}

const Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::source__BSS__to__Target__BSS__Transparent__Container__BSSGP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_BSS_to_Target_BSS_Transparent_Container_BSSGP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP;
}

PFCs__to__be__set__up__list_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::pFCs__to__be__set__up__list()
{
set_specific();
return single_value->field_pFCs__to__be__set__up__list;
}

const PFCs__to__be__set__up__list_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::pFCs__to__be__set__up__list() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFCs_to_be_set_up_list of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_pFCs__to__be__set__up__list;
}

NAS__container__for__PS__Handover_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::nAS__container__for__PS__Handover()
{
set_specific();
return single_value->field_nAS__container__for__PS__Handover;
}

const NAS__container__for__PS__Handover_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::nAS__container__for__PS__Handover() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nAS_container_for_PS_Handover of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_nAS__container__for__PS__Handover;
}

Service__UTRAN__CCO_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::service__UTRAN__CCO()
{
set_specific();
return single_value->field_service__UTRAN__CCO;
}

const Service__UTRAN__CCO_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::service__UTRAN__CCO() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_UTRAN_CCO of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_service__UTRAN__CCO;
}

Subscriber__Profile__ID__For__RAT__Priority_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::subscriber__Profile__ID__For__RAT__Priority()
{
set_specific();
return single_value->field_subscriber__Profile__ID__For__RAT__Priority;
}

const Subscriber__Profile__ID__For__RAT__Priority_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::subscriber__Profile__ID__For__RAT__Priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field subscriber_Profile_ID_For_RAT_Priority of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_subscriber__Profile__ID__For__RAT__Priority;
}

Reliable__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::reliable__Inter__RAT__Handover__Info()
{
set_specific();
return single_value->field_reliable__Inter__RAT__Handover__Info;
}

const Reliable__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__REQUEST_template::reliable__Inter__RAT__Handover__Info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reliable_Inter_RAT_Handover_Info of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
return single_value->field_reliable__Inter__RAT__Handover__Info;
}

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

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_RNC_Identifier := ");
single_value->field_source__RNC__Identifier.log();
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
single_value->field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_BSS_to_Target_BSS_Transparent_Container_BSSGP := ");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.log();
TTCN_Logger::log_event_str(", pFCs_to_be_set_up_list := ");
single_value->field_pFCs__to__be__set__up__list.log();
TTCN_Logger::log_event_str(", nAS_container_for_PS_Handover := ");
single_value->field_nAS__container__for__PS__Handover.log();
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
single_value->field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT_Priority := ");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log();
TTCN_Logger::log_event_str(", reliable_Inter_RAT_Handover_Info := ");
single_value->field_reliable__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::log_match(const PDU__BSSGP__PS__HANDOVER__REQUEST& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.source__Cell__Identifier().ispresent()){
if(!single_value->field_source__Cell__Identifier.match(match_value.source__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".source_Cell_Identifier");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_source__Cell__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".source_Cell_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.source__RNC__Identifier().ispresent()){
if(!single_value->field_source__RNC__Identifier.match(match_value.source__RNC__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".source_RNC_Identifier");
single_value->field_source__RNC__Identifier.log_match(match_value.source__RNC__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_source__RNC__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".source_RNC_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_source__RNC__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.target__Cell__Identifier().ispresent()){
if(!single_value->field_target__Cell__Identifier.match(match_value.target__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_Cell_Identifier");
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__Cell__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_Cell_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.match(match_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP(), legacy)){
TTCN_Logger::log_logmatch_info(".source_BSS_to_Target_BSS_Transparent_Container_BSSGP");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.log_match(match_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFCs__to__be__set__up__list.match(match_value.pFCs__to__be__set__up__list(), legacy)){
TTCN_Logger::log_logmatch_info(".pFCs_to_be_set_up_list");
single_value->field_pFCs__to__be__set__up__list.log_match(match_value.pFCs__to__be__set__up__list(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.nAS__container__for__PS__Handover().ispresent()){
if(!single_value->field_nAS__container__for__PS__Handover.match(match_value.nAS__container__for__PS__Handover(), legacy)){
TTCN_Logger::log_logmatch_info(".nAS_container_for_PS_Handover");
single_value->field_nAS__container__for__PS__Handover.log_match(match_value.nAS__container__for__PS__Handover(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nAS__container__for__PS__Handover.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nAS_container_for_PS_Handover := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nAS__container__for__PS__Handover.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.service__UTRAN__CCO().ispresent()){
if(!single_value->field_service__UTRAN__CCO.match(match_value.service__UTRAN__CCO(), legacy)){
TTCN_Logger::log_logmatch_info(".service_UTRAN_CCO");
single_value->field_service__UTRAN__CCO.log_match(match_value.service__UTRAN__CCO(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_service__UTRAN__CCO.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".service_UTRAN_CCO := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.subscriber__Profile__ID__For__RAT__Priority().ispresent()){
if(!single_value->field_subscriber__Profile__ID__For__RAT__Priority.match(match_value.subscriber__Profile__ID__For__RAT__Priority(), legacy)){
TTCN_Logger::log_logmatch_info(".subscriber_Profile_ID_For_RAT_Priority");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log_match(match_value.subscriber__Profile__ID__For__RAT__Priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_subscriber__Profile__ID__For__RAT__Priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".subscriber_Profile_ID_For_RAT_Priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.reliable__Inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_reliable__Inter__RAT__Handover__Info.match(match_value.reliable__Inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".reliable_Inter_RAT_Handover_Info");
single_value->field_reliable__Inter__RAT__Handover__Info.log_match(match_value.reliable__Inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_reliable__Inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".reliable_Inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_reliable__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
if (match_value.source__Cell__Identifier().ispresent()) {
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_source__Cell__Identifier.log();
if (single_value->field_source__Cell__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", source_RNC_Identifier := ");
if (match_value.source__RNC__Identifier().ispresent()) {
single_value->field_source__RNC__Identifier.log_match(match_value.source__RNC__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_source__RNC__Identifier.log();
if (single_value->field_source__RNC__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
if (match_value.target__Cell__Identifier().ispresent()) {
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__Cell__Identifier.log();
if (single_value->field_target__Cell__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", source_BSS_to_Target_BSS_Transparent_Container_BSSGP := ");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.log_match(match_value.source__BSS__to__Target__BSS__Transparent__Container__BSSGP(), legacy);
TTCN_Logger::log_event_str(", pFCs_to_be_set_up_list := ");
single_value->field_pFCs__to__be__set__up__list.log_match(match_value.pFCs__to__be__set__up__list(), legacy);
TTCN_Logger::log_event_str(", nAS_container_for_PS_Handover := ");
if (match_value.nAS__container__for__PS__Handover().ispresent()) {
single_value->field_nAS__container__for__PS__Handover.log_match(match_value.nAS__container__for__PS__Handover(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nAS__container__for__PS__Handover.log();
if (single_value->field_nAS__container__for__PS__Handover.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
if (match_value.service__UTRAN__CCO().ispresent()) {
single_value->field_service__UTRAN__CCO.log_match(match_value.service__UTRAN__CCO(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_service__UTRAN__CCO.log();
if (single_value->field_service__UTRAN__CCO.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT_Priority := ");
if (match_value.subscriber__Profile__ID__For__RAT__Priority().ispresent()) {
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log_match(match_value.subscriber__Profile__ID__For__RAT__Priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log();
if (single_value->field_subscriber__Profile__ID__For__RAT__Priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", reliable_Inter_RAT_Handover_Info := ");
if (match_value.reliable__Inter__RAT__Handover__Info().ispresent()) {
single_value->field_reliable__Inter__RAT__Handover__Info.log_match(match_value.reliable__Inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_reliable__Inter__RAT__Handover__Info.log();
if (single_value->field_reliable__Inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_source__Cell__Identifier.encode_text(text_buf);
single_value->field_source__RNC__Identifier.encode_text(text_buf);
single_value->field_target__Cell__Identifier.encode_text(text_buf);
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.encode_text(text_buf);
single_value->field_pFCs__to__be__set__up__list.encode_text(text_buf);
single_value->field_nAS__container__for__PS__Handover.encode_text(text_buf);
single_value->field_service__UTRAN__CCO.encode_text(text_buf);
single_value->field_subscriber__Profile__ID__For__RAT__Priority.encode_text(text_buf);
single_value->field_reliable__Inter__RAT__Handover__Info.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_source__Cell__Identifier.decode_text(text_buf);
single_value->field_source__RNC__Identifier.decode_text(text_buf);
single_value->field_target__Cell__Identifier.decode_text(text_buf);
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.decode_text(text_buf);
single_value->field_pFCs__to__be__set__up__list.decode_text(text_buf);
single_value->field_nAS__container__for__PS__Handover.decode_text(text_buf);
single_value->field_service__UTRAN__CCO.decode_text(text_buf);
single_value->field_subscriber__Profile__ID__For__RAT__Priority.decode_text(text_buf);
single_value->field_reliable__Inter__RAT__Handover__Info.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUEST_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST.");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PS__HANDOVER__REQUEST_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 (13<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) source__RNC__Identifier().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) target__Cell__Identifier().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) source__BSS__to__Target__BSS__Transparent__Container__BSSGP().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) pFCs__to__be__set__up__list().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) nAS__container__for__PS__Handover().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) service__UTRAN__CCO().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) subscriber__Profile__ID__For__RAT__Priority().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) reliable__Inter__RAT__Handover__Info().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_RNC_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__RNC__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_BSS_to_Target_BSS_Transparent_Container_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__BSS__to__Target__BSS__Transparent__Container__BSSGP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFCs_to_be_set_up_list")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFCs__to__be__set__up__list().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nAS_container_for_PS_Handover")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nAS__container__for__PS__Handover().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_UTRAN_CCO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__UTRAN__CCO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "subscriber_Profile_ID_For_RAT_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          subscriber__Profile__ID__For__RAT__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reliable_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reliable__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PS__HANDOVER__REQUEST_template* precondition = new PDU__BSSGP__PS__HANDOVER__REQUEST_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PS__HANDOVER__REQUEST_template* implied_template = new PDU__BSSGP__PS__HANDOVER__REQUEST_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PS__HANDOVER__REQUEST_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_source__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_source__RNC__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_target__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__BSSGP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_pFCs__to__be__set__up__list.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_nAS__container__for__PS__Handover.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_service__UTRAN__CCO.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
single_value->field_reliable__Inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST");
}

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

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

PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::PDU__BSSGP__PS__HANDOVER__REQUEST__ACK()
{
}

PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::PDU__BSSGP__PS__HANDOVER__REQUEST__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const List__of__set__up__PFCs__BSSGP& par_list__of__set__up__PFCs,
    const Target__BSS__to__Source__BSS__Transparent__Container& par_target__BSS__to__Source__BSS__Transparent__Container)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_list__of__set__up__PFCs(par_list__of__set__up__PFCs),
  field_target__BSS__to__Source__BSS__Transparent__Container(par_target__BSS__to__Source__BSS__Transparent__Container)
{
}

PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::PDU__BSSGP__PS__HANDOVER__REQUEST__ACK(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.list__of__set__up__PFCs().is_bound()) field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
else field_list__of__set__up__PFCs.clean_up();
if (other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container();
else field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_list__of__set__up__PFCs.clean_up();
field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_descr_; }
PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::operator=(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.list__of__set__up__PFCs().is_bound()) field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
  else field_list__of__set__up__PFCs.clean_up();
  if (other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container();
  else field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::operator==(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_list__of__set__up__PFCs==other_value.field_list__of__set__up__PFCs
  && field_target__BSS__to__Source__BSS__Transparent__Container==other_value.field_target__BSS__to__Source__BSS__Transparent__Container;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_list__of__set__up__PFCs.is_bound())
  || (field_target__BSS__to__Source__BSS__Transparent__Container.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_list__of__set__up__PFCs.is_value()
  && field_target__BSS__to__Source__BSS__Transparent__Container.is_value();
}
void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", list_of_set_up_PFCs := ");
field_list__of__set__up__PFCs.log();
TTCN_Logger::log_event_str(", target_BSS_to_Source_BSS_Transparent_Container := ");
field_target__BSS__to__Source__BSS__Transparent__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (list__of__set__up__PFCs().is_bound()) list__of__set__up__PFCs().set_implicit_omit();
if (target__BSS__to__Source__BSS__Transparent__Container().is_bound()) target__BSS__to__Source__BSS__Transparent__Container().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) list__of__set__up__PFCs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) target__BSS__to__Source__BSS__Transparent__Container().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "list_of_set_up_PFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          list__of__set__up__PFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_BSS_to_Source_BSS_Transparent_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__BSS__to__Source__BSS__Transparent__Container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK");
  }
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_list__of__set__up__PFCs.encode_text(text_buf);
field_target__BSS__to__Source__BSS__Transparent__Container.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_list__of__set__up__PFCs.decode_text(text_buf);
field_target__BSS__to__Source__BSS__Transparent__Container.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, List__of__set__up__PFCs__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_list__of__set__up__PFCs.RAW_decode(List__of__set__up__PFCs__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, Target__BSS__to__Source__BSS__Transparent__Container_descr_.raw->forceomit);
  decoded_field_length = field_target__BSS__to__Source__BSS__Transparent__Container.RAW_decode(Target__BSS__to__Source__BSS__Transparent__Container_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_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 PDU__BSSGP__PS__HANDOVER__REQUEST__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, List__of__set__up__PFCs__BSSGP_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Target__BSS__to__Source__BSS__Transparent__Container_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_list__of__set__up__PFCs.RAW_encode(List__of__set__up__PFCs__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_target__BSS__to__Source__BSS__Transparent__Container.RAW_encode(Target__BSS__to__Source__BSS__Transparent__Container_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  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 PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
List__of__set__up__PFCs__BSSGP_template field_list__of__set__up__PFCs;
Target__BSS__to__Source__BSS__Transparent__Container_template field_target__BSS__to__Source__BSS__Transparent__Container;
};

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_list__of__set__up__PFCs = ANY_VALUE;
single_value->field_target__BSS__to__Source__BSS__Transparent__Container = ANY_VALUE;
}
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::copy_value(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.list__of__set__up__PFCs().is_bound()) {
  single_value->field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
} else {
  single_value->field_list__of__set__up__PFCs.clean_up();
}
if (other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) {
  single_value->field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container();
} else {
  single_value->field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::copy_template(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.list__of__set__up__PFCs().get_selection()) {
single_value->field_list__of__set__up__PFCs = other_value.list__of__set__up__PFCs();
} else {
single_value->field_list__of__set__up__PFCs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__BSS__to__Source__BSS__Transparent__Container().get_selection()) {
single_value->field_target__BSS__to__Source__BSS__Transparent__Container = other_value.target__BSS__to__Source__BSS__Transparent__Container();
} else {
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template()
{
}

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

PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::match(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.list__of__set__up__PFCs().is_bound()) return FALSE;
if(!single_value->field_list__of__set__up__PFCs.match(other_value.list__of__set__up__PFCs(), legacy))return FALSE;
if(!other_value.target__BSS__to__Source__BSS__Transparent__Container().is_bound()) return FALSE;
if(!single_value->field_target__BSS__to__Source__BSS__Transparent__Container.match(other_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_list__of__set__up__PFCs.is_bound()
 || single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_bound();
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_list__of__set__up__PFCs.is_value()
 && single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_value();
}

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

PDU__BSSGP__PS__HANDOVER__REQUEST__ACK PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
PDU__BSSGP__PS__HANDOVER__REQUEST__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_list__of__set__up__PFCs.is_bound()) {
ret_val.list__of__set__up__PFCs() = single_value->field_list__of__set__up__PFCs.valueof();
}
if (single_value->field_target__BSS__to__Source__BSS__Transparent__Container.is_bound()) {
ret_val.target__BSS__to__Source__BSS__Transparent__Container() = single_value->field_target__BSS__to__Source__BSS__Transparent__Container.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
return single_value->field_tLLI;
}

List__of__set__up__PFCs__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::list__of__set__up__PFCs()
{
set_specific();
return single_value->field_list__of__set__up__PFCs;
}

const List__of__set__up__PFCs__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::list__of__set__up__PFCs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field list_of_set_up_PFCs of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
return single_value->field_list__of__set__up__PFCs;
}

Target__BSS__to__Source__BSS__Transparent__Container_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::target__BSS__to__Source__BSS__Transparent__Container()
{
set_specific();
return single_value->field_target__BSS__to__Source__BSS__Transparent__Container;
}

const Target__BSS__to__Source__BSS__Transparent__Container_template& PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::target__BSS__to__Source__BSS__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_BSS_to_Source_BSS_Transparent_Container of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_ACK.");
return single_value->field_target__BSS__to__Source__BSS__Transparent__Container;
}

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

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", list_of_set_up_PFCs := ");
single_value->field_list__of__set__up__PFCs.log();
TTCN_Logger::log_event_str(", target_BSS_to_Source_BSS_Transparent_Container := ");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__ACK_template::log_match(const PDU__BSSGP__PS__HANDOVER__REQUEST__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_list__of__set__up__PFCs.match(match_value.list__of__set__up__PFCs(), legacy)){
TTCN_Logger::log_logmatch_info(".list_of_set_up_PFCs");
single_value->field_list__of__set__up__PFCs.log_match(match_value.list__of__set__up__PFCs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_target__BSS__to__Source__BSS__Transparent__Container.match(match_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".target_BSS_to_Source_BSS_Transparent_Container");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log_match(match_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", list_of_set_up_PFCs := ");
single_value->field_list__of__set__up__PFCs.log_match(match_value.list__of__set__up__PFCs(), legacy);
TTCN_Logger::log_event_str(", target_BSS_to_Source_BSS_Transparent_Container := ");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container.log_match(match_value.target__BSS__to__Source__BSS__Transparent__Container(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

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

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

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

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

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::PDU__BSSGP__PS__HANDOVER__REQUEST__NACK()
{
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::PDU__BSSGP__PS__HANDOVER__REQUEST__NACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Cause__BSSGP& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_cause(par_cause)
{
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::PDU__BSSGP__PS__HANDOVER__REQUEST__NACK(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_descr_; }
PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::operator=(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::operator==(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_cause.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_cause.is_value();
}
void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK");
  }
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_111) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PS__HANDOVER__REQUEST__NACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Cause__BSSGP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_111) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_111.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Cause__BSSGP_template field_cause;
};

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
}
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::copy_value(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::copy_template(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template()
{
}

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

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& other_value)
{
copy_value(other_value);
}

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

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

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template(Dynamic_Match_Interface<PDU__BSSGP__PS__HANDOVER__REQUEST__NACK>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__PS__HANDOVER__REQUEST__NACK>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::~PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template()
{
clean_up();
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::operator=(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::operator=(const OPTIONAL<PDU__BSSGP__PS__HANDOVER__REQUEST__NACK>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
}
return *this;
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::operator=(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::match(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_cause.is_bound();
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_cause.is_value();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
PDU__BSSGP__PS__HANDOVER__REQUEST__NACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template[list_length];
}

PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
return single_value->field_tLLI;
}

Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
return single_value->field_cause;
}

int PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
  }
  return 0;
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::log_match(const PDU__BSSGP__PS__HANDOVER__REQUEST__NACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK.");
}
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template* precondition = new PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template* implied_template = new PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_REQUEST_NACK");
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__PS__HANDOVER__REQUEST__NACK_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE::PDU__BSSGP__PS__HANDOVER__COMPLETE()
{
}

PDU__BSSGP__PS__HANDOVER__COMPLETE::PDU__BSSGP__PS__HANDOVER__COMPLETE(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const IMSI__BSSGP& par_iMSI,
    const OPTIONAL< Cell__Identifier >& par_target__Cell__Identifier,
    const OPTIONAL< Request__For__Inter__RAT__Handover__Info >& par_request__For__Inter__RAT__Handover__Info)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_iMSI(par_iMSI),
  field_target__Cell__Identifier(par_target__Cell__Identifier),
  field_request__For__Inter__RAT__Handover__Info(par_request__For__Inter__RAT__Handover__Info)
{
}

PDU__BSSGP__PS__HANDOVER__COMPLETE::PDU__BSSGP__PS__HANDOVER__COMPLETE(const PDU__BSSGP__PS__HANDOVER__COMPLETE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
else field_target__Cell__Identifier.clean_up();
if (other_value.request__For__Inter__RAT__Handover__Info().is_bound()) field_request__For__Inter__RAT__Handover__Info = other_value.request__For__Inter__RAT__Handover__Info();
else field_request__For__Inter__RAT__Handover__Info.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_iMSI.clean_up();
field_target__Cell__Identifier.clean_up();
field_request__For__Inter__RAT__Handover__Info.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__COMPLETE::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__COMPLETE_descr_; }
PDU__BSSGP__PS__HANDOVER__COMPLETE& PDU__BSSGP__PS__HANDOVER__COMPLETE::operator=(const PDU__BSSGP__PS__HANDOVER__COMPLETE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
  else field_target__Cell__Identifier.clean_up();
  if (other_value.request__For__Inter__RAT__Handover__Info().is_bound()) field_request__For__Inter__RAT__Handover__Info = other_value.request__For__Inter__RAT__Handover__Info();
  else field_request__For__Inter__RAT__Handover__Info.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE::operator==(const PDU__BSSGP__PS__HANDOVER__COMPLETE& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_iMSI==other_value.field_iMSI
  && field_target__Cell__Identifier==other_value.field_target__Cell__Identifier
  && field_request__For__Inter__RAT__Handover__Info==other_value.field_request__For__Inter__RAT__Handover__Info;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_target__Cell__Identifier.get_selection() || field_target__Cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_request__For__Inter__RAT__Handover__Info.get_selection() || field_request__For__Inter__RAT__Handover__Info.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__COMPLETE::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_iMSI.is_value()
  && (OPTIONAL_OMIT == field_target__Cell__Identifier.get_selection() || field_target__Cell__Identifier.is_value())
  && (OPTIONAL_OMIT == field_request__For__Inter__RAT__Handover__Info.get_selection() || field_request__For__Inter__RAT__Handover__Info.is_value());
}
int PDU__BSSGP__PS__HANDOVER__COMPLETE::size_of() const
{
  int ret_val = 3;
  if (field_target__Cell__Identifier.ispresent()) ret_val++;
  if (field_request__For__Inter__RAT__Handover__Info.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(", request_For_Inter_RAT_Handover_Info := ");
field_request__For__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (!target__Cell__Identifier().is_bound()) target__Cell__Identifier() = OMIT_VALUE;
else target__Cell__Identifier().set_implicit_omit();
if (!request__For__Inter__RAT__Handover__Info().is_bound()) request__For__Inter__RAT__Handover__Info() = OMIT_VALUE;
else request__For__Inter__RAT__Handover__Info().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) target__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) request__For__Inter__RAT__Handover__Info().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "request_For_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          request__For__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
  }
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_target__Cell__Identifier.encode_text(text_buf);
field_request__For__Inter__RAT__Handover__Info.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_target__Cell__Identifier.decode_text(text_buf);
field_request__For__Inter__RAT__Handover__Info.decode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__PS__HANDOVER__COMPLETE::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_target__Cell__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_target__Cell__Identifier().RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_target__Cell__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__Cell__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_request__For__Inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Request__For__Inter__RAT__Handover__Info_descr_.raw->forceomit);
  decoded_field_length = field_request__For__Inter__RAT__Handover__Info().RAW_decode(Request__For__Inter__RAT__Handover__Info_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_request__For__Inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_request__For__Inter__RAT__Handover__Info=OMIT_VALUE;
  if (field_bssgpPduType !=  os_91) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PS__HANDOVER__COMPLETE::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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMSI__BSSGP_descr_.raw);
  if (field_target__Cell__Identifier.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_request__For__Inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Request__For__Inter__RAT__Handover__Info_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_target__Cell__Identifier.ispresent()) {
  encoded_length += field_target__Cell__Identifier().RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_request__For__Inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_request__For__Inter__RAT__Handover__Info().RAW_encode(Request__For__Inter__RAT__Handover__Info_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_bssgpPduType !=  os_91) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_91.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PS__HANDOVER__COMPLETE_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
IMSI__BSSGP_template field_iMSI;
Cell__Identifier_template field_target__Cell__Identifier;
Request__For__Inter__RAT__Handover__Info_template field_request__For__Inter__RAT__Handover__Info;
};

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_target__Cell__Identifier = ANY_OR_OMIT;
single_value->field_request__For__Inter__RAT__Handover__Info = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::copy_value(const PDU__BSSGP__PS__HANDOVER__COMPLETE& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.target__Cell__Identifier().is_bound()) {
  if (other_value.target__Cell__Identifier().ispresent()) single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier()();
  else single_value->field_target__Cell__Identifier = OMIT_VALUE;
} else {
  single_value->field_target__Cell__Identifier.clean_up();
}
if (other_value.request__For__Inter__RAT__Handover__Info().is_bound()) {
  if (other_value.request__For__Inter__RAT__Handover__Info().ispresent()) single_value->field_request__For__Inter__RAT__Handover__Info = other_value.request__For__Inter__RAT__Handover__Info()();
  else single_value->field_request__For__Inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_request__For__Inter__RAT__Handover__Info.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::copy_template(const PDU__BSSGP__PS__HANDOVER__COMPLETE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__Cell__Identifier().get_selection()) {
single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier();
} else {
single_value->field_target__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.request__For__Inter__RAT__Handover__Info().get_selection()) {
single_value->field_request__For__Inter__RAT__Handover__Info = other_value.request__For__Inter__RAT__Handover__Info();
} else {
single_value->field_request__For__Inter__RAT__Handover__Info.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__COMPLETE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__COMPLETE_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__COMPLETE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::PDU__BSSGP__PS__HANDOVER__COMPLETE_template()
{
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::PDU__BSSGP__PS__HANDOVER__COMPLETE_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::PDU__BSSGP__PS__HANDOVER__COMPLETE_template(const PDU__BSSGP__PS__HANDOVER__COMPLETE& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::PDU__BSSGP__PS__HANDOVER__COMPLETE_template(const OPTIONAL<PDU__BSSGP__PS__HANDOVER__COMPLETE>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PS__HANDOVER__COMPLETE&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE from an unbound optional field.");
}
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::PDU__BSSGP__PS__HANDOVER__COMPLETE_template(PDU__BSSGP__PS__HANDOVER__COMPLETE_template* p_precondition, PDU__BSSGP__PS__HANDOVER__COMPLETE_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::PDU__BSSGP__PS__HANDOVER__COMPLETE_template(Dynamic_Match_Interface<PDU__BSSGP__PS__HANDOVER__COMPLETE>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__PS__HANDOVER__COMPLETE>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::PDU__BSSGP__PS__HANDOVER__COMPLETE_template(const PDU__BSSGP__PS__HANDOVER__COMPLETE_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template::~PDU__BSSGP__PS__HANDOVER__COMPLETE_template()
{
clean_up();
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::operator=(const PDU__BSSGP__PS__HANDOVER__COMPLETE& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::operator=(const OPTIONAL<PDU__BSSGP__PS__HANDOVER__COMPLETE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PS__HANDOVER__COMPLETE&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
}
return *this;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::operator=(const PDU__BSSGP__PS__HANDOVER__COMPLETE_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE_template::match(const PDU__BSSGP__PS__HANDOVER__COMPLETE& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.target__Cell__Identifier().is_bound()) return FALSE;
if((other_value.target__Cell__Identifier().ispresent() ? !single_value->field_target__Cell__Identifier.match((const Cell__Identifier&)other_value.target__Cell__Identifier(), legacy) : !single_value->field_target__Cell__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.request__For__Inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.request__For__Inter__RAT__Handover__Info().ispresent() ? !single_value->field_request__For__Inter__RAT__Handover__Info.match((const Request__For__Inter__RAT__Handover__Info&)other_value.request__For__Inter__RAT__Handover__Info(), legacy) : !single_value->field_request__For__Inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_iMSI.is_bound()
 || (single_value->field_target__Cell__Identifier.is_omit() || single_value->field_target__Cell__Identifier.is_bound())
 || (single_value->field_request__For__Inter__RAT__Handover__Info.is_omit() || single_value->field_request__For__Inter__RAT__Handover__Info.is_bound());
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_iMSI.is_value()
 && (single_value->field_target__Cell__Identifier.is_omit() || single_value->field_target__Cell__Identifier.is_value())
 && (single_value->field_request__For__Inter__RAT__Handover__Info.is_omit() || single_value->field_request__For__Inter__RAT__Handover__Info.is_value());
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE PDU__BSSGP__PS__HANDOVER__COMPLETE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
PDU__BSSGP__PS__HANDOVER__COMPLETE ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_target__Cell__Identifier.is_omit()) ret_val.target__Cell__Identifier() = OMIT_VALUE;
else if (single_value->field_target__Cell__Identifier.is_bound()) {
ret_val.target__Cell__Identifier() = single_value->field_target__Cell__Identifier.valueof();
}
if (single_value->field_request__For__Inter__RAT__Handover__Info.is_omit()) ret_val.request__For__Inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_request__For__Inter__RAT__Handover__Info.is_bound()) {
ret_val.request__For__Inter__RAT__Handover__Info() = single_value->field_request__For__Inter__RAT__Handover__Info.valueof();
}
return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__COMPLETE_template[list_length];
}

PDU__BSSGP__PS__HANDOVER__COMPLETE_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
return single_value->field_tLLI;
}

IMSI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
return single_value->field_iMSI;
}

Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::target__Cell__Identifier()
{
set_specific();
return single_value->field_target__Cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::target__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
return single_value->field_target__Cell__Identifier;
}

Request__For__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::request__For__Inter__RAT__Handover__Info()
{
set_specific();
return single_value->field_request__For__Inter__RAT__Handover__Info;
}

const Request__For__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__COMPLETE_template::request__For__Inter__RAT__Handover__Info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field request_For_Inter_RAT_Handover_Info of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
return single_value->field_request__For__Inter__RAT__Handover__Info;
}

int PDU__BSSGP__PS__HANDOVER__COMPLETE_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_target__Cell__Identifier.is_present()) ret_val++;
      if (single_value->field_request__For__Inter__RAT__Handover__Info.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
  }
  return 0;
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
single_value->field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(", request_For_Inter_RAT_Handover_Info := ");
single_value->field_request__For__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::log_match(const PDU__BSSGP__PS__HANDOVER__COMPLETE& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.target__Cell__Identifier().ispresent()){
if(!single_value->field_target__Cell__Identifier.match(match_value.target__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_Cell_Identifier");
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__Cell__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_Cell_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.request__For__Inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_request__For__Inter__RAT__Handover__Info.match(match_value.request__For__Inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".request_For_Inter_RAT_Handover_Info");
single_value->field_request__For__Inter__RAT__Handover__Info.log_match(match_value.request__For__Inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_request__For__Inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".request_For_Inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_request__For__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
if (match_value.target__Cell__Identifier().ispresent()) {
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__Cell__Identifier.log();
if (single_value->field_target__Cell__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", request_For_Inter_RAT_Handover_Info := ");
if (match_value.request__For__Inter__RAT__Handover__Info().ispresent()) {
single_value->field_request__For__Inter__RAT__Handover__Info.log_match(match_value.request__For__Inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_request__For__Inter__RAT__Handover__Info.log();
if (single_value->field_request__For__Inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_target__Cell__Identifier.encode_text(text_buf);
single_value->field_request__For__Inter__RAT__Handover__Info.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_target__Cell__Identifier.decode_text(text_buf);
single_value->field_request__For__Inter__RAT__Handover__Info.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__COMPLETE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE.");
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PS__HANDOVER__COMPLETE_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) target__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) request__For__Inter__RAT__Handover__Info().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "request_For_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          request__For__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PS__HANDOVER__COMPLETE_template* precondition = new PDU__BSSGP__PS__HANDOVER__COMPLETE_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PS__HANDOVER__COMPLETE_template* implied_template = new PDU__BSSGP__PS__HANDOVER__COMPLETE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PS__HANDOVER__COMPLETE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
single_value->field_target__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
single_value->field_request__For__Inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE");
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__PS__HANDOVER__CANCEL::PDU__BSSGP__PS__HANDOVER__CANCEL()
{
}

PDU__BSSGP__PS__HANDOVER__CANCEL::PDU__BSSGP__PS__HANDOVER__CANCEL(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Cause__BSSGP& par_cause,
    const Cell__Identifier& par_source__Cell__Identifier,
    const OPTIONAL< Cell__Identifier >& par_target__Cell__Identifier,
    const OPTIONAL< RNC__Identifier__BSSGP >& par_target__RNC__Identifier,
    const OPTIONAL< ENB__Identifier >& par_target__Enb__Identifier)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_cause(par_cause),
  field_source__Cell__Identifier(par_source__Cell__Identifier),
  field_target__Cell__Identifier(par_target__Cell__Identifier),
  field_target__RNC__Identifier(par_target__RNC__Identifier),
  field_target__Enb__Identifier(par_target__Enb__Identifier)
{
}

PDU__BSSGP__PS__HANDOVER__CANCEL::PDU__BSSGP__PS__HANDOVER__CANCEL(const PDU__BSSGP__PS__HANDOVER__CANCEL& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
else field_source__Cell__Identifier.clean_up();
if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
else field_target__Cell__Identifier.clean_up();
if (other_value.target__RNC__Identifier().is_bound()) field_target__RNC__Identifier = other_value.target__RNC__Identifier();
else field_target__RNC__Identifier.clean_up();
if (other_value.target__Enb__Identifier().is_bound()) field_target__Enb__Identifier = other_value.target__Enb__Identifier();
else field_target__Enb__Identifier.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_cause.clean_up();
field_source__Cell__Identifier.clean_up();
field_target__Cell__Identifier.clean_up();
field_target__RNC__Identifier.clean_up();
field_target__Enb__Identifier.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__CANCEL::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__CANCEL_descr_; }
PDU__BSSGP__PS__HANDOVER__CANCEL& PDU__BSSGP__PS__HANDOVER__CANCEL::operator=(const PDU__BSSGP__PS__HANDOVER__CANCEL& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
  else field_source__Cell__Identifier.clean_up();
  if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
  else field_target__Cell__Identifier.clean_up();
  if (other_value.target__RNC__Identifier().is_bound()) field_target__RNC__Identifier = other_value.target__RNC__Identifier();
  else field_target__RNC__Identifier.clean_up();
  if (other_value.target__Enb__Identifier().is_bound()) field_target__Enb__Identifier = other_value.target__Enb__Identifier();
  else field_target__Enb__Identifier.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__CANCEL::operator==(const PDU__BSSGP__PS__HANDOVER__CANCEL& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_cause==other_value.field_cause
  && field_source__Cell__Identifier==other_value.field_source__Cell__Identifier
  && field_target__Cell__Identifier==other_value.field_target__Cell__Identifier
  && field_target__RNC__Identifier==other_value.field_target__RNC__Identifier
  && field_target__Enb__Identifier==other_value.field_target__Enb__Identifier;
}

boolean PDU__BSSGP__PS__HANDOVER__CANCEL::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_cause.is_bound())
  || (field_source__Cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_target__Cell__Identifier.get_selection() || field_target__Cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_target__RNC__Identifier.get_selection() || field_target__RNC__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_target__Enb__Identifier.get_selection() || field_target__Enb__Identifier.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__CANCEL::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_cause.is_value()
  && field_source__Cell__Identifier.is_value()
  && (OPTIONAL_OMIT == field_target__Cell__Identifier.get_selection() || field_target__Cell__Identifier.is_value())
  && (OPTIONAL_OMIT == field_target__RNC__Identifier.get_selection() || field_target__RNC__Identifier.is_value())
  && (OPTIONAL_OMIT == field_target__Enb__Identifier.get_selection() || field_target__Enb__Identifier.is_value());
}
int PDU__BSSGP__PS__HANDOVER__CANCEL::size_of() const
{
  int ret_val = 4;
  if (field_target__Cell__Identifier.ispresent()) ret_val++;
  if (field_target__RNC__Identifier.ispresent()) ret_val++;
  if (field_target__Enb__Identifier.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(", target_RNC_Identifier := ");
field_target__RNC__Identifier.log();
TTCN_Logger::log_event_str(", target_Enb_Identifier := ");
field_target__Enb__Identifier.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (source__Cell__Identifier().is_bound()) source__Cell__Identifier().set_implicit_omit();
if (!target__Cell__Identifier().is_bound()) target__Cell__Identifier() = OMIT_VALUE;
else target__Cell__Identifier().set_implicit_omit();
if (!target__RNC__Identifier().is_bound()) target__RNC__Identifier() = OMIT_VALUE;
else target__RNC__Identifier().set_implicit_omit();
if (!target__Enb__Identifier().is_bound()) target__Enb__Identifier() = OMIT_VALUE;
else target__Enb__Identifier().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::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.PDU_BSSGP_PS_HANDOVER_CANCEL 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) target__Cell__Identifier().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) target__RNC__Identifier().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) target__Enb__Identifier().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "target_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_RNC_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__RNC__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_Enb_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Enb__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.PDU_BSSGP_PS_HANDOVER_CANCEL: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
  }
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_source__Cell__Identifier.encode_text(text_buf);
field_target__Cell__Identifier.encode_text(text_buf);
field_target__RNC__Identifier.encode_text(text_buf);
field_target__Enb__Identifier.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_source__Cell__Identifier.decode_text(text_buf);
field_target__Cell__Identifier.decode_text(text_buf);
field_target__RNC__Identifier.decode_text(text_buf);
field_target__Enb__Identifier.decode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__PS__HANDOVER__CANCEL::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__PS__HANDOVER__CANCEL::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_source__Cell__Identifier.RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_target__Cell__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_target__Cell__Identifier().RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_target__Cell__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__Cell__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_target__RNC__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, RNC__Identifier__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_target__RNC__Identifier().RAW_decode(RNC__Identifier__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_target__RNC__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__RNC__Identifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_target__Enb__Identifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ENB__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_target__Enb__Identifier().RAW_decode(ENB__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_target__Enb__Identifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_target__Enb__Identifier=OMIT_VALUE;
  if (field_bssgpPduType !=  os_16) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PS__HANDOVER__CANCEL::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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Cause__BSSGP_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier_descr_.raw);
  if (field_target__Cell__Identifier.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Cell__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_target__RNC__Identifier.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RNC__Identifier__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_target__Enb__Identifier.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ENB__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cause.RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_source__Cell__Identifier.RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[3]);
  if (field_target__Cell__Identifier.ispresent()) {
  encoded_length += field_target__Cell__Identifier().RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_target__RNC__Identifier.ispresent()) {
  encoded_length += field_target__RNC__Identifier().RAW_encode(RNC__Identifier__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_target__Enb__Identifier.ispresent()) {
  encoded_length += field_target__Enb__Identifier().RAW_encode(ENB__Identifier_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_bssgpPduType !=  os_16) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_16.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PS__HANDOVER__CANCEL_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Cause__BSSGP_template field_cause;
Cell__Identifier_template field_source__Cell__Identifier;
Cell__Identifier_template field_target__Cell__Identifier;
RNC__Identifier__BSSGP_template field_target__RNC__Identifier;
ENB__Identifier_template field_target__Enb__Identifier;
};

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_source__Cell__Identifier = ANY_VALUE;
single_value->field_target__Cell__Identifier = ANY_OR_OMIT;
single_value->field_target__RNC__Identifier = ANY_OR_OMIT;
single_value->field_target__Enb__Identifier = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::copy_value(const PDU__BSSGP__PS__HANDOVER__CANCEL& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.source__Cell__Identifier().is_bound()) {
  single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
  single_value->field_source__Cell__Identifier.clean_up();
}
if (other_value.target__Cell__Identifier().is_bound()) {
  if (other_value.target__Cell__Identifier().ispresent()) single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier()();
  else single_value->field_target__Cell__Identifier = OMIT_VALUE;
} else {
  single_value->field_target__Cell__Identifier.clean_up();
}
if (other_value.target__RNC__Identifier().is_bound()) {
  if (other_value.target__RNC__Identifier().ispresent()) single_value->field_target__RNC__Identifier = other_value.target__RNC__Identifier()();
  else single_value->field_target__RNC__Identifier = OMIT_VALUE;
} else {
  single_value->field_target__RNC__Identifier.clean_up();
}
if (other_value.target__Enb__Identifier().is_bound()) {
  if (other_value.target__Enb__Identifier().ispresent()) single_value->field_target__Enb__Identifier = other_value.target__Enb__Identifier()();
  else single_value->field_target__Enb__Identifier = OMIT_VALUE;
} else {
  single_value->field_target__Enb__Identifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::copy_template(const PDU__BSSGP__PS__HANDOVER__CANCEL_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__Cell__Identifier().get_selection()) {
single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
single_value->field_source__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__Cell__Identifier().get_selection()) {
single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier();
} else {
single_value->field_target__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__RNC__Identifier().get_selection()) {
single_value->field_target__RNC__Identifier = other_value.target__RNC__Identifier();
} else {
single_value->field_target__RNC__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.target__Enb__Identifier().get_selection()) {
single_value->field_target__Enb__Identifier = other_value.target__Enb__Identifier();
} else {
single_value->field_target__Enb__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 PDU__BSSGP__PS__HANDOVER__CANCEL_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__CANCEL_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__CANCEL_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::PDU__BSSGP__PS__HANDOVER__CANCEL_template()
{
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::PDU__BSSGP__PS__HANDOVER__CANCEL_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::PDU__BSSGP__PS__HANDOVER__CANCEL_template(const PDU__BSSGP__PS__HANDOVER__CANCEL& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::PDU__BSSGP__PS__HANDOVER__CANCEL_template(const OPTIONAL<PDU__BSSGP__PS__HANDOVER__CANCEL>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PS__HANDOVER__CANCEL&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL from an unbound optional field.");
}
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::PDU__BSSGP__PS__HANDOVER__CANCEL_template(PDU__BSSGP__PS__HANDOVER__CANCEL_template* p_precondition, PDU__BSSGP__PS__HANDOVER__CANCEL_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::PDU__BSSGP__PS__HANDOVER__CANCEL_template(Dynamic_Match_Interface<PDU__BSSGP__PS__HANDOVER__CANCEL>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__PS__HANDOVER__CANCEL>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::PDU__BSSGP__PS__HANDOVER__CANCEL_template(const PDU__BSSGP__PS__HANDOVER__CANCEL_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template::~PDU__BSSGP__PS__HANDOVER__CANCEL_template()
{
clean_up();
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::operator=(const PDU__BSSGP__PS__HANDOVER__CANCEL& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::operator=(const OPTIONAL<PDU__BSSGP__PS__HANDOVER__CANCEL>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PS__HANDOVER__CANCEL&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
}
return *this;
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::operator=(const PDU__BSSGP__PS__HANDOVER__CANCEL_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__CANCEL_template::match(const PDU__BSSGP__PS__HANDOVER__CANCEL& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.source__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_source__Cell__Identifier.match(other_value.source__Cell__Identifier(), legacy))return FALSE;
if(!other_value.target__Cell__Identifier().is_bound()) return FALSE;
if((other_value.target__Cell__Identifier().ispresent() ? !single_value->field_target__Cell__Identifier.match((const Cell__Identifier&)other_value.target__Cell__Identifier(), legacy) : !single_value->field_target__Cell__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.target__RNC__Identifier().is_bound()) return FALSE;
if((other_value.target__RNC__Identifier().ispresent() ? !single_value->field_target__RNC__Identifier.match((const RNC__Identifier__BSSGP&)other_value.target__RNC__Identifier(), legacy) : !single_value->field_target__RNC__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.target__Enb__Identifier().is_bound()) return FALSE;
if((other_value.target__Enb__Identifier().ispresent() ? !single_value->field_target__Enb__Identifier.match((const ENB__Identifier&)other_value.target__Enb__Identifier(), legacy) : !single_value->field_target__Enb__Identifier.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__CANCEL_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_cause.is_bound()
 || single_value->field_source__Cell__Identifier.is_bound()
 || (single_value->field_target__Cell__Identifier.is_omit() || single_value->field_target__Cell__Identifier.is_bound())
 || (single_value->field_target__RNC__Identifier.is_omit() || single_value->field_target__RNC__Identifier.is_bound())
 || (single_value->field_target__Enb__Identifier.is_omit() || single_value->field_target__Enb__Identifier.is_bound());
}

boolean PDU__BSSGP__PS__HANDOVER__CANCEL_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_cause.is_value()
 && single_value->field_source__Cell__Identifier.is_value()
 && (single_value->field_target__Cell__Identifier.is_omit() || single_value->field_target__Cell__Identifier.is_value())
 && (single_value->field_target__RNC__Identifier.is_omit() || single_value->field_target__RNC__Identifier.is_value())
 && (single_value->field_target__Enb__Identifier.is_omit() || single_value->field_target__Enb__Identifier.is_value());
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__PS__HANDOVER__CANCEL PDU__BSSGP__PS__HANDOVER__CANCEL_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
PDU__BSSGP__PS__HANDOVER__CANCEL ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_source__Cell__Identifier.is_bound()) {
ret_val.source__Cell__Identifier() = single_value->field_source__Cell__Identifier.valueof();
}
if (single_value->field_target__Cell__Identifier.is_omit()) ret_val.target__Cell__Identifier() = OMIT_VALUE;
else if (single_value->field_target__Cell__Identifier.is_bound()) {
ret_val.target__Cell__Identifier() = single_value->field_target__Cell__Identifier.valueof();
}
if (single_value->field_target__RNC__Identifier.is_omit()) ret_val.target__RNC__Identifier() = OMIT_VALUE;
else if (single_value->field_target__RNC__Identifier.is_bound()) {
ret_val.target__RNC__Identifier() = single_value->field_target__RNC__Identifier.valueof();
}
if (single_value->field_target__Enb__Identifier.is_omit()) ret_val.target__Enb__Identifier() = OMIT_VALUE;
else if (single_value->field_target__Enb__Identifier.is_bound()) {
ret_val.target__Enb__Identifier() = single_value->field_target__Enb__Identifier.valueof();
}
return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__CANCEL_template[list_length];
}

PDU__BSSGP__PS__HANDOVER__CANCEL_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return single_value->field_tLLI;
}

Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return single_value->field_cause;
}

Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::source__Cell__Identifier()
{
set_specific();
return single_value->field_source__Cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::source__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return single_value->field_source__Cell__Identifier;
}

Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::target__Cell__Identifier()
{
set_specific();
return single_value->field_target__Cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::target__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return single_value->field_target__Cell__Identifier;
}

RNC__Identifier__BSSGP_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::target__RNC__Identifier()
{
set_specific();
return single_value->field_target__RNC__Identifier;
}

const RNC__Identifier__BSSGP_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::target__RNC__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_RNC_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return single_value->field_target__RNC__Identifier;
}

ENB__Identifier_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::target__Enb__Identifier()
{
set_specific();
return single_value->field_target__Enb__Identifier;
}

const ENB__Identifier_template& PDU__BSSGP__PS__HANDOVER__CANCEL_template::target__Enb__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_Enb_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
return single_value->field_target__Enb__Identifier;
}

int PDU__BSSGP__PS__HANDOVER__CANCEL_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_target__Cell__Identifier.is_present()) ret_val++;
      if (single_value->field_target__RNC__Identifier.is_present()) ret_val++;
      if (single_value->field_target__Enb__Identifier.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
  }
  return 0;
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
single_value->field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(", target_RNC_Identifier := ");
single_value->field_target__RNC__Identifier.log();
TTCN_Logger::log_event_str(", target_Enb_Identifier := ");
single_value->field_target__Enb__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 PDU__BSSGP__PS__HANDOVER__CANCEL_template::log_match(const PDU__BSSGP__PS__HANDOVER__CANCEL& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_source__Cell__Identifier.match(match_value.source__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".source_Cell_Identifier");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.target__Cell__Identifier().ispresent()){
if(!single_value->field_target__Cell__Identifier.match(match_value.target__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_Cell_Identifier");
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__Cell__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_Cell_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.target__RNC__Identifier().ispresent()){
if(!single_value->field_target__RNC__Identifier.match(match_value.target__RNC__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_RNC_Identifier");
single_value->field_target__RNC__Identifier.log_match(match_value.target__RNC__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__RNC__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_RNC_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__RNC__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.target__Enb__Identifier().ispresent()){
if(!single_value->field_target__Enb__Identifier.match(match_value.target__Enb__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_Enb_Identifier");
single_value->field_target__Enb__Identifier.log_match(match_value.target__Enb__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_target__Enb__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".target_Enb_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_target__Enb__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", target_Cell_Identifier := ");
if (match_value.target__Cell__Identifier().ispresent()) {
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__Cell__Identifier.log();
if (single_value->field_target__Cell__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", target_RNC_Identifier := ");
if (match_value.target__RNC__Identifier().ispresent()) {
single_value->field_target__RNC__Identifier.log_match(match_value.target__RNC__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__RNC__Identifier.log();
if (single_value->field_target__RNC__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", target_Enb_Identifier := ");
if (match_value.target__Enb__Identifier().ispresent()) {
single_value->field_target__Enb__Identifier.log_match(match_value.target__Enb__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_target__Enb__Identifier.log();
if (single_value->field_target__Enb__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_source__Cell__Identifier.encode_text(text_buf);
single_value->field_target__Cell__Identifier.encode_text(text_buf);
single_value->field_target__RNC__Identifier.encode_text(text_buf);
single_value->field_target__Enb__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.PDU_BSSGP_PS_HANDOVER_CANCEL.");
}
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_source__Cell__Identifier.decode_text(text_buf);
single_value->field_target__Cell__Identifier.decode_text(text_buf);
single_value->field_target__RNC__Identifier.decode_text(text_buf);
single_value->field_target__Enb__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 PDU__BSSGP__PS__HANDOVER__CANCEL_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL.");
}
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PS__HANDOVER__CANCEL_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.PDU_BSSGP_PS_HANDOVER_CANCEL 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) target__Cell__Identifier().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) target__RNC__Identifier().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) target__Enb__Identifier().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "target_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_RNC_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__RNC__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "target_Enb_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__Enb__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.PDU_BSSGP_PS_HANDOVER_CANCEL: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PS__HANDOVER__CANCEL_template* precondition = new PDU__BSSGP__PS__HANDOVER__CANCEL_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PS__HANDOVER__CANCEL_template* implied_template = new PDU__BSSGP__PS__HANDOVER__CANCEL_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PS__HANDOVER__CANCEL_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__CANCEL_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
single_value->field_source__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
single_value->field_target__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
single_value->field_target__RNC__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
single_value->field_target__Enb__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_CANCEL");
}

boolean PDU__BSSGP__PS__HANDOVER__CANCEL_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__PS__HANDOVER__CANCEL_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK()
{
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Inter__RAT__Handover__Info__BSSGP& par_inter__RAT__Handover__Info__BSSGP,
    const OPTIONAL< E__UTRAN__Inter__RAT__Handover__Info >& par_e__UTRAN__Inter__RAT__Handover__Info)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_inter__RAT__Handover__Info__BSSGP(par_inter__RAT__Handover__Info__BSSGP),
  field_e__UTRAN__Inter__RAT__Handover__Info(par_e__UTRAN__Inter__RAT__Handover__Info)
{
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.inter__RAT__Handover__Info__BSSGP().is_bound()) field_inter__RAT__Handover__Info__BSSGP = other_value.inter__RAT__Handover__Info__BSSGP();
else field_inter__RAT__Handover__Info__BSSGP.clean_up();
if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
else field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_inter__RAT__Handover__Info__BSSGP.clean_up();
field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::get_descriptor() const { return &PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_descr_; }
PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::operator=(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.inter__RAT__Handover__Info__BSSGP().is_bound()) field_inter__RAT__Handover__Info__BSSGP = other_value.inter__RAT__Handover__Info__BSSGP();
  else field_inter__RAT__Handover__Info__BSSGP.clean_up();
  if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
  else field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::operator==(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_inter__RAT__Handover__Info__BSSGP==other_value.field_inter__RAT__Handover__Info__BSSGP
  && field_e__UTRAN__Inter__RAT__Handover__Info==other_value.field_e__UTRAN__Inter__RAT__Handover__Info;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_inter__RAT__Handover__Info__BSSGP.is_bound())
  || (OPTIONAL_OMIT == field_e__UTRAN__Inter__RAT__Handover__Info.get_selection() || field_e__UTRAN__Inter__RAT__Handover__Info.is_bound());
}
boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_inter__RAT__Handover__Info__BSSGP.is_value()
  && (OPTIONAL_OMIT == field_e__UTRAN__Inter__RAT__Handover__Info.get_selection() || field_e__UTRAN__Inter__RAT__Handover__Info.is_value());
}
int PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::size_of() const
{
  int ret_val = 3;
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info_BSSGP := ");
field_inter__RAT__Handover__Info__BSSGP.log();
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (inter__RAT__Handover__Info__BSSGP().is_bound()) inter__RAT__Handover__Info__BSSGP().set_implicit_omit();
if (!e__UTRAN__Inter__RAT__Handover__Info().is_bound()) e__UTRAN__Inter__RAT__Handover__Info() = OMIT_VALUE;
else e__UTRAN__Inter__RAT__Handover__Info().set_implicit_omit();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) inter__RAT__Handover__Info__BSSGP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) e__UTRAN__Inter__RAT__Handover__Info().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "inter_RAT_Handover_Info_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Info__BSSGP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "e_UTRAN_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__UTRAN__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK");
  }
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_inter__RAT__Handover__Info__BSSGP.encode_text(text_buf);
field_e__UTRAN__Inter__RAT__Handover__Info.encode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_inter__RAT__Handover__Info__BSSGP.decode_text(text_buf);
field_e__UTRAN__Inter__RAT__Handover__Info.decode_text(text_buf);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Inter__RAT__Handover__Info__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_inter__RAT__Handover__Info__BSSGP.RAW_decode(Inter__RAT__Handover__Info__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, E__UTRAN__Inter__RAT__Handover__Info_descr_.raw->forceomit);
  decoded_field_length = field_e__UTRAN__Inter__RAT__Handover__Info().RAW_decode(E__UTRAN__Inter__RAT__Handover__Info_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_e__UTRAN__Inter__RAT__Handover__Info=OMIT_VALUE;
  if (field_bssgpPduType !=  os_48) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Inter__RAT__Handover__Info__BSSGP_descr_.raw);
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, E__UTRAN__Inter__RAT__Handover__Info_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_inter__RAT__Handover__Info__BSSGP.RAW_encode(Inter__RAT__Handover__Info__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_e__UTRAN__Inter__RAT__Handover__Info().RAW_encode(E__UTRAN__Inter__RAT__Handover__Info_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bssgpPduType !=  os_48) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_48.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Inter__RAT__Handover__Info__BSSGP_template field_inter__RAT__Handover__Info__BSSGP;
E__UTRAN__Inter__RAT__Handover__Info_template field_e__UTRAN__Inter__RAT__Handover__Info;
};

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_inter__RAT__Handover__Info__BSSGP = ANY_VALUE;
single_value->field_e__UTRAN__Inter__RAT__Handover__Info = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::copy_value(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.inter__RAT__Handover__Info__BSSGP().is_bound()) {
  single_value->field_inter__RAT__Handover__Info__BSSGP = other_value.inter__RAT__Handover__Info__BSSGP();
} else {
  single_value->field_inter__RAT__Handover__Info__BSSGP.clean_up();
}
if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) {
  if (other_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()) single_value->field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info()();
  else single_value->field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::copy_template(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.inter__RAT__Handover__Info__BSSGP().get_selection()) {
single_value->field_inter__RAT__Handover__Info__BSSGP = other_value.inter__RAT__Handover__Info__BSSGP();
} else {
single_value->field_inter__RAT__Handover__Info__BSSGP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.e__UTRAN__Inter__RAT__Handover__Info().get_selection()) {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
} else {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template()
{
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(const OPTIONAL<PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK from an unbound optional field.");
}
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template* p_precondition, PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(Dynamic_Match_Interface<PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::~PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template()
{
clean_up();
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::operator=(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::operator=(const OPTIONAL<PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
}
return *this;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::operator=(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::match(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.inter__RAT__Handover__Info__BSSGP().is_bound()) return FALSE;
if(!single_value->field_inter__RAT__Handover__Info__BSSGP.match(other_value.inter__RAT__Handover__Info__BSSGP(), legacy))return FALSE;
if(!other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent() ? !single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match((const E__UTRAN__Inter__RAT__Handover__Info&)other_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy) : !single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_inter__RAT__Handover__Info__BSSGP.is_bound()
 || (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit() || single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_bound());
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_inter__RAT__Handover__Info__BSSGP.is_value()
 && (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit() || single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_value());
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_inter__RAT__Handover__Info__BSSGP.is_bound()) {
ret_val.inter__RAT__Handover__Info__BSSGP() = single_value->field_inter__RAT__Handover__Info__BSSGP.valueof();
}
if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit()) ret_val.e__UTRAN__Inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_bound()) {
ret_val.e__UTRAN__Inter__RAT__Handover__Info() = single_value->field_e__UTRAN__Inter__RAT__Handover__Info.valueof();
}
return ret_val;
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template[list_length];
}

PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
return single_value->field_tLLI;
}

Inter__RAT__Handover__Info__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::inter__RAT__Handover__Info__BSSGP()
{
set_specific();
return single_value->field_inter__RAT__Handover__Info__BSSGP;
}

const Inter__RAT__Handover__Info__BSSGP_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::inter__RAT__Handover__Info__BSSGP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field inter_RAT_Handover_Info_BSSGP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
return single_value->field_inter__RAT__Handover__Info__BSSGP;
}

E__UTRAN__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::e__UTRAN__Inter__RAT__Handover__Info()
{
set_specific();
return single_value->field_e__UTRAN__Inter__RAT__Handover__Info;
}

const E__UTRAN__Inter__RAT__Handover__Info_template& PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::e__UTRAN__Inter__RAT__Handover__Info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field e_UTRAN_Inter_RAT_Handover_Info of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
return single_value->field_e__UTRAN__Inter__RAT__Handover__Info;
}

int PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
  }
  return 0;
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info_BSSGP := ");
single_value->field_inter__RAT__Handover__Info__BSSGP.log();
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::log_match(const PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_inter__RAT__Handover__Info__BSSGP.match(match_value.inter__RAT__Handover__Info__BSSGP(), legacy)){
TTCN_Logger::log_logmatch_info(".inter_RAT_Handover_Info_BSSGP");
single_value->field_inter__RAT__Handover__Info__BSSGP.log_match(match_value.inter__RAT__Handover__Info__BSSGP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".e_UTRAN_Inter_RAT_Handover_Info");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log_match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".e_UTRAN_Inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info_BSSGP := ");
single_value->field_inter__RAT__Handover__Info__BSSGP.log_match(match_value.inter__RAT__Handover__Info__BSSGP(), legacy);
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
if (match_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()) {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log_match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_inter__RAT__Handover__Info__BSSGP.encode_text(text_buf);
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_inter__RAT__Handover__Info__BSSGP.decode_text(text_buf);
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK.");
}
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) inter__RAT__Handover__Info__BSSGP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) e__UTRAN__Inter__RAT__Handover__Info().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "inter_RAT_Handover_Info_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Info__BSSGP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "e_UTRAN_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__UTRAN__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template* precondition = new PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template* implied_template = new PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK");
single_value->field_inter__RAT__Handover__Info__BSSGP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PS_HANDOVER_COMPLETE_ACK");
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__PS__HANDOVER__COMPLETE__ACK_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__OVERLOAD::PDU__BSSGP__OVERLOAD()
{
}

PDU__BSSGP__OVERLOAD::PDU__BSSGP__OVERLOAD(const OCTETSTRING& par_bssgpPduType,
    const Priority__Class__Indicator& par_priority__Class__Indicator)
  :   field_bssgpPduType(par_bssgpPduType),
  field_priority__Class__Indicator(par_priority__Class__Indicator)
{
}

PDU__BSSGP__OVERLOAD::PDU__BSSGP__OVERLOAD(const PDU__BSSGP__OVERLOAD& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.priority__Class__Indicator().is_bound()) field_priority__Class__Indicator = other_value.priority__Class__Indicator();
else field_priority__Class__Indicator.clean_up();
}

void PDU__BSSGP__OVERLOAD::clean_up()
{
field_bssgpPduType.clean_up();
field_priority__Class__Indicator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__OVERLOAD::get_descriptor() const { return &PDU__BSSGP__OVERLOAD_descr_; }
PDU__BSSGP__OVERLOAD& PDU__BSSGP__OVERLOAD::operator=(const PDU__BSSGP__OVERLOAD& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.priority__Class__Indicator().is_bound()) field_priority__Class__Indicator = other_value.priority__Class__Indicator();
  else field_priority__Class__Indicator.clean_up();
}
return *this;
}

boolean PDU__BSSGP__OVERLOAD::operator==(const PDU__BSSGP__OVERLOAD& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_priority__Class__Indicator==other_value.field_priority__Class__Indicator;
}

boolean PDU__BSSGP__OVERLOAD::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_priority__Class__Indicator.is_bound());
}
boolean PDU__BSSGP__OVERLOAD::is_value() const
{
return field_bssgpPduType.is_value()
  && field_priority__Class__Indicator.is_value();
}
void PDU__BSSGP__OVERLOAD::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", priority_Class_Indicator := ");
field_priority__Class__Indicator.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__OVERLOAD::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (priority__Class__Indicator().is_bound()) priority__Class__Indicator().set_implicit_omit();
}

void PDU__BSSGP__OVERLOAD::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_OVERLOAD has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) priority__Class__Indicator().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority_Class_Indicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority__Class__Indicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_OVERLOAD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_OVERLOAD");
  }
}

void PDU__BSSGP__OVERLOAD::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_priority__Class__Indicator.encode_text(text_buf);
}

void PDU__BSSGP__OVERLOAD::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_priority__Class__Indicator.decode_text(text_buf);
}

void PDU__BSSGP__OVERLOAD::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__OVERLOAD::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__OVERLOAD::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, Priority__Class__Indicator_descr_.raw->forceomit);
  decoded_field_length = field_priority__Class__Indicator.RAW_decode(Priority__Class__Indicator_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_bssgpPduType !=  os_114) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__OVERLOAD::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Priority__Class__Indicator_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_priority__Class__Indicator.RAW_encode(Priority__Class__Indicator_descr_, *myleaf.body.node.nodes[1]);
  if (field_bssgpPduType !=  os_114) {
  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_114.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__OVERLOAD_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
Priority__Class__Indicator_template field_priority__Class__Indicator;
};

void PDU__BSSGP__OVERLOAD_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_priority__Class__Indicator = ANY_VALUE;
}
}
}

void PDU__BSSGP__OVERLOAD_template::copy_value(const PDU__BSSGP__OVERLOAD& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.priority__Class__Indicator().is_bound()) {
  single_value->field_priority__Class__Indicator = other_value.priority__Class__Indicator();
} else {
  single_value->field_priority__Class__Indicator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__OVERLOAD_template::copy_template(const PDU__BSSGP__OVERLOAD_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priority__Class__Indicator().get_selection()) {
single_value->field_priority__Class__Indicator = other_value.priority__Class__Indicator();
} else {
single_value->field_priority__Class__Indicator.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__OVERLOAD_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__OVERLOAD_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__OVERLOAD_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__OVERLOAD_template::PDU__BSSGP__OVERLOAD_template()
{
}

PDU__BSSGP__OVERLOAD_template::PDU__BSSGP__OVERLOAD_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__OVERLOAD_template::PDU__BSSGP__OVERLOAD_template(const PDU__BSSGP__OVERLOAD& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__OVERLOAD_template::PDU__BSSGP__OVERLOAD_template(const OPTIONAL<PDU__BSSGP__OVERLOAD>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__OVERLOAD&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD from an unbound optional field.");
}
}

PDU__BSSGP__OVERLOAD_template::PDU__BSSGP__OVERLOAD_template(PDU__BSSGP__OVERLOAD_template* p_precondition, PDU__BSSGP__OVERLOAD_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__OVERLOAD_template::PDU__BSSGP__OVERLOAD_template(Dynamic_Match_Interface<PDU__BSSGP__OVERLOAD>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__OVERLOAD>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__OVERLOAD_template::PDU__BSSGP__OVERLOAD_template(const PDU__BSSGP__OVERLOAD_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__OVERLOAD_template::~PDU__BSSGP__OVERLOAD_template()
{
clean_up();
}

PDU__BSSGP__OVERLOAD_template& PDU__BSSGP__OVERLOAD_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__OVERLOAD_template& PDU__BSSGP__OVERLOAD_template::operator=(const PDU__BSSGP__OVERLOAD& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__OVERLOAD_template& PDU__BSSGP__OVERLOAD_template::operator=(const OPTIONAL<PDU__BSSGP__OVERLOAD>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__OVERLOAD&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
}
return *this;
}

PDU__BSSGP__OVERLOAD_template& PDU__BSSGP__OVERLOAD_template::operator=(const PDU__BSSGP__OVERLOAD_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__OVERLOAD_template::match(const PDU__BSSGP__OVERLOAD& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.priority__Class__Indicator().is_bound()) return FALSE;
if(!single_value->field_priority__Class__Indicator.match(other_value.priority__Class__Indicator(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
}
return FALSE;
}

boolean PDU__BSSGP__OVERLOAD_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_priority__Class__Indicator.is_bound();
}

boolean PDU__BSSGP__OVERLOAD_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_priority__Class__Indicator.is_value();
}

void PDU__BSSGP__OVERLOAD_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__OVERLOAD PDU__BSSGP__OVERLOAD_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
PDU__BSSGP__OVERLOAD ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_priority__Class__Indicator.is_bound()) {
ret_val.priority__Class__Indicator() = single_value->field_priority__Class__Indicator.valueof();
}
return ret_val;
}

void PDU__BSSGP__OVERLOAD_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__OVERLOAD_template[list_length];
}

PDU__BSSGP__OVERLOAD_template& PDU__BSSGP__OVERLOAD_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__OVERLOAD_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__OVERLOAD_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
return single_value->field_bssgpPduType;
}

Priority__Class__Indicator_template& PDU__BSSGP__OVERLOAD_template::priority__Class__Indicator()
{
set_specific();
return single_value->field_priority__Class__Indicator;
}

const Priority__Class__Indicator_template& PDU__BSSGP__OVERLOAD_template::priority__Class__Indicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priority_Class_Indicator of a non-specific template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
return single_value->field_priority__Class__Indicator;
}

int PDU__BSSGP__OVERLOAD_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
  }
  return 0;
}

void PDU__BSSGP__OVERLOAD_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", priority_Class_Indicator := ");
single_value->field_priority__Class__Indicator.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__OVERLOAD_template::log_match(const PDU__BSSGP__OVERLOAD& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_priority__Class__Indicator.match(match_value.priority__Class__Indicator(), legacy)){
TTCN_Logger::log_logmatch_info(".priority_Class_Indicator");
single_value->field_priority__Class__Indicator.log_match(match_value.priority__Class__Indicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", priority_Class_Indicator := ");
single_value->field_priority__Class__Indicator.log_match(match_value.priority__Class__Indicator(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__OVERLOAD_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_priority__Class__Indicator.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
}
}

void PDU__BSSGP__OVERLOAD_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_priority__Class__Indicator.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__OVERLOAD_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD.");
}
}

void PDU__BSSGP__OVERLOAD_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__OVERLOAD_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_OVERLOAD has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) priority__Class__Indicator().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority_Class_Indicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority__Class__Indicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_OVERLOAD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__OVERLOAD_template* precondition = new PDU__BSSGP__OVERLOAD_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__OVERLOAD_template* implied_template = new PDU__BSSGP__OVERLOAD_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__OVERLOAD_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_OVERLOAD");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__OVERLOAD_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_OVERLOAD");
single_value->field_priority__Class__Indicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_OVERLOAD");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_OVERLOAD");
}

boolean PDU__BSSGP__OVERLOAD_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__OVERLOAD_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST::PDU__BSSGP__PERFORM__LOCATION__REQUEST()
{
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST::PDU__BSSGP__PERFORM__LOCATION__REQUEST(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const IMSI__BSSGP& par_iMSI,
    const OPTIONAL< DRX__Parameters >& par_dRX__Parameters,
    const BVCI& par_bVCI,
    const NSEI__BSSGP& par_nSEI,
    const Location__Type__BSSGP& par_location__Type,
    const Cell__Identifier& par_cell__Identifier,
    const OPTIONAL< LCS__Capability__BSSGP >& par_lCS__Capability,
    const OPTIONAL< LCS__Priority__BSSGP >& par_lCS__Priority,
    const OPTIONAL< LCS__QoS__BSSGP >& par_lCS__QoS,
    const OPTIONAL< LCS__Client__Type__BSSGP >& par_lCS__Client__Type,
    const OPTIONAL< Requested__GPS__Assistance__Data__BSSGP >& par_requested__GPS__Assistance__Data,
    const OPTIONAL< IMEI__BSSGP >& par_iMEI,
    const OPTIONAL< GANSS__Location__Type >& par_gANSS__Location__Type,
    const OPTIONAL< Requested__GANSS__Assistance__Data >& par_requested__GANSS__Assistance__Data,
    const OPTIONAL< EDRX__Parameters >& par_eDRX__Parameters)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_iMSI(par_iMSI),
  field_dRX__Parameters(par_dRX__Parameters),
  field_bVCI(par_bVCI),
  field_nSEI(par_nSEI),
  field_location__Type(par_location__Type),
  field_cell__Identifier(par_cell__Identifier),
  field_lCS__Capability(par_lCS__Capability),
  field_lCS__Priority(par_lCS__Priority),
  field_lCS__QoS(par_lCS__QoS),
  field_lCS__Client__Type(par_lCS__Client__Type),
  field_requested__GPS__Assistance__Data(par_requested__GPS__Assistance__Data),
  field_iMEI(par_iMEI),
  field_gANSS__Location__Type(par_gANSS__Location__Type),
  field_requested__GANSS__Assistance__Data(par_requested__GANSS__Assistance__Data),
  field_eDRX__Parameters(par_eDRX__Parameters)
{
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST::PDU__BSSGP__PERFORM__LOCATION__REQUEST(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
else field_dRX__Parameters.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.nSEI().is_bound()) field_nSEI = other_value.nSEI();
else field_nSEI.clean_up();
if (other_value.location__Type().is_bound()) field_location__Type = other_value.location__Type();
else field_location__Type.clean_up();
if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
else field_cell__Identifier.clean_up();
if (other_value.lCS__Capability().is_bound()) field_lCS__Capability = other_value.lCS__Capability();
else field_lCS__Capability.clean_up();
if (other_value.lCS__Priority().is_bound()) field_lCS__Priority = other_value.lCS__Priority();
else field_lCS__Priority.clean_up();
if (other_value.lCS__QoS().is_bound()) field_lCS__QoS = other_value.lCS__QoS();
else field_lCS__QoS.clean_up();
if (other_value.lCS__Client__Type().is_bound()) field_lCS__Client__Type = other_value.lCS__Client__Type();
else field_lCS__Client__Type.clean_up();
if (other_value.requested__GPS__Assistance__Data().is_bound()) field_requested__GPS__Assistance__Data = other_value.requested__GPS__Assistance__Data();
else field_requested__GPS__Assistance__Data.clean_up();
if (other_value.iMEI().is_bound()) field_iMEI = other_value.iMEI();
else field_iMEI.clean_up();
if (other_value.gANSS__Location__Type().is_bound()) field_gANSS__Location__Type = other_value.gANSS__Location__Type();
else field_gANSS__Location__Type.clean_up();
if (other_value.requested__GANSS__Assistance__Data().is_bound()) field_requested__GANSS__Assistance__Data = other_value.requested__GANSS__Assistance__Data();
else field_requested__GANSS__Assistance__Data.clean_up();
if (other_value.eDRX__Parameters().is_bound()) field_eDRX__Parameters = other_value.eDRX__Parameters();
else field_eDRX__Parameters.clean_up();
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_iMSI.clean_up();
field_dRX__Parameters.clean_up();
field_bVCI.clean_up();
field_nSEI.clean_up();
field_location__Type.clean_up();
field_cell__Identifier.clean_up();
field_lCS__Capability.clean_up();
field_lCS__Priority.clean_up();
field_lCS__QoS.clean_up();
field_lCS__Client__Type.clean_up();
field_requested__GPS__Assistance__Data.clean_up();
field_iMEI.clean_up();
field_gANSS__Location__Type.clean_up();
field_requested__GANSS__Assistance__Data.clean_up();
field_eDRX__Parameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PERFORM__LOCATION__REQUEST::get_descriptor() const { return &PDU__BSSGP__PERFORM__LOCATION__REQUEST_descr_; }
PDU__BSSGP__PERFORM__LOCATION__REQUEST& PDU__BSSGP__PERFORM__LOCATION__REQUEST::operator=(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
  else field_dRX__Parameters.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.nSEI().is_bound()) field_nSEI = other_value.nSEI();
  else field_nSEI.clean_up();
  if (other_value.location__Type().is_bound()) field_location__Type = other_value.location__Type();
  else field_location__Type.clean_up();
  if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
  else field_cell__Identifier.clean_up();
  if (other_value.lCS__Capability().is_bound()) field_lCS__Capability = other_value.lCS__Capability();
  else field_lCS__Capability.clean_up();
  if (other_value.lCS__Priority().is_bound()) field_lCS__Priority = other_value.lCS__Priority();
  else field_lCS__Priority.clean_up();
  if (other_value.lCS__QoS().is_bound()) field_lCS__QoS = other_value.lCS__QoS();
  else field_lCS__QoS.clean_up();
  if (other_value.lCS__Client__Type().is_bound()) field_lCS__Client__Type = other_value.lCS__Client__Type();
  else field_lCS__Client__Type.clean_up();
  if (other_value.requested__GPS__Assistance__Data().is_bound()) field_requested__GPS__Assistance__Data = other_value.requested__GPS__Assistance__Data();
  else field_requested__GPS__Assistance__Data.clean_up();
  if (other_value.iMEI().is_bound()) field_iMEI = other_value.iMEI();
  else field_iMEI.clean_up();
  if (other_value.gANSS__Location__Type().is_bound()) field_gANSS__Location__Type = other_value.gANSS__Location__Type();
  else field_gANSS__Location__Type.clean_up();
  if (other_value.requested__GANSS__Assistance__Data().is_bound()) field_requested__GANSS__Assistance__Data = other_value.requested__GANSS__Assistance__Data();
  else field_requested__GANSS__Assistance__Data.clean_up();
  if (other_value.eDRX__Parameters().is_bound()) field_eDRX__Parameters = other_value.eDRX__Parameters();
  else field_eDRX__Parameters.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST::operator==(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_iMSI==other_value.field_iMSI
  && field_dRX__Parameters==other_value.field_dRX__Parameters
  && field_bVCI==other_value.field_bVCI
  && field_nSEI==other_value.field_nSEI
  && field_location__Type==other_value.field_location__Type
  && field_cell__Identifier==other_value.field_cell__Identifier
  && field_lCS__Capability==other_value.field_lCS__Capability
  && field_lCS__Priority==other_value.field_lCS__Priority
  && field_lCS__QoS==other_value.field_lCS__QoS
  && field_lCS__Client__Type==other_value.field_lCS__Client__Type
  && field_requested__GPS__Assistance__Data==other_value.field_requested__GPS__Assistance__Data
  && field_iMEI==other_value.field_iMEI
  && field_gANSS__Location__Type==other_value.field_gANSS__Location__Type
  && field_requested__GANSS__Assistance__Data==other_value.field_requested__GANSS__Assistance__Data
  && field_eDRX__Parameters==other_value.field_eDRX__Parameters;
}

boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_dRX__Parameters.get_selection() || field_dRX__Parameters.is_bound())
  || (field_bVCI.is_bound())
  || (field_nSEI.is_bound())
  || (field_location__Type.is_bound())
  || (field_cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_lCS__Capability.get_selection() || field_lCS__Capability.is_bound())
  || (OPTIONAL_OMIT == field_lCS__Priority.get_selection() || field_lCS__Priority.is_bound())
  || (OPTIONAL_OMIT == field_lCS__QoS.get_selection() || field_lCS__QoS.is_bound())
  || (OPTIONAL_OMIT == field_lCS__Client__Type.get_selection() || field_lCS__Client__Type.is_bound())
  || (OPTIONAL_OMIT == field_requested__GPS__Assistance__Data.get_selection() || field_requested__GPS__Assistance__Data.is_bound())
  || (OPTIONAL_OMIT == field_iMEI.get_selection() || field_iMEI.is_bound())
  || (OPTIONAL_OMIT == field_gANSS__Location__Type.get_selection() || field_gANSS__Location__Type.is_bound())
  || (OPTIONAL_OMIT == field_requested__GANSS__Assistance__Data.get_selection() || field_requested__GANSS__Assistance__Data.is_bound())
  || (OPTIONAL_OMIT == field_eDRX__Parameters.get_selection() || field_eDRX__Parameters.is_bound());
}
boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_iMSI.is_value()
  && (OPTIONAL_OMIT == field_dRX__Parameters.get_selection() || field_dRX__Parameters.is_value())
  && field_bVCI.is_value()
  && field_nSEI.is_value()
  && field_location__Type.is_value()
  && field_cell__Identifier.is_value()
  && (OPTIONAL_OMIT == field_lCS__Capability.get_selection() || field_lCS__Capability.is_value())
  && (OPTIONAL_OMIT == field_lCS__Priority.get_selection() || field_lCS__Priority.is_value())
  && (OPTIONAL_OMIT == field_lCS__QoS.get_selection() || field_lCS__QoS.is_value())
  && (OPTIONAL_OMIT == field_lCS__Client__Type.get_selection() || field_lCS__Client__Type.is_value())
  && (OPTIONAL_OMIT == field_requested__GPS__Assistance__Data.get_selection() || field_requested__GPS__Assistance__Data.is_value())
  && (OPTIONAL_OMIT == field_iMEI.get_selection() || field_iMEI.is_value())
  && (OPTIONAL_OMIT == field_gANSS__Location__Type.get_selection() || field_gANSS__Location__Type.is_value())
  && (OPTIONAL_OMIT == field_requested__GANSS__Assistance__Data.get_selection() || field_requested__GANSS__Assistance__Data.is_value())
  && (OPTIONAL_OMIT == field_eDRX__Parameters.get_selection() || field_eDRX__Parameters.is_value());
}
int PDU__BSSGP__PERFORM__LOCATION__REQUEST::size_of() const
{
  int ret_val = 7;
  if (field_dRX__Parameters.ispresent()) ret_val++;
  if (field_lCS__Capability.ispresent()) ret_val++;
  if (field_lCS__Priority.ispresent()) ret_val++;
  if (field_lCS__QoS.ispresent()) ret_val++;
  if (field_lCS__Client__Type.ispresent()) ret_val++;
  if (field_requested__GPS__Assistance__Data.ispresent()) ret_val++;
  if (field_iMEI.ispresent()) ret_val++;
  if (field_gANSS__Location__Type.ispresent()) ret_val++;
  if (field_requested__GANSS__Assistance__Data.ispresent()) ret_val++;
  if (field_eDRX__Parameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", nSEI := ");
field_nSEI.log();
TTCN_Logger::log_event_str(", location_Type := ");
field_location__Type.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
field_cell__Identifier.log();
TTCN_Logger::log_event_str(", lCS_Capability := ");
field_lCS__Capability.log();
TTCN_Logger::log_event_str(", lCS_Priority := ");
field_lCS__Priority.log();
TTCN_Logger::log_event_str(", lCS_QoS := ");
field_lCS__QoS.log();
TTCN_Logger::log_event_str(", lCS_Client_Type := ");
field_lCS__Client__Type.log();
TTCN_Logger::log_event_str(", requested_GPS_Assistance_Data := ");
field_requested__GPS__Assistance__Data.log();
TTCN_Logger::log_event_str(", iMEI := ");
field_iMEI.log();
TTCN_Logger::log_event_str(", gANSS_Location_Type := ");
field_gANSS__Location__Type.log();
TTCN_Logger::log_event_str(", requested_GANSS_Assistance_Data := ");
field_requested__GANSS__Assistance__Data.log();
TTCN_Logger::log_event_str(", eDRX_Parameters := ");
field_eDRX__Parameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (!dRX__Parameters().is_bound()) dRX__Parameters() = OMIT_VALUE;
else dRX__Parameters().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (nSEI().is_bound()) nSEI().set_implicit_omit();
if (location__Type().is_bound()) location__Type().set_implicit_omit();
if (cell__Identifier().is_bound()) cell__Identifier().set_implicit_omit();
if (!lCS__Capability().is_bound()) lCS__Capability() = OMIT_VALUE;
else lCS__Capability().set_implicit_omit();
if (!lCS__Priority().is_bound()) lCS__Priority() = OMIT_VALUE;
else lCS__Priority().set_implicit_omit();
if (!lCS__QoS().is_bound()) lCS__QoS() = OMIT_VALUE;
else lCS__QoS().set_implicit_omit();
if (!lCS__Client__Type().is_bound()) lCS__Client__Type() = OMIT_VALUE;
else lCS__Client__Type().set_implicit_omit();
if (!requested__GPS__Assistance__Data().is_bound()) requested__GPS__Assistance__Data() = OMIT_VALUE;
else requested__GPS__Assistance__Data().set_implicit_omit();
if (!iMEI().is_bound()) iMEI() = OMIT_VALUE;
else iMEI().set_implicit_omit();
if (!gANSS__Location__Type().is_bound()) gANSS__Location__Type() = OMIT_VALUE;
else gANSS__Location__Type().set_implicit_omit();
if (!requested__GANSS__Assistance__Data().is_bound()) requested__GANSS__Assistance__Data() = OMIT_VALUE;
else requested__GANSS__Assistance__Data().set_implicit_omit();
if (!eDRX__Parameters().is_bound()) eDRX__Parameters() = OMIT_VALUE;
else eDRX__Parameters().set_implicit_omit();
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (17<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST has 17 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nSEI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) location__Type().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) lCS__Capability().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) lCS__Priority().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) lCS__QoS().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) lCS__Client__Type().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) requested__GPS__Assistance__Data().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) iMEI().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) gANSS__Location__Type().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) requested__GANSS__Assistance__Data().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) eDRX__Parameters().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "location_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          location__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_QoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__QoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Client_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Client__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requested_GPS_Assistance_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requested__GPS__Assistance__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gANSS_Location_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANSS__Location__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requested_GANSS_Assistance_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requested__GANSS__Assistance__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eDRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
  }
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_dRX__Parameters.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_nSEI.encode_text(text_buf);
field_location__Type.encode_text(text_buf);
field_cell__Identifier.encode_text(text_buf);
field_lCS__Capability.encode_text(text_buf);
field_lCS__Priority.encode_text(text_buf);
field_lCS__QoS.encode_text(text_buf);
field_lCS__Client__Type.encode_text(text_buf);
field_requested__GPS__Assistance__Data.encode_text(text_buf);
field_iMEI.encode_text(text_buf);
field_gANSS__Location__Type.encode_text(text_buf);
field_requested__GANSS__Assistance__Data.encode_text(text_buf);
field_eDRX__Parameters.encode_text(text_buf);
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_dRX__Parameters.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_nSEI.decode_text(text_buf);
field_location__Type.decode_text(text_buf);
field_cell__Identifier.decode_text(text_buf);
field_lCS__Capability.decode_text(text_buf);
field_lCS__Priority.decode_text(text_buf);
field_lCS__QoS.decode_text(text_buf);
field_lCS__Client__Type.decode_text(text_buf);
field_requested__GPS__Assistance__Data.decode_text(text_buf);
field_iMEI.decode_text(text_buf);
field_gANSS__Location__Type.decode_text(text_buf);
field_requested__GANSS__Assistance__Data.decode_text(text_buf);
field_eDRX__Parameters.decode_text(text_buf);
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__PERFORM__LOCATION__REQUEST::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_dRX__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, DRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_dRX__Parameters().RAW_decode(DRX__Parameters_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_dRX__Parameters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dRX__Parameters=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_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, NSEI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_nSEI.RAW_decode(NSEI__BSSGP_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, Location__Type__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_location__Type.RAW_decode(Location__Type__BSSGP_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, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_cell__Identifier.RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_lCS__Capability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, LCS__Capability__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lCS__Capability().RAW_decode(LCS__Capability__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_lCS__Capability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lCS__Capability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_lCS__Priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, LCS__Priority__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lCS__Priority().RAW_decode(LCS__Priority__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_lCS__Priority = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lCS__Priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_lCS__QoS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, LCS__QoS__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lCS__QoS().RAW_decode(LCS__QoS__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_lCS__QoS = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lCS__QoS=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_lCS__Client__Type = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, LCS__Client__Type__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lCS__Client__Type().RAW_decode(LCS__Client__Type__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_lCS__Client__Type = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lCS__Client__Type=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_requested__GPS__Assistance__Data = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, Requested__GPS__Assistance__Data__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_requested__GPS__Assistance__Data().RAW_decode(Requested__GPS__Assistance__Data__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_requested__GPS__Assistance__Data = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_requested__GPS__Assistance__Data=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_iMEI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, IMEI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMEI().RAW_decode(IMEI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_iMEI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iMEI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_gANSS__Location__Type = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, GANSS__Location__Type_descr_.raw->forceomit);
  decoded_field_length = field_gANSS__Location__Type().RAW_decode(GANSS__Location__Type_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_gANSS__Location__Type = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_gANSS__Location__Type=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_requested__GANSS__Assistance__Data = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, Requested__GANSS__Assistance__Data_descr_.raw->forceomit);
  decoded_field_length = field_requested__GANSS__Assistance__Data().RAW_decode(Requested__GANSS__Assistance__Data_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_requested__GANSS__Assistance__Data = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_requested__GANSS__Assistance__Data=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_eDRX__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, EDRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_eDRX__Parameters().RAW_decode(EDRX__Parameters_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_eDRX__Parameters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_eDRX__Parameters=OMIT_VALUE;
  if (field_bssgpPduType !=  os_121) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PERFORM__LOCATION__REQUEST::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 17;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(17);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMSI__BSSGP_descr_.raw);
  if (field_dRX__Parameters.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, DRX__Parameters_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, BVCI_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, NSEI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Location__Type__BSSGP_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Cell__Identifier_descr_.raw);
  if (field_lCS__Capability.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, LCS__Capability__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_lCS__Priority.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, LCS__Priority__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_lCS__QoS.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, LCS__QoS__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_lCS__Client__Type.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, LCS__Client__Type__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_requested__GPS__Assistance__Data.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, Requested__GPS__Assistance__Data__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_iMEI.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, IMEI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_gANSS__Location__Type.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, GANSS__Location__Type_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_requested__GANSS__Assistance__Data.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, Requested__GANSS__Assistance__Data_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_eDRX__Parameters.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, EDRX__Parameters_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_dRX__Parameters.ispresent()) {
  encoded_length += field_dRX__Parameters().RAW_encode(DRX__Parameters_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_nSEI.RAW_encode(NSEI__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_location__Type.RAW_encode(Location__Type__BSSGP_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_cell__Identifier.RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[7]);
  if (field_lCS__Capability.ispresent()) {
  encoded_length += field_lCS__Capability().RAW_encode(LCS__Capability__BSSGP_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_lCS__Priority.ispresent()) {
  encoded_length += field_lCS__Priority().RAW_encode(LCS__Priority__BSSGP_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_lCS__QoS.ispresent()) {
  encoded_length += field_lCS__QoS().RAW_encode(LCS__QoS__BSSGP_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_lCS__Client__Type.ispresent()) {
  encoded_length += field_lCS__Client__Type().RAW_encode(LCS__Client__Type__BSSGP_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_requested__GPS__Assistance__Data.ispresent()) {
  encoded_length += field_requested__GPS__Assistance__Data().RAW_encode(Requested__GPS__Assistance__Data__BSSGP_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_iMEI.ispresent()) {
  encoded_length += field_iMEI().RAW_encode(IMEI__BSSGP_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_gANSS__Location__Type.ispresent()) {
  encoded_length += field_gANSS__Location__Type().RAW_encode(GANSS__Location__Type_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_requested__GANSS__Assistance__Data.ispresent()) {
  encoded_length += field_requested__GANSS__Assistance__Data().RAW_encode(Requested__GANSS__Assistance__Data_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_eDRX__Parameters.ispresent()) {
  encoded_length += field_eDRX__Parameters().RAW_encode(EDRX__Parameters_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_bssgpPduType !=  os_121) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_121.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
IMSI__BSSGP_template field_iMSI;
DRX__Parameters_template field_dRX__Parameters;
BVCI_template field_bVCI;
NSEI__BSSGP_template field_nSEI;
Location__Type__BSSGP_template field_location__Type;
Cell__Identifier_template field_cell__Identifier;
LCS__Capability__BSSGP_template field_lCS__Capability;
LCS__Priority__BSSGP_template field_lCS__Priority;
LCS__QoS__BSSGP_template field_lCS__QoS;
LCS__Client__Type__BSSGP_template field_lCS__Client__Type;
Requested__GPS__Assistance__Data__BSSGP_template field_requested__GPS__Assistance__Data;
IMEI__BSSGP_template field_iMEI;
GANSS__Location__Type_template field_gANSS__Location__Type;
Requested__GANSS__Assistance__Data_template field_requested__GANSS__Assistance__Data;
EDRX__Parameters_template field_eDRX__Parameters;
};

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_dRX__Parameters = ANY_OR_OMIT;
single_value->field_bVCI = ANY_VALUE;
single_value->field_nSEI = ANY_VALUE;
single_value->field_location__Type = ANY_VALUE;
single_value->field_cell__Identifier = ANY_VALUE;
single_value->field_lCS__Capability = ANY_OR_OMIT;
single_value->field_lCS__Priority = ANY_OR_OMIT;
single_value->field_lCS__QoS = ANY_OR_OMIT;
single_value->field_lCS__Client__Type = ANY_OR_OMIT;
single_value->field_requested__GPS__Assistance__Data = ANY_OR_OMIT;
single_value->field_iMEI = ANY_OR_OMIT;
single_value->field_gANSS__Location__Type = ANY_OR_OMIT;
single_value->field_requested__GANSS__Assistance__Data = ANY_OR_OMIT;
single_value->field_eDRX__Parameters = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::copy_value(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.dRX__Parameters().is_bound()) {
  if (other_value.dRX__Parameters().ispresent()) single_value->field_dRX__Parameters = other_value.dRX__Parameters()();
  else single_value->field_dRX__Parameters = OMIT_VALUE;
} else {
  single_value->field_dRX__Parameters.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.nSEI().is_bound()) {
  single_value->field_nSEI = other_value.nSEI();
} else {
  single_value->field_nSEI.clean_up();
}
if (other_value.location__Type().is_bound()) {
  single_value->field_location__Type = other_value.location__Type();
} else {
  single_value->field_location__Type.clean_up();
}
if (other_value.cell__Identifier().is_bound()) {
  single_value->field_cell__Identifier = other_value.cell__Identifier();
} else {
  single_value->field_cell__Identifier.clean_up();
}
if (other_value.lCS__Capability().is_bound()) {
  if (other_value.lCS__Capability().ispresent()) single_value->field_lCS__Capability = other_value.lCS__Capability()();
  else single_value->field_lCS__Capability = OMIT_VALUE;
} else {
  single_value->field_lCS__Capability.clean_up();
}
if (other_value.lCS__Priority().is_bound()) {
  if (other_value.lCS__Priority().ispresent()) single_value->field_lCS__Priority = other_value.lCS__Priority()();
  else single_value->field_lCS__Priority = OMIT_VALUE;
} else {
  single_value->field_lCS__Priority.clean_up();
}
if (other_value.lCS__QoS().is_bound()) {
  if (other_value.lCS__QoS().ispresent()) single_value->field_lCS__QoS = other_value.lCS__QoS()();
  else single_value->field_lCS__QoS = OMIT_VALUE;
} else {
  single_value->field_lCS__QoS.clean_up();
}
if (other_value.lCS__Client__Type().is_bound()) {
  if (other_value.lCS__Client__Type().ispresent()) single_value->field_lCS__Client__Type = other_value.lCS__Client__Type()();
  else single_value->field_lCS__Client__Type = OMIT_VALUE;
} else {
  single_value->field_lCS__Client__Type.clean_up();
}
if (other_value.requested__GPS__Assistance__Data().is_bound()) {
  if (other_value.requested__GPS__Assistance__Data().ispresent()) single_value->field_requested__GPS__Assistance__Data = other_value.requested__GPS__Assistance__Data()();
  else single_value->field_requested__GPS__Assistance__Data = OMIT_VALUE;
} else {
  single_value->field_requested__GPS__Assistance__Data.clean_up();
}
if (other_value.iMEI().is_bound()) {
  if (other_value.iMEI().ispresent()) single_value->field_iMEI = other_value.iMEI()();
  else single_value->field_iMEI = OMIT_VALUE;
} else {
  single_value->field_iMEI.clean_up();
}
if (other_value.gANSS__Location__Type().is_bound()) {
  if (other_value.gANSS__Location__Type().ispresent()) single_value->field_gANSS__Location__Type = other_value.gANSS__Location__Type()();
  else single_value->field_gANSS__Location__Type = OMIT_VALUE;
} else {
  single_value->field_gANSS__Location__Type.clean_up();
}
if (other_value.requested__GANSS__Assistance__Data().is_bound()) {
  if (other_value.requested__GANSS__Assistance__Data().ispresent()) single_value->field_requested__GANSS__Assistance__Data = other_value.requested__GANSS__Assistance__Data()();
  else single_value->field_requested__GANSS__Assistance__Data = OMIT_VALUE;
} else {
  single_value->field_requested__GANSS__Assistance__Data.clean_up();
}
if (other_value.eDRX__Parameters().is_bound()) {
  if (other_value.eDRX__Parameters().ispresent()) single_value->field_eDRX__Parameters = other_value.eDRX__Parameters()();
  else single_value->field_eDRX__Parameters = OMIT_VALUE;
} else {
  single_value->field_eDRX__Parameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::copy_template(const PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dRX__Parameters().get_selection()) {
single_value->field_dRX__Parameters = other_value.dRX__Parameters();
} else {
single_value->field_dRX__Parameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nSEI().get_selection()) {
single_value->field_nSEI = other_value.nSEI();
} else {
single_value->field_nSEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.location__Type().get_selection()) {
single_value->field_location__Type = other_value.location__Type();
} else {
single_value->field_location__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__Identifier().get_selection()) {
single_value->field_cell__Identifier = other_value.cell__Identifier();
} else {
single_value->field_cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__Capability().get_selection()) {
single_value->field_lCS__Capability = other_value.lCS__Capability();
} else {
single_value->field_lCS__Capability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__Priority().get_selection()) {
single_value->field_lCS__Priority = other_value.lCS__Priority();
} else {
single_value->field_lCS__Priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__QoS().get_selection()) {
single_value->field_lCS__QoS = other_value.lCS__QoS();
} else {
single_value->field_lCS__QoS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__Client__Type().get_selection()) {
single_value->field_lCS__Client__Type = other_value.lCS__Client__Type();
} else {
single_value->field_lCS__Client__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requested__GPS__Assistance__Data().get_selection()) {
single_value->field_requested__GPS__Assistance__Data = other_value.requested__GPS__Assistance__Data();
} else {
single_value->field_requested__GPS__Assistance__Data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMEI().get_selection()) {
single_value->field_iMEI = other_value.iMEI();
} else {
single_value->field_iMEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gANSS__Location__Type().get_selection()) {
single_value->field_gANSS__Location__Type = other_value.gANSS__Location__Type();
} else {
single_value->field_gANSS__Location__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requested__GANSS__Assistance__Data().get_selection()) {
single_value->field_requested__GANSS__Assistance__Data = other_value.requested__GANSS__Assistance__Data();
} else {
single_value->field_requested__GANSS__Assistance__Data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eDRX__Parameters().get_selection()) {
single_value->field_eDRX__Parameters = other_value.eDRX__Parameters();
} else {
single_value->field_eDRX__Parameters.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__REQUEST_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::PDU__BSSGP__PERFORM__LOCATION__REQUEST_template()
{
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(const OPTIONAL<PDU__BSSGP__PERFORM__LOCATION__REQUEST>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PERFORM__LOCATION__REQUEST&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST from an unbound optional field.");
}
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(PDU__BSSGP__PERFORM__LOCATION__REQUEST_template* p_precondition, PDU__BSSGP__PERFORM__LOCATION__REQUEST_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(Dynamic_Match_Interface<PDU__BSSGP__PERFORM__LOCATION__REQUEST>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__PERFORM__LOCATION__REQUEST>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(const PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::~PDU__BSSGP__PERFORM__LOCATION__REQUEST_template()
{
clean_up();
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::operator=(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::operator=(const OPTIONAL<PDU__BSSGP__PERFORM__LOCATION__REQUEST>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PERFORM__LOCATION__REQUEST&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
}
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::operator=(const PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::match(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.dRX__Parameters().is_bound()) return FALSE;
if((other_value.dRX__Parameters().ispresent() ? !single_value->field_dRX__Parameters.match((const DRX__Parameters&)other_value.dRX__Parameters(), legacy) : !single_value->field_dRX__Parameters.match_omit(legacy)))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.nSEI().is_bound()) return FALSE;
if(!single_value->field_nSEI.match(other_value.nSEI(), legacy))return FALSE;
if(!other_value.location__Type().is_bound()) return FALSE;
if(!single_value->field_location__Type.match(other_value.location__Type(), legacy))return FALSE;
if(!other_value.cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_cell__Identifier.match(other_value.cell__Identifier(), legacy))return FALSE;
if(!other_value.lCS__Capability().is_bound()) return FALSE;
if((other_value.lCS__Capability().ispresent() ? !single_value->field_lCS__Capability.match((const LCS__Capability__BSSGP&)other_value.lCS__Capability(), legacy) : !single_value->field_lCS__Capability.match_omit(legacy)))return FALSE;
if(!other_value.lCS__Priority().is_bound()) return FALSE;
if((other_value.lCS__Priority().ispresent() ? !single_value->field_lCS__Priority.match((const LCS__Priority__BSSGP&)other_value.lCS__Priority(), legacy) : !single_value->field_lCS__Priority.match_omit(legacy)))return FALSE;
if(!other_value.lCS__QoS().is_bound()) return FALSE;
if((other_value.lCS__QoS().ispresent() ? !single_value->field_lCS__QoS.match((const LCS__QoS__BSSGP&)other_value.lCS__QoS(), legacy) : !single_value->field_lCS__QoS.match_omit(legacy)))return FALSE;
if(!other_value.lCS__Client__Type().is_bound()) return FALSE;
if((other_value.lCS__Client__Type().ispresent() ? !single_value->field_lCS__Client__Type.match((const LCS__Client__Type__BSSGP&)other_value.lCS__Client__Type(), legacy) : !single_value->field_lCS__Client__Type.match_omit(legacy)))return FALSE;
if(!other_value.requested__GPS__Assistance__Data().is_bound()) return FALSE;
if((other_value.requested__GPS__Assistance__Data().ispresent() ? !single_value->field_requested__GPS__Assistance__Data.match((const Requested__GPS__Assistance__Data__BSSGP&)other_value.requested__GPS__Assistance__Data(), legacy) : !single_value->field_requested__GPS__Assistance__Data.match_omit(legacy)))return FALSE;
if(!other_value.iMEI().is_bound()) return FALSE;
if((other_value.iMEI().ispresent() ? !single_value->field_iMEI.match((const IMEI__BSSGP&)other_value.iMEI(), legacy) : !single_value->field_iMEI.match_omit(legacy)))return FALSE;
if(!other_value.gANSS__Location__Type().is_bound()) return FALSE;
if((other_value.gANSS__Location__Type().ispresent() ? !single_value->field_gANSS__Location__Type.match((const GANSS__Location__Type&)other_value.gANSS__Location__Type(), legacy) : !single_value->field_gANSS__Location__Type.match_omit(legacy)))return FALSE;
if(!other_value.requested__GANSS__Assistance__Data().is_bound()) return FALSE;
if((other_value.requested__GANSS__Assistance__Data().ispresent() ? !single_value->field_requested__GANSS__Assistance__Data.match((const Requested__GANSS__Assistance__Data&)other_value.requested__GANSS__Assistance__Data(), legacy) : !single_value->field_requested__GANSS__Assistance__Data.match_omit(legacy)))return FALSE;
if(!other_value.eDRX__Parameters().is_bound()) return FALSE;
if((other_value.eDRX__Parameters().ispresent() ? !single_value->field_eDRX__Parameters.match((const EDRX__Parameters&)other_value.eDRX__Parameters(), legacy) : !single_value->field_eDRX__Parameters.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
}
return FALSE;
}

boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_iMSI.is_bound()
 || (single_value->field_dRX__Parameters.is_omit() || single_value->field_dRX__Parameters.is_bound())
 || single_value->field_bVCI.is_bound()
 || single_value->field_nSEI.is_bound()
 || single_value->field_location__Type.is_bound()
 || single_value->field_cell__Identifier.is_bound()
 || (single_value->field_lCS__Capability.is_omit() || single_value->field_lCS__Capability.is_bound())
 || (single_value->field_lCS__Priority.is_omit() || single_value->field_lCS__Priority.is_bound())
 || (single_value->field_lCS__QoS.is_omit() || single_value->field_lCS__QoS.is_bound())
 || (single_value->field_lCS__Client__Type.is_omit() || single_value->field_lCS__Client__Type.is_bound())
 || (single_value->field_requested__GPS__Assistance__Data.is_omit() || single_value->field_requested__GPS__Assistance__Data.is_bound())
 || (single_value->field_iMEI.is_omit() || single_value->field_iMEI.is_bound())
 || (single_value->field_gANSS__Location__Type.is_omit() || single_value->field_gANSS__Location__Type.is_bound())
 || (single_value->field_requested__GANSS__Assistance__Data.is_omit() || single_value->field_requested__GANSS__Assistance__Data.is_bound())
 || (single_value->field_eDRX__Parameters.is_omit() || single_value->field_eDRX__Parameters.is_bound());
}

boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_iMSI.is_value()
 && (single_value->field_dRX__Parameters.is_omit() || single_value->field_dRX__Parameters.is_value())
 && single_value->field_bVCI.is_value()
 && single_value->field_nSEI.is_value()
 && single_value->field_location__Type.is_value()
 && single_value->field_cell__Identifier.is_value()
 && (single_value->field_lCS__Capability.is_omit() || single_value->field_lCS__Capability.is_value())
 && (single_value->field_lCS__Priority.is_omit() || single_value->field_lCS__Priority.is_value())
 && (single_value->field_lCS__QoS.is_omit() || single_value->field_lCS__QoS.is_value())
 && (single_value->field_lCS__Client__Type.is_omit() || single_value->field_lCS__Client__Type.is_value())
 && (single_value->field_requested__GPS__Assistance__Data.is_omit() || single_value->field_requested__GPS__Assistance__Data.is_value())
 && (single_value->field_iMEI.is_omit() || single_value->field_iMEI.is_value())
 && (single_value->field_gANSS__Location__Type.is_omit() || single_value->field_gANSS__Location__Type.is_value())
 && (single_value->field_requested__GANSS__Assistance__Data.is_omit() || single_value->field_requested__GANSS__Assistance__Data.is_value())
 && (single_value->field_eDRX__Parameters.is_omit() || single_value->field_eDRX__Parameters.is_value());
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
PDU__BSSGP__PERFORM__LOCATION__REQUEST ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_dRX__Parameters.is_omit()) ret_val.dRX__Parameters() = OMIT_VALUE;
else if (single_value->field_dRX__Parameters.is_bound()) {
ret_val.dRX__Parameters() = single_value->field_dRX__Parameters.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_nSEI.is_bound()) {
ret_val.nSEI() = single_value->field_nSEI.valueof();
}
if (single_value->field_location__Type.is_bound()) {
ret_val.location__Type() = single_value->field_location__Type.valueof();
}
if (single_value->field_cell__Identifier.is_bound()) {
ret_val.cell__Identifier() = single_value->field_cell__Identifier.valueof();
}
if (single_value->field_lCS__Capability.is_omit()) ret_val.lCS__Capability() = OMIT_VALUE;
else if (single_value->field_lCS__Capability.is_bound()) {
ret_val.lCS__Capability() = single_value->field_lCS__Capability.valueof();
}
if (single_value->field_lCS__Priority.is_omit()) ret_val.lCS__Priority() = OMIT_VALUE;
else if (single_value->field_lCS__Priority.is_bound()) {
ret_val.lCS__Priority() = single_value->field_lCS__Priority.valueof();
}
if (single_value->field_lCS__QoS.is_omit()) ret_val.lCS__QoS() = OMIT_VALUE;
else if (single_value->field_lCS__QoS.is_bound()) {
ret_val.lCS__QoS() = single_value->field_lCS__QoS.valueof();
}
if (single_value->field_lCS__Client__Type.is_omit()) ret_val.lCS__Client__Type() = OMIT_VALUE;
else if (single_value->field_lCS__Client__Type.is_bound()) {
ret_val.lCS__Client__Type() = single_value->field_lCS__Client__Type.valueof();
}
if (single_value->field_requested__GPS__Assistance__Data.is_omit()) ret_val.requested__GPS__Assistance__Data() = OMIT_VALUE;
else if (single_value->field_requested__GPS__Assistance__Data.is_bound()) {
ret_val.requested__GPS__Assistance__Data() = single_value->field_requested__GPS__Assistance__Data.valueof();
}
if (single_value->field_iMEI.is_omit()) ret_val.iMEI() = OMIT_VALUE;
else if (single_value->field_iMEI.is_bound()) {
ret_val.iMEI() = single_value->field_iMEI.valueof();
}
if (single_value->field_gANSS__Location__Type.is_omit()) ret_val.gANSS__Location__Type() = OMIT_VALUE;
else if (single_value->field_gANSS__Location__Type.is_bound()) {
ret_val.gANSS__Location__Type() = single_value->field_gANSS__Location__Type.valueof();
}
if (single_value->field_requested__GANSS__Assistance__Data.is_omit()) ret_val.requested__GANSS__Assistance__Data() = OMIT_VALUE;
else if (single_value->field_requested__GANSS__Assistance__Data.is_bound()) {
ret_val.requested__GANSS__Assistance__Data() = single_value->field_requested__GANSS__Assistance__Data.valueof();
}
if (single_value->field_eDRX__Parameters.is_omit()) ret_val.eDRX__Parameters() = OMIT_VALUE;
else if (single_value->field_eDRX__Parameters.is_bound()) {
ret_val.eDRX__Parameters() = single_value->field_eDRX__Parameters.valueof();
}
return ret_val;
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__REQUEST_template[list_length];
}

PDU__BSSGP__PERFORM__LOCATION__REQUEST_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_tLLI;
}

IMSI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_iMSI;
}

DRX__Parameters_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::dRX__Parameters()
{
set_specific();
return single_value->field_dRX__Parameters;
}

const DRX__Parameters_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::dRX__Parameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dRX_Parameters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_dRX__Parameters;
}

BVCI_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_bVCI;
}

NSEI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::nSEI()
{
set_specific();
return single_value->field_nSEI;
}

const NSEI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::nSEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSEI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_nSEI;
}

Location__Type__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::location__Type()
{
set_specific();
return single_value->field_location__Type;
}

const Location__Type__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::location__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field location_Type of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_location__Type;
}

Cell__Identifier_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::cell__Identifier()
{
set_specific();
return single_value->field_cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_cell__Identifier;
}

LCS__Capability__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__Capability()
{
set_specific();
return single_value->field_lCS__Capability;
}

const LCS__Capability__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_Capability of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_lCS__Capability;
}

LCS__Priority__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__Priority()
{
set_specific();
return single_value->field_lCS__Priority;
}

const LCS__Priority__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__Priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_Priority of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_lCS__Priority;
}

LCS__QoS__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__QoS()
{
set_specific();
return single_value->field_lCS__QoS;
}

const LCS__QoS__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__QoS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_QoS of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_lCS__QoS;
}

LCS__Client__Type__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__Client__Type()
{
set_specific();
return single_value->field_lCS__Client__Type;
}

const LCS__Client__Type__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::lCS__Client__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_Client_Type of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_lCS__Client__Type;
}

Requested__GPS__Assistance__Data__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::requested__GPS__Assistance__Data()
{
set_specific();
return single_value->field_requested__GPS__Assistance__Data;
}

const Requested__GPS__Assistance__Data__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::requested__GPS__Assistance__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requested_GPS_Assistance_Data of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_requested__GPS__Assistance__Data;
}

IMEI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::iMEI()
{
set_specific();
return single_value->field_iMEI;
}

const IMEI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::iMEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMEI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_iMEI;
}

GANSS__Location__Type_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::gANSS__Location__Type()
{
set_specific();
return single_value->field_gANSS__Location__Type;
}

const GANSS__Location__Type_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::gANSS__Location__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gANSS_Location_Type of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_gANSS__Location__Type;
}

Requested__GANSS__Assistance__Data_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::requested__GANSS__Assistance__Data()
{
set_specific();
return single_value->field_requested__GANSS__Assistance__Data;
}

const Requested__GANSS__Assistance__Data_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::requested__GANSS__Assistance__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requested_GANSS_Assistance_Data of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_requested__GANSS__Assistance__Data;
}

EDRX__Parameters_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::eDRX__Parameters()
{
set_specific();
return single_value->field_eDRX__Parameters;
}

const EDRX__Parameters_template& PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::eDRX__Parameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eDRX_Parameters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
return single_value->field_eDRX__Parameters;
}

int PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 7;
      if (single_value->field_dRX__Parameters.is_present()) ret_val++;
      if (single_value->field_lCS__Capability.is_present()) ret_val++;
      if (single_value->field_lCS__Priority.is_present()) ret_val++;
      if (single_value->field_lCS__QoS.is_present()) ret_val++;
      if (single_value->field_lCS__Client__Type.is_present()) ret_val++;
      if (single_value->field_requested__GPS__Assistance__Data.is_present()) ret_val++;
      if (single_value->field_iMEI.is_present()) ret_val++;
      if (single_value->field_gANSS__Location__Type.is_present()) ret_val++;
      if (single_value->field_requested__GANSS__Assistance__Data.is_present()) ret_val++;
      if (single_value->field_eDRX__Parameters.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
  }
  return 0;
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
single_value->field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", nSEI := ");
single_value->field_nSEI.log();
TTCN_Logger::log_event_str(", location_Type := ");
single_value->field_location__Type.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
single_value->field_cell__Identifier.log();
TTCN_Logger::log_event_str(", lCS_Capability := ");
single_value->field_lCS__Capability.log();
TTCN_Logger::log_event_str(", lCS_Priority := ");
single_value->field_lCS__Priority.log();
TTCN_Logger::log_event_str(", lCS_QoS := ");
single_value->field_lCS__QoS.log();
TTCN_Logger::log_event_str(", lCS_Client_Type := ");
single_value->field_lCS__Client__Type.log();
TTCN_Logger::log_event_str(", requested_GPS_Assistance_Data := ");
single_value->field_requested__GPS__Assistance__Data.log();
TTCN_Logger::log_event_str(", iMEI := ");
single_value->field_iMEI.log();
TTCN_Logger::log_event_str(", gANSS_Location_Type := ");
single_value->field_gANSS__Location__Type.log();
TTCN_Logger::log_event_str(", requested_GANSS_Assistance_Data := ");
single_value->field_requested__GANSS__Assistance__Data.log();
TTCN_Logger::log_event_str(", eDRX_Parameters := ");
single_value->field_eDRX__Parameters.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::log_match(const PDU__BSSGP__PERFORM__LOCATION__REQUEST& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dRX__Parameters().ispresent()){
if(!single_value->field_dRX__Parameters.match(match_value.dRX__Parameters(), legacy)){
TTCN_Logger::log_logmatch_info(".dRX_Parameters");
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dRX__Parameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dRX_Parameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dRX__Parameters.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nSEI.match(match_value.nSEI(), legacy)){
TTCN_Logger::log_logmatch_info(".nSEI");
single_value->field_nSEI.log_match(match_value.nSEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_location__Type.match(match_value.location__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".location_Type");
single_value->field_location__Type.log_match(match_value.location__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__Identifier.match(match_value.cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_Identifier");
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.lCS__Capability().ispresent()){
if(!single_value->field_lCS__Capability.match(match_value.lCS__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_Capability");
single_value->field_lCS__Capability.log_match(match_value.lCS__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lCS__Capability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lCS_Capability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lCS__Capability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lCS__Priority().ispresent()){
if(!single_value->field_lCS__Priority.match(match_value.lCS__Priority(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_Priority");
single_value->field_lCS__Priority.log_match(match_value.lCS__Priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lCS__Priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lCS_Priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lCS__Priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lCS__QoS().ispresent()){
if(!single_value->field_lCS__QoS.match(match_value.lCS__QoS(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_QoS");
single_value->field_lCS__QoS.log_match(match_value.lCS__QoS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lCS__QoS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lCS_QoS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lCS__QoS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lCS__Client__Type().ispresent()){
if(!single_value->field_lCS__Client__Type.match(match_value.lCS__Client__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_Client_Type");
single_value->field_lCS__Client__Type.log_match(match_value.lCS__Client__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lCS__Client__Type.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lCS_Client_Type := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lCS__Client__Type.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.requested__GPS__Assistance__Data().ispresent()){
if(!single_value->field_requested__GPS__Assistance__Data.match(match_value.requested__GPS__Assistance__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".requested_GPS_Assistance_Data");
single_value->field_requested__GPS__Assistance__Data.log_match(match_value.requested__GPS__Assistance__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_requested__GPS__Assistance__Data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".requested_GPS_Assistance_Data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_requested__GPS__Assistance__Data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iMEI().ispresent()){
if(!single_value->field_iMEI.match(match_value.iMEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMEI");
single_value->field_iMEI.log_match(match_value.iMEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iMEI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iMEI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iMEI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gANSS__Location__Type().ispresent()){
if(!single_value->field_gANSS__Location__Type.match(match_value.gANSS__Location__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".gANSS_Location_Type");
single_value->field_gANSS__Location__Type.log_match(match_value.gANSS__Location__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gANSS__Location__Type.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gANSS_Location_Type := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gANSS__Location__Type.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.requested__GANSS__Assistance__Data().ispresent()){
if(!single_value->field_requested__GANSS__Assistance__Data.match(match_value.requested__GANSS__Assistance__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".requested_GANSS_Assistance_Data");
single_value->field_requested__GANSS__Assistance__Data.log_match(match_value.requested__GANSS__Assistance__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_requested__GANSS__Assistance__Data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".requested_GANSS_Assistance_Data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_requested__GANSS__Assistance__Data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eDRX__Parameters().ispresent()){
if(!single_value->field_eDRX__Parameters.match(match_value.eDRX__Parameters(), legacy)){
TTCN_Logger::log_logmatch_info(".eDRX_Parameters");
single_value->field_eDRX__Parameters.log_match(match_value.eDRX__Parameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eDRX__Parameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eDRX_Parameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eDRX__Parameters.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", dRX_Parameters := ");
if (match_value.dRX__Parameters().ispresent()) {
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dRX__Parameters.log();
if (single_value->field_dRX__Parameters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", nSEI := ");
single_value->field_nSEI.log_match(match_value.nSEI(), legacy);
TTCN_Logger::log_event_str(", location_Type := ");
single_value->field_location__Type.log_match(match_value.location__Type(), legacy);
TTCN_Logger::log_event_str(", cell_Identifier := ");
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", lCS_Capability := ");
if (match_value.lCS__Capability().ispresent()) {
single_value->field_lCS__Capability.log_match(match_value.lCS__Capability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lCS__Capability.log();
if (single_value->field_lCS__Capability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lCS_Priority := ");
if (match_value.lCS__Priority().ispresent()) {
single_value->field_lCS__Priority.log_match(match_value.lCS__Priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lCS__Priority.log();
if (single_value->field_lCS__Priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lCS_QoS := ");
if (match_value.lCS__QoS().ispresent()) {
single_value->field_lCS__QoS.log_match(match_value.lCS__QoS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lCS__QoS.log();
if (single_value->field_lCS__QoS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lCS_Client_Type := ");
if (match_value.lCS__Client__Type().ispresent()) {
single_value->field_lCS__Client__Type.log_match(match_value.lCS__Client__Type(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lCS__Client__Type.log();
if (single_value->field_lCS__Client__Type.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requested_GPS_Assistance_Data := ");
if (match_value.requested__GPS__Assistance__Data().ispresent()) {
single_value->field_requested__GPS__Assistance__Data.log_match(match_value.requested__GPS__Assistance__Data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_requested__GPS__Assistance__Data.log();
if (single_value->field_requested__GPS__Assistance__Data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iMEI := ");
if (match_value.iMEI().ispresent()) {
single_value->field_iMEI.log_match(match_value.iMEI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iMEI.log();
if (single_value->field_iMEI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gANSS_Location_Type := ");
if (match_value.gANSS__Location__Type().ispresent()) {
single_value->field_gANSS__Location__Type.log_match(match_value.gANSS__Location__Type(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gANSS__Location__Type.log();
if (single_value->field_gANSS__Location__Type.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requested_GANSS_Assistance_Data := ");
if (match_value.requested__GANSS__Assistance__Data().ispresent()) {
single_value->field_requested__GANSS__Assistance__Data.log_match(match_value.requested__GANSS__Assistance__Data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_requested__GANSS__Assistance__Data.log();
if (single_value->field_requested__GANSS__Assistance__Data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eDRX_Parameters := ");
if (match_value.eDRX__Parameters().ispresent()) {
single_value->field_eDRX__Parameters.log_match(match_value.eDRX__Parameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eDRX__Parameters.log();
if (single_value->field_eDRX__Parameters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_dRX__Parameters.encode_text(text_buf);
single_value->field_bVCI.encode_text(text_buf);
single_value->field_nSEI.encode_text(text_buf);
single_value->field_location__Type.encode_text(text_buf);
single_value->field_cell__Identifier.encode_text(text_buf);
single_value->field_lCS__Capability.encode_text(text_buf);
single_value->field_lCS__Priority.encode_text(text_buf);
single_value->field_lCS__QoS.encode_text(text_buf);
single_value->field_lCS__Client__Type.encode_text(text_buf);
single_value->field_requested__GPS__Assistance__Data.encode_text(text_buf);
single_value->field_iMEI.encode_text(text_buf);
single_value->field_gANSS__Location__Type.encode_text(text_buf);
single_value->field_requested__GANSS__Assistance__Data.encode_text(text_buf);
single_value->field_eDRX__Parameters.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
}
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_dRX__Parameters.decode_text(text_buf);
single_value->field_bVCI.decode_text(text_buf);
single_value->field_nSEI.decode_text(text_buf);
single_value->field_location__Type.decode_text(text_buf);
single_value->field_cell__Identifier.decode_text(text_buf);
single_value->field_lCS__Capability.decode_text(text_buf);
single_value->field_lCS__Priority.decode_text(text_buf);
single_value->field_lCS__QoS.decode_text(text_buf);
single_value->field_lCS__Client__Type.decode_text(text_buf);
single_value->field_requested__GPS__Assistance__Data.decode_text(text_buf);
single_value->field_iMEI.decode_text(text_buf);
single_value->field_gANSS__Location__Type.decode_text(text_buf);
single_value->field_requested__GANSS__Assistance__Data.decode_text(text_buf);
single_value->field_eDRX__Parameters.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__REQUEST_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST.");
}
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PERFORM__LOCATION__REQUEST_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (17<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST has 17 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nSEI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) location__Type().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) lCS__Capability().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) lCS__Priority().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) lCS__QoS().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) lCS__Client__Type().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) requested__GPS__Assistance__Data().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) iMEI().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) gANSS__Location__Type().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) requested__GANSS__Assistance__Data().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) eDRX__Parameters().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "location_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          location__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_QoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__QoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Client_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Client__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requested_GPS_Assistance_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requested__GPS__Assistance__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gANSS_Location_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANSS__Location__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requested_GANSS_Assistance_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requested__GANSS__Assistance__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eDRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PERFORM__LOCATION__REQUEST_template* precondition = new PDU__BSSGP__PERFORM__LOCATION__REQUEST_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PERFORM__LOCATION__REQUEST_template* implied_template = new PDU__BSSGP__PERFORM__LOCATION__REQUEST_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PERFORM__LOCATION__REQUEST_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_dRX__Parameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_bVCI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_nSEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_location__Type.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_lCS__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_lCS__Priority.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_lCS__QoS.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_lCS__Client__Type.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_requested__GPS__Assistance__Data.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_iMEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_gANSS__Location__Type.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_requested__GANSS__Assistance__Data.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
single_value->field_eDRX__Parameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_REQUEST");
}

boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__PERFORM__LOCATION__REQUEST_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE::PDU__BSSGP__PERFORM__LOCATION__RESPONSE()
{
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE::PDU__BSSGP__PERFORM__LOCATION__RESPONSE(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const BVCI& par_bVCI,
    const OPTIONAL< Location__Estimate__BSSGP >& par_location__Estimate,
    const OPTIONAL< Positioning__Data__BSSGP >& par_positioning__Data,
    const OPTIONAL< Deciphering__Keys__BSSGP >& par_deciphering__Keys,
    const OPTIONAL< LCS__Cause__BSSGP >& par_lCS__Cause,
    const OPTIONAL< VelocityData >& par_velocityData,
    const OPTIONAL< GANSS__Positioning__Data >& par_gANSS__Positioning__Data)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_bVCI(par_bVCI),
  field_location__Estimate(par_location__Estimate),
  field_positioning__Data(par_positioning__Data),
  field_deciphering__Keys(par_deciphering__Keys),
  field_lCS__Cause(par_lCS__Cause),
  field_velocityData(par_velocityData),
  field_gANSS__Positioning__Data(par_gANSS__Positioning__Data)
{
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE::PDU__BSSGP__PERFORM__LOCATION__RESPONSE(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.location__Estimate().is_bound()) field_location__Estimate = other_value.location__Estimate();
else field_location__Estimate.clean_up();
if (other_value.positioning__Data().is_bound()) field_positioning__Data = other_value.positioning__Data();
else field_positioning__Data.clean_up();
if (other_value.deciphering__Keys().is_bound()) field_deciphering__Keys = other_value.deciphering__Keys();
else field_deciphering__Keys.clean_up();
if (other_value.lCS__Cause().is_bound()) field_lCS__Cause = other_value.lCS__Cause();
else field_lCS__Cause.clean_up();
if (other_value.velocityData().is_bound()) field_velocityData = other_value.velocityData();
else field_velocityData.clean_up();
if (other_value.gANSS__Positioning__Data().is_bound()) field_gANSS__Positioning__Data = other_value.gANSS__Positioning__Data();
else field_gANSS__Positioning__Data.clean_up();
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_bVCI.clean_up();
field_location__Estimate.clean_up();
field_positioning__Data.clean_up();
field_deciphering__Keys.clean_up();
field_lCS__Cause.clean_up();
field_velocityData.clean_up();
field_gANSS__Positioning__Data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PERFORM__LOCATION__RESPONSE::get_descriptor() const { return &PDU__BSSGP__PERFORM__LOCATION__RESPONSE_descr_; }
PDU__BSSGP__PERFORM__LOCATION__RESPONSE& PDU__BSSGP__PERFORM__LOCATION__RESPONSE::operator=(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.location__Estimate().is_bound()) field_location__Estimate = other_value.location__Estimate();
  else field_location__Estimate.clean_up();
  if (other_value.positioning__Data().is_bound()) field_positioning__Data = other_value.positioning__Data();
  else field_positioning__Data.clean_up();
  if (other_value.deciphering__Keys().is_bound()) field_deciphering__Keys = other_value.deciphering__Keys();
  else field_deciphering__Keys.clean_up();
  if (other_value.lCS__Cause().is_bound()) field_lCS__Cause = other_value.lCS__Cause();
  else field_lCS__Cause.clean_up();
  if (other_value.velocityData().is_bound()) field_velocityData = other_value.velocityData();
  else field_velocityData.clean_up();
  if (other_value.gANSS__Positioning__Data().is_bound()) field_gANSS__Positioning__Data = other_value.gANSS__Positioning__Data();
  else field_gANSS__Positioning__Data.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE::operator==(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_bVCI==other_value.field_bVCI
  && field_location__Estimate==other_value.field_location__Estimate
  && field_positioning__Data==other_value.field_positioning__Data
  && field_deciphering__Keys==other_value.field_deciphering__Keys
  && field_lCS__Cause==other_value.field_lCS__Cause
  && field_velocityData==other_value.field_velocityData
  && field_gANSS__Positioning__Data==other_value.field_gANSS__Positioning__Data;
}

boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_bVCI.is_bound())
  || (OPTIONAL_OMIT == field_location__Estimate.get_selection() || field_location__Estimate.is_bound())
  || (OPTIONAL_OMIT == field_positioning__Data.get_selection() || field_positioning__Data.is_bound())
  || (OPTIONAL_OMIT == field_deciphering__Keys.get_selection() || field_deciphering__Keys.is_bound())
  || (OPTIONAL_OMIT == field_lCS__Cause.get_selection() || field_lCS__Cause.is_bound())
  || (OPTIONAL_OMIT == field_velocityData.get_selection() || field_velocityData.is_bound())
  || (OPTIONAL_OMIT == field_gANSS__Positioning__Data.get_selection() || field_gANSS__Positioning__Data.is_bound());
}
boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_bVCI.is_value()
  && (OPTIONAL_OMIT == field_location__Estimate.get_selection() || field_location__Estimate.is_value())
  && (OPTIONAL_OMIT == field_positioning__Data.get_selection() || field_positioning__Data.is_value())
  && (OPTIONAL_OMIT == field_deciphering__Keys.get_selection() || field_deciphering__Keys.is_value())
  && (OPTIONAL_OMIT == field_lCS__Cause.get_selection() || field_lCS__Cause.is_value())
  && (OPTIONAL_OMIT == field_velocityData.get_selection() || field_velocityData.is_value())
  && (OPTIONAL_OMIT == field_gANSS__Positioning__Data.get_selection() || field_gANSS__Positioning__Data.is_value());
}
int PDU__BSSGP__PERFORM__LOCATION__RESPONSE::size_of() const
{
  int ret_val = 3;
  if (field_location__Estimate.ispresent()) ret_val++;
  if (field_positioning__Data.ispresent()) ret_val++;
  if (field_deciphering__Keys.ispresent()) ret_val++;
  if (field_lCS__Cause.ispresent()) ret_val++;
  if (field_velocityData.ispresent()) ret_val++;
  if (field_gANSS__Positioning__Data.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", location_Estimate := ");
field_location__Estimate.log();
TTCN_Logger::log_event_str(", positioning_Data := ");
field_positioning__Data.log();
TTCN_Logger::log_event_str(", deciphering_Keys := ");
field_deciphering__Keys.log();
TTCN_Logger::log_event_str(", lCS_Cause := ");
field_lCS__Cause.log();
TTCN_Logger::log_event_str(", velocityData := ");
field_velocityData.log();
TTCN_Logger::log_event_str(", gANSS_Positioning_Data := ");
field_gANSS__Positioning__Data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (!location__Estimate().is_bound()) location__Estimate() = OMIT_VALUE;
else location__Estimate().set_implicit_omit();
if (!positioning__Data().is_bound()) positioning__Data() = OMIT_VALUE;
else positioning__Data().set_implicit_omit();
if (!deciphering__Keys().is_bound()) deciphering__Keys() = OMIT_VALUE;
else deciphering__Keys().set_implicit_omit();
if (!lCS__Cause().is_bound()) lCS__Cause() = OMIT_VALUE;
else lCS__Cause().set_implicit_omit();
if (!velocityData().is_bound()) velocityData() = OMIT_VALUE;
else velocityData().set_implicit_omit();
if (!gANSS__Positioning__Data().is_bound()) gANSS__Positioning__Data() = OMIT_VALUE;
else gANSS__Positioning__Data().set_implicit_omit();
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) location__Estimate().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) positioning__Data().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) deciphering__Keys().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) lCS__Cause().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) velocityData().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) gANSS__Positioning__Data().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "location_Estimate")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          location__Estimate().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "positioning_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          positioning__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deciphering_Keys")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deciphering__Keys().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__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(), "velocityData")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          velocityData().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gANSS_Positioning_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANSS__Positioning__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
  }
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_location__Estimate.encode_text(text_buf);
field_positioning__Data.encode_text(text_buf);
field_deciphering__Keys.encode_text(text_buf);
field_lCS__Cause.encode_text(text_buf);
field_velocityData.encode_text(text_buf);
field_gANSS__Positioning__Data.encode_text(text_buf);
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_location__Estimate.decode_text(text_buf);
field_positioning__Data.decode_text(text_buf);
field_deciphering__Keys.decode_text(text_buf);
field_lCS__Cause.decode_text(text_buf);
field_velocityData.decode_text(text_buf);
field_gANSS__Positioning__Data.decode_text(text_buf);
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__PERFORM__LOCATION__RESPONSE::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_location__Estimate = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Location__Estimate__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_location__Estimate().RAW_decode(Location__Estimate__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_location__Estimate = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_location__Estimate=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_positioning__Data = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Positioning__Data__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_positioning__Data().RAW_decode(Positioning__Data__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_positioning__Data = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_positioning__Data=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_deciphering__Keys = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, Deciphering__Keys__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_deciphering__Keys().RAW_decode(Deciphering__Keys__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_deciphering__Keys = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_deciphering__Keys=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_lCS__Cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, LCS__Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lCS__Cause().RAW_decode(LCS__Cause__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_lCS__Cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lCS__Cause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_velocityData = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, VelocityData_descr_.raw->forceomit);
  decoded_field_length = field_velocityData().RAW_decode(VelocityData_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_velocityData = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_velocityData=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_gANSS__Positioning__Data = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, GANSS__Positioning__Data_descr_.raw->forceomit);
  decoded_field_length = field_gANSS__Positioning__Data().RAW_decode(GANSS__Positioning__Data_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_gANSS__Positioning__Data = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_gANSS__Positioning__Data=OMIT_VALUE;
  if (field_bssgpPduType !=  os_128) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PERFORM__LOCATION__RESPONSE::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BVCI_descr_.raw);
  if (field_location__Estimate.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Location__Estimate__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_positioning__Data.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Positioning__Data__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_deciphering__Keys.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Deciphering__Keys__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_lCS__Cause.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, LCS__Cause__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_velocityData.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, VelocityData_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_gANSS__Positioning__Data.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, GANSS__Positioning__Data_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[2]);
  if (field_location__Estimate.ispresent()) {
  encoded_length += field_location__Estimate().RAW_encode(Location__Estimate__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_positioning__Data.ispresent()) {
  encoded_length += field_positioning__Data().RAW_encode(Positioning__Data__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_deciphering__Keys.ispresent()) {
  encoded_length += field_deciphering__Keys().RAW_encode(Deciphering__Keys__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_lCS__Cause.ispresent()) {
  encoded_length += field_lCS__Cause().RAW_encode(LCS__Cause__BSSGP_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_velocityData.ispresent()) {
  encoded_length += field_velocityData().RAW_encode(VelocityData_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_gANSS__Positioning__Data.ispresent()) {
  encoded_length += field_gANSS__Positioning__Data().RAW_encode(GANSS__Positioning__Data_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_bssgpPduType !=  os_128) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_128.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
BVCI_template field_bVCI;
Location__Estimate__BSSGP_template field_location__Estimate;
Positioning__Data__BSSGP_template field_positioning__Data;
Deciphering__Keys__BSSGP_template field_deciphering__Keys;
LCS__Cause__BSSGP_template field_lCS__Cause;
VelocityData_template field_velocityData;
GANSS__Positioning__Data_template field_gANSS__Positioning__Data;
};

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_location__Estimate = ANY_OR_OMIT;
single_value->field_positioning__Data = ANY_OR_OMIT;
single_value->field_deciphering__Keys = ANY_OR_OMIT;
single_value->field_lCS__Cause = ANY_OR_OMIT;
single_value->field_velocityData = ANY_OR_OMIT;
single_value->field_gANSS__Positioning__Data = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::copy_value(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.location__Estimate().is_bound()) {
  if (other_value.location__Estimate().ispresent()) single_value->field_location__Estimate = other_value.location__Estimate()();
  else single_value->field_location__Estimate = OMIT_VALUE;
} else {
  single_value->field_location__Estimate.clean_up();
}
if (other_value.positioning__Data().is_bound()) {
  if (other_value.positioning__Data().ispresent()) single_value->field_positioning__Data = other_value.positioning__Data()();
  else single_value->field_positioning__Data = OMIT_VALUE;
} else {
  single_value->field_positioning__Data.clean_up();
}
if (other_value.deciphering__Keys().is_bound()) {
  if (other_value.deciphering__Keys().ispresent()) single_value->field_deciphering__Keys = other_value.deciphering__Keys()();
  else single_value->field_deciphering__Keys = OMIT_VALUE;
} else {
  single_value->field_deciphering__Keys.clean_up();
}
if (other_value.lCS__Cause().is_bound()) {
  if (other_value.lCS__Cause().ispresent()) single_value->field_lCS__Cause = other_value.lCS__Cause()();
  else single_value->field_lCS__Cause = OMIT_VALUE;
} else {
  single_value->field_lCS__Cause.clean_up();
}
if (other_value.velocityData().is_bound()) {
  if (other_value.velocityData().ispresent()) single_value->field_velocityData = other_value.velocityData()();
  else single_value->field_velocityData = OMIT_VALUE;
} else {
  single_value->field_velocityData.clean_up();
}
if (other_value.gANSS__Positioning__Data().is_bound()) {
  if (other_value.gANSS__Positioning__Data().ispresent()) single_value->field_gANSS__Positioning__Data = other_value.gANSS__Positioning__Data()();
  else single_value->field_gANSS__Positioning__Data = OMIT_VALUE;
} else {
  single_value->field_gANSS__Positioning__Data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::copy_template(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.location__Estimate().get_selection()) {
single_value->field_location__Estimate = other_value.location__Estimate();
} else {
single_value->field_location__Estimate.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.positioning__Data().get_selection()) {
single_value->field_positioning__Data = other_value.positioning__Data();
} else {
single_value->field_positioning__Data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deciphering__Keys().get_selection()) {
single_value->field_deciphering__Keys = other_value.deciphering__Keys();
} else {
single_value->field_deciphering__Keys.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__Cause().get_selection()) {
single_value->field_lCS__Cause = other_value.lCS__Cause();
} else {
single_value->field_lCS__Cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.velocityData().get_selection()) {
single_value->field_velocityData = other_value.velocityData();
} else {
single_value->field_velocityData.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gANSS__Positioning__Data().get_selection()) {
single_value->field_gANSS__Positioning__Data = other_value.gANSS__Positioning__Data();
} else {
single_value->field_gANSS__Positioning__Data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template()
{
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(const OPTIONAL<PDU__BSSGP__PERFORM__LOCATION__RESPONSE>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PERFORM__LOCATION__RESPONSE&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE from an unbound optional field.");
}
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template* p_precondition, PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(Dynamic_Match_Interface<PDU__BSSGP__PERFORM__LOCATION__RESPONSE>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__PERFORM__LOCATION__RESPONSE>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::~PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template()
{
clean_up();
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::operator=(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::operator=(const OPTIONAL<PDU__BSSGP__PERFORM__LOCATION__RESPONSE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PERFORM__LOCATION__RESPONSE&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
}
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::operator=(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::match(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.location__Estimate().is_bound()) return FALSE;
if((other_value.location__Estimate().ispresent() ? !single_value->field_location__Estimate.match((const Location__Estimate__BSSGP&)other_value.location__Estimate(), legacy) : !single_value->field_location__Estimate.match_omit(legacy)))return FALSE;
if(!other_value.positioning__Data().is_bound()) return FALSE;
if((other_value.positioning__Data().ispresent() ? !single_value->field_positioning__Data.match((const Positioning__Data__BSSGP&)other_value.positioning__Data(), legacy) : !single_value->field_positioning__Data.match_omit(legacy)))return FALSE;
if(!other_value.deciphering__Keys().is_bound()) return FALSE;
if((other_value.deciphering__Keys().ispresent() ? !single_value->field_deciphering__Keys.match((const Deciphering__Keys__BSSGP&)other_value.deciphering__Keys(), legacy) : !single_value->field_deciphering__Keys.match_omit(legacy)))return FALSE;
if(!other_value.lCS__Cause().is_bound()) return FALSE;
if((other_value.lCS__Cause().ispresent() ? !single_value->field_lCS__Cause.match((const LCS__Cause__BSSGP&)other_value.lCS__Cause(), legacy) : !single_value->field_lCS__Cause.match_omit(legacy)))return FALSE;
if(!other_value.velocityData().is_bound()) return FALSE;
if((other_value.velocityData().ispresent() ? !single_value->field_velocityData.match((const VelocityData&)other_value.velocityData(), legacy) : !single_value->field_velocityData.match_omit(legacy)))return FALSE;
if(!other_value.gANSS__Positioning__Data().is_bound()) return FALSE;
if((other_value.gANSS__Positioning__Data().ispresent() ? !single_value->field_gANSS__Positioning__Data.match((const GANSS__Positioning__Data&)other_value.gANSS__Positioning__Data(), legacy) : !single_value->field_gANSS__Positioning__Data.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
}
return FALSE;
}

boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_bVCI.is_bound()
 || (single_value->field_location__Estimate.is_omit() || single_value->field_location__Estimate.is_bound())
 || (single_value->field_positioning__Data.is_omit() || single_value->field_positioning__Data.is_bound())
 || (single_value->field_deciphering__Keys.is_omit() || single_value->field_deciphering__Keys.is_bound())
 || (single_value->field_lCS__Cause.is_omit() || single_value->field_lCS__Cause.is_bound())
 || (single_value->field_velocityData.is_omit() || single_value->field_velocityData.is_bound())
 || (single_value->field_gANSS__Positioning__Data.is_omit() || single_value->field_gANSS__Positioning__Data.is_bound());
}

boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_bVCI.is_value()
 && (single_value->field_location__Estimate.is_omit() || single_value->field_location__Estimate.is_value())
 && (single_value->field_positioning__Data.is_omit() || single_value->field_positioning__Data.is_value())
 && (single_value->field_deciphering__Keys.is_omit() || single_value->field_deciphering__Keys.is_value())
 && (single_value->field_lCS__Cause.is_omit() || single_value->field_lCS__Cause.is_value())
 && (single_value->field_velocityData.is_omit() || single_value->field_velocityData.is_value())
 && (single_value->field_gANSS__Positioning__Data.is_omit() || single_value->field_gANSS__Positioning__Data.is_value());
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
PDU__BSSGP__PERFORM__LOCATION__RESPONSE ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_location__Estimate.is_omit()) ret_val.location__Estimate() = OMIT_VALUE;
else if (single_value->field_location__Estimate.is_bound()) {
ret_val.location__Estimate() = single_value->field_location__Estimate.valueof();
}
if (single_value->field_positioning__Data.is_omit()) ret_val.positioning__Data() = OMIT_VALUE;
else if (single_value->field_positioning__Data.is_bound()) {
ret_val.positioning__Data() = single_value->field_positioning__Data.valueof();
}
if (single_value->field_deciphering__Keys.is_omit()) ret_val.deciphering__Keys() = OMIT_VALUE;
else if (single_value->field_deciphering__Keys.is_bound()) {
ret_val.deciphering__Keys() = single_value->field_deciphering__Keys.valueof();
}
if (single_value->field_lCS__Cause.is_omit()) ret_val.lCS__Cause() = OMIT_VALUE;
else if (single_value->field_lCS__Cause.is_bound()) {
ret_val.lCS__Cause() = single_value->field_lCS__Cause.valueof();
}
if (single_value->field_velocityData.is_omit()) ret_val.velocityData() = OMIT_VALUE;
else if (single_value->field_velocityData.is_bound()) {
ret_val.velocityData() = single_value->field_velocityData.valueof();
}
if (single_value->field_gANSS__Positioning__Data.is_omit()) ret_val.gANSS__Positioning__Data() = OMIT_VALUE;
else if (single_value->field_gANSS__Positioning__Data.is_bound()) {
ret_val.gANSS__Positioning__Data() = single_value->field_gANSS__Positioning__Data.valueof();
}
return ret_val;
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template[list_length];
}

PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_tLLI;
}

BVCI_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_bVCI;
}

Location__Estimate__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::location__Estimate()
{
set_specific();
return single_value->field_location__Estimate;
}

const Location__Estimate__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::location__Estimate() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field location_Estimate of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_location__Estimate;
}

Positioning__Data__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::positioning__Data()
{
set_specific();
return single_value->field_positioning__Data;
}

const Positioning__Data__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::positioning__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field positioning_Data of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_positioning__Data;
}

Deciphering__Keys__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::deciphering__Keys()
{
set_specific();
return single_value->field_deciphering__Keys;
}

const Deciphering__Keys__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::deciphering__Keys() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deciphering_Keys of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_deciphering__Keys;
}

LCS__Cause__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::lCS__Cause()
{
set_specific();
return single_value->field_lCS__Cause;
}

const LCS__Cause__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::lCS__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_Cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_lCS__Cause;
}

VelocityData_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::velocityData()
{
set_specific();
return single_value->field_velocityData;
}

const VelocityData_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::velocityData() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field velocityData of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_velocityData;
}

GANSS__Positioning__Data_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::gANSS__Positioning__Data()
{
set_specific();
return single_value->field_gANSS__Positioning__Data;
}

const GANSS__Positioning__Data_template& PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::gANSS__Positioning__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gANSS_Positioning_Data of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
return single_value->field_gANSS__Positioning__Data;
}

int PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_location__Estimate.is_present()) ret_val++;
      if (single_value->field_positioning__Data.is_present()) ret_val++;
      if (single_value->field_deciphering__Keys.is_present()) ret_val++;
      if (single_value->field_lCS__Cause.is_present()) ret_val++;
      if (single_value->field_velocityData.is_present()) ret_val++;
      if (single_value->field_gANSS__Positioning__Data.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
  }
  return 0;
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", location_Estimate := ");
single_value->field_location__Estimate.log();
TTCN_Logger::log_event_str(", positioning_Data := ");
single_value->field_positioning__Data.log();
TTCN_Logger::log_event_str(", deciphering_Keys := ");
single_value->field_deciphering__Keys.log();
TTCN_Logger::log_event_str(", lCS_Cause := ");
single_value->field_lCS__Cause.log();
TTCN_Logger::log_event_str(", velocityData := ");
single_value->field_velocityData.log();
TTCN_Logger::log_event_str(", gANSS_Positioning_Data := ");
single_value->field_gANSS__Positioning__Data.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::log_match(const PDU__BSSGP__PERFORM__LOCATION__RESPONSE& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.location__Estimate().ispresent()){
if(!single_value->field_location__Estimate.match(match_value.location__Estimate(), legacy)){
TTCN_Logger::log_logmatch_info(".location_Estimate");
single_value->field_location__Estimate.log_match(match_value.location__Estimate(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_location__Estimate.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".location_Estimate := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_location__Estimate.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.positioning__Data().ispresent()){
if(!single_value->field_positioning__Data.match(match_value.positioning__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".positioning_Data");
single_value->field_positioning__Data.log_match(match_value.positioning__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_positioning__Data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".positioning_Data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_positioning__Data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deciphering__Keys().ispresent()){
if(!single_value->field_deciphering__Keys.match(match_value.deciphering__Keys(), legacy)){
TTCN_Logger::log_logmatch_info(".deciphering_Keys");
single_value->field_deciphering__Keys.log_match(match_value.deciphering__Keys(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deciphering__Keys.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deciphering_Keys := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deciphering__Keys.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lCS__Cause().ispresent()){
if(!single_value->field_lCS__Cause.match(match_value.lCS__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_Cause");
single_value->field_lCS__Cause.log_match(match_value.lCS__Cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lCS__Cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lCS_Cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lCS__Cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.velocityData().ispresent()){
if(!single_value->field_velocityData.match(match_value.velocityData(), legacy)){
TTCN_Logger::log_logmatch_info(".velocityData");
single_value->field_velocityData.log_match(match_value.velocityData(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_velocityData.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".velocityData := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_velocityData.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gANSS__Positioning__Data().ispresent()){
if(!single_value->field_gANSS__Positioning__Data.match(match_value.gANSS__Positioning__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".gANSS_Positioning_Data");
single_value->field_gANSS__Positioning__Data.log_match(match_value.gANSS__Positioning__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gANSS__Positioning__Data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gANSS_Positioning_Data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gANSS__Positioning__Data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", location_Estimate := ");
if (match_value.location__Estimate().ispresent()) {
single_value->field_location__Estimate.log_match(match_value.location__Estimate(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_location__Estimate.log();
if (single_value->field_location__Estimate.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", positioning_Data := ");
if (match_value.positioning__Data().ispresent()) {
single_value->field_positioning__Data.log_match(match_value.positioning__Data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_positioning__Data.log();
if (single_value->field_positioning__Data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deciphering_Keys := ");
if (match_value.deciphering__Keys().ispresent()) {
single_value->field_deciphering__Keys.log_match(match_value.deciphering__Keys(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deciphering__Keys.log();
if (single_value->field_deciphering__Keys.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lCS_Cause := ");
if (match_value.lCS__Cause().ispresent()) {
single_value->field_lCS__Cause.log_match(match_value.lCS__Cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lCS__Cause.log();
if (single_value->field_lCS__Cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", velocityData := ");
if (match_value.velocityData().ispresent()) {
single_value->field_velocityData.log_match(match_value.velocityData(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_velocityData.log();
if (single_value->field_velocityData.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gANSS_Positioning_Data := ");
if (match_value.gANSS__Positioning__Data().ispresent()) {
single_value->field_gANSS__Positioning__Data.log_match(match_value.gANSS__Positioning__Data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gANSS__Positioning__Data.log();
if (single_value->field_gANSS__Positioning__Data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_bVCI.encode_text(text_buf);
single_value->field_location__Estimate.encode_text(text_buf);
single_value->field_positioning__Data.encode_text(text_buf);
single_value->field_deciphering__Keys.encode_text(text_buf);
single_value->field_lCS__Cause.encode_text(text_buf);
single_value->field_velocityData.encode_text(text_buf);
single_value->field_gANSS__Positioning__Data.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
}
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_bVCI.decode_text(text_buf);
single_value->field_location__Estimate.decode_text(text_buf);
single_value->field_positioning__Data.decode_text(text_buf);
single_value->field_deciphering__Keys.decode_text(text_buf);
single_value->field_lCS__Cause.decode_text(text_buf);
single_value->field_velocityData.decode_text(text_buf);
single_value->field_gANSS__Positioning__Data.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE.");
}
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) location__Estimate().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) positioning__Data().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) deciphering__Keys().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) lCS__Cause().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) velocityData().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) gANSS__Positioning__Data().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "location_Estimate")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          location__Estimate().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "positioning_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          positioning__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deciphering_Keys")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deciphering__Keys().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__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(), "velocityData")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          velocityData().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gANSS_Positioning_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANSS__Positioning__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template* precondition = new PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template* implied_template = new PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_bVCI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_location__Estimate.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_positioning__Data.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_deciphering__Keys.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_lCS__Cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_velocityData.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
single_value->field_gANSS__Positioning__Data.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_RESPONSE");
}

boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__PERFORM__LOCATION__RESPONSE_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__PERFORM__LOCATION__ABORT::PDU__BSSGP__PERFORM__LOCATION__ABORT()
{
}

PDU__BSSGP__PERFORM__LOCATION__ABORT::PDU__BSSGP__PERFORM__LOCATION__ABORT(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const BVCI& par_bVCI,
    const LCS__Cause__BSSGP& par_lCS__Cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_bVCI(par_bVCI),
  field_lCS__Cause(par_lCS__Cause)
{
}

PDU__BSSGP__PERFORM__LOCATION__ABORT::PDU__BSSGP__PERFORM__LOCATION__ABORT(const PDU__BSSGP__PERFORM__LOCATION__ABORT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.lCS__Cause().is_bound()) field_lCS__Cause = other_value.lCS__Cause();
else field_lCS__Cause.clean_up();
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_bVCI.clean_up();
field_lCS__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PERFORM__LOCATION__ABORT::get_descriptor() const { return &PDU__BSSGP__PERFORM__LOCATION__ABORT_descr_; }
PDU__BSSGP__PERFORM__LOCATION__ABORT& PDU__BSSGP__PERFORM__LOCATION__ABORT::operator=(const PDU__BSSGP__PERFORM__LOCATION__ABORT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.lCS__Cause().is_bound()) field_lCS__Cause = other_value.lCS__Cause();
  else field_lCS__Cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PERFORM__LOCATION__ABORT::operator==(const PDU__BSSGP__PERFORM__LOCATION__ABORT& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_bVCI==other_value.field_bVCI
  && field_lCS__Cause==other_value.field_lCS__Cause;
}

boolean PDU__BSSGP__PERFORM__LOCATION__ABORT::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_bVCI.is_bound())
  || (field_lCS__Cause.is_bound());
}
boolean PDU__BSSGP__PERFORM__LOCATION__ABORT::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_bVCI.is_value()
  && field_lCS__Cause.is_value();
}
void PDU__BSSGP__PERFORM__LOCATION__ABORT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", lCS_Cause := ");
field_lCS__Cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (lCS__Cause().is_bound()) lCS__Cause().set_implicit_omit();
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lCS__Cause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT");
  }
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_lCS__Cause.encode_text(text_buf);
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_lCS__Cause.decode_text(text_buf);
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__PERFORM__LOCATION__ABORT::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_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, LCS__Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lCS__Cause.RAW_decode(LCS__Cause__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_129) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PERFORM__LOCATION__ABORT::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BVCI_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, LCS__Cause__BSSGP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_lCS__Cause.RAW_encode(LCS__Cause__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  os_129) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_129.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PERFORM__LOCATION__ABORT_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
BVCI_template field_bVCI;
LCS__Cause__BSSGP_template field_lCS__Cause;
};

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_lCS__Cause = ANY_VALUE;
}
}
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::copy_value(const PDU__BSSGP__PERFORM__LOCATION__ABORT& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.lCS__Cause().is_bound()) {
  single_value->field_lCS__Cause = other_value.lCS__Cause();
} else {
  single_value->field_lCS__Cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::copy_template(const PDU__BSSGP__PERFORM__LOCATION__ABORT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__Cause().get_selection()) {
single_value->field_lCS__Cause = other_value.lCS__Cause();
} else {
single_value->field_lCS__Cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__ABORT_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PERFORM__LOCATION__ABORT_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PERFORM__LOCATION__ABORT_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::PDU__BSSGP__PERFORM__LOCATION__ABORT_template()
{
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::PDU__BSSGP__PERFORM__LOCATION__ABORT_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::PDU__BSSGP__PERFORM__LOCATION__ABORT_template(const PDU__BSSGP__PERFORM__LOCATION__ABORT& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::PDU__BSSGP__PERFORM__LOCATION__ABORT_template(const OPTIONAL<PDU__BSSGP__PERFORM__LOCATION__ABORT>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PERFORM__LOCATION__ABORT&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT from an unbound optional field.");
}
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::PDU__BSSGP__PERFORM__LOCATION__ABORT_template(PDU__BSSGP__PERFORM__LOCATION__ABORT_template* p_precondition, PDU__BSSGP__PERFORM__LOCATION__ABORT_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::PDU__BSSGP__PERFORM__LOCATION__ABORT_template(Dynamic_Match_Interface<PDU__BSSGP__PERFORM__LOCATION__ABORT>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__PERFORM__LOCATION__ABORT>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::PDU__BSSGP__PERFORM__LOCATION__ABORT_template(const PDU__BSSGP__PERFORM__LOCATION__ABORT_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template::~PDU__BSSGP__PERFORM__LOCATION__ABORT_template()
{
clean_up();
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::operator=(const PDU__BSSGP__PERFORM__LOCATION__ABORT& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::operator=(const OPTIONAL<PDU__BSSGP__PERFORM__LOCATION__ABORT>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PERFORM__LOCATION__ABORT&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
}
return *this;
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::operator=(const PDU__BSSGP__PERFORM__LOCATION__ABORT_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__PERFORM__LOCATION__ABORT_template::match(const PDU__BSSGP__PERFORM__LOCATION__ABORT& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.lCS__Cause().is_bound()) return FALSE;
if(!single_value->field_lCS__Cause.match(other_value.lCS__Cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
}
return FALSE;
}

boolean PDU__BSSGP__PERFORM__LOCATION__ABORT_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_bVCI.is_bound()
 || single_value->field_lCS__Cause.is_bound();
}

boolean PDU__BSSGP__PERFORM__LOCATION__ABORT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_bVCI.is_value()
 && single_value->field_lCS__Cause.is_value();
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__PERFORM__LOCATION__ABORT PDU__BSSGP__PERFORM__LOCATION__ABORT_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
PDU__BSSGP__PERFORM__LOCATION__ABORT ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_lCS__Cause.is_bound()) {
ret_val.lCS__Cause() = single_value->field_lCS__Cause.valueof();
}
return ret_val;
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__ABORT_template[list_length];
}

PDU__BSSGP__PERFORM__LOCATION__ABORT_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
return single_value->field_tLLI;
}

BVCI_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
return single_value->field_bVCI;
}

LCS__Cause__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::lCS__Cause()
{
set_specific();
return single_value->field_lCS__Cause;
}

const LCS__Cause__BSSGP_template& PDU__BSSGP__PERFORM__LOCATION__ABORT_template::lCS__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_Cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
return single_value->field_lCS__Cause;
}

int PDU__BSSGP__PERFORM__LOCATION__ABORT_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
  }
  return 0;
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", lCS_Cause := ");
single_value->field_lCS__Cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::log_match(const PDU__BSSGP__PERFORM__LOCATION__ABORT& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lCS__Cause.match(match_value.lCS__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_Cause");
single_value->field_lCS__Cause.log_match(match_value.lCS__Cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", lCS_Cause := ");
single_value->field_lCS__Cause.log_match(match_value.lCS__Cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_bVCI.encode_text(text_buf);
single_value->field_lCS__Cause.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
}
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_bVCI.decode_text(text_buf);
single_value->field_lCS__Cause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PERFORM__LOCATION__ABORT_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT.");
}
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PERFORM__LOCATION__ABORT_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lCS__Cause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PERFORM__LOCATION__ABORT_template* precondition = new PDU__BSSGP__PERFORM__LOCATION__ABORT_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PERFORM__LOCATION__ABORT_template* implied_template = new PDU__BSSGP__PERFORM__LOCATION__ABORT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PERFORM__LOCATION__ABORT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PERFORM__LOCATION__ABORT_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT");
single_value->field_bVCI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT");
single_value->field_lCS__Cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PERFORM_LOCATION_ABORT");
}

boolean PDU__BSSGP__PERFORM__LOCATION__ABORT_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__PERFORM__LOCATION__ABORT_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__POSITION__COMMAND::PDU__BSSGP__POSITION__COMMAND()
{
}

PDU__BSSGP__POSITION__COMMAND::PDU__BSSGP__POSITION__COMMAND(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const BVCI& par_bVCI,
    const RRLP__Flags__BSSGP& par_rRLP__Flags,
    const RRLP__APDU__BSSGP& par_rRLP__APDU)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_bVCI(par_bVCI),
  field_rRLP__Flags(par_rRLP__Flags),
  field_rRLP__APDU(par_rRLP__APDU)
{
}

PDU__BSSGP__POSITION__COMMAND::PDU__BSSGP__POSITION__COMMAND(const PDU__BSSGP__POSITION__COMMAND& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.rRLP__Flags().is_bound()) field_rRLP__Flags = other_value.rRLP__Flags();
else field_rRLP__Flags.clean_up();
if (other_value.rRLP__APDU().is_bound()) field_rRLP__APDU = other_value.rRLP__APDU();
else field_rRLP__APDU.clean_up();
}

void PDU__BSSGP__POSITION__COMMAND::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_bVCI.clean_up();
field_rRLP__Flags.clean_up();
field_rRLP__APDU.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__POSITION__COMMAND::get_descriptor() const { return &PDU__BSSGP__POSITION__COMMAND_descr_; }
PDU__BSSGP__POSITION__COMMAND& PDU__BSSGP__POSITION__COMMAND::operator=(const PDU__BSSGP__POSITION__COMMAND& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.rRLP__Flags().is_bound()) field_rRLP__Flags = other_value.rRLP__Flags();
  else field_rRLP__Flags.clean_up();
  if (other_value.rRLP__APDU().is_bound()) field_rRLP__APDU = other_value.rRLP__APDU();
  else field_rRLP__APDU.clean_up();
}
return *this;
}

boolean PDU__BSSGP__POSITION__COMMAND::operator==(const PDU__BSSGP__POSITION__COMMAND& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_bVCI==other_value.field_bVCI
  && field_rRLP__Flags==other_value.field_rRLP__Flags
  && field_rRLP__APDU==other_value.field_rRLP__APDU;
}

boolean PDU__BSSGP__POSITION__COMMAND::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_bVCI.is_bound())
  || (field_rRLP__Flags.is_bound())
  || (field_rRLP__APDU.is_bound());
}
boolean PDU__BSSGP__POSITION__COMMAND::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_bVCI.is_value()
  && field_rRLP__Flags.is_value()
  && field_rRLP__APDU.is_value();
}
void PDU__BSSGP__POSITION__COMMAND::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", rRLP_Flags := ");
field_rRLP__Flags.log();
TTCN_Logger::log_event_str(", rRLP_APDU := ");
field_rRLP__APDU.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__POSITION__COMMAND::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (rRLP__Flags().is_bound()) rRLP__Flags().set_implicit_omit();
if (rRLP__APDU().is_bound()) rRLP__APDU().set_implicit_omit();
}

void PDU__BSSGP__POSITION__COMMAND::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rRLP__Flags().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rRLP__APDU().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_Flags")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__Flags().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_APDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__APDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
  }
}

void PDU__BSSGP__POSITION__COMMAND::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_rRLP__Flags.encode_text(text_buf);
field_rRLP__APDU.encode_text(text_buf);
}

void PDU__BSSGP__POSITION__COMMAND::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_rRLP__Flags.decode_text(text_buf);
field_rRLP__APDU.decode_text(text_buf);
}

void PDU__BSSGP__POSITION__COMMAND::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__POSITION__COMMAND::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__POSITION__COMMAND::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_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, RRLP__Flags__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_rRLP__Flags.RAW_decode(RRLP__Flags__BSSGP_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, RRLP__APDU__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_rRLP__APDU.RAW_decode(RRLP__APDU__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_132) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__POSITION__COMMAND::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BVCI_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RRLP__Flags__BSSGP_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RRLP__APDU__BSSGP_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rRLP__Flags.RAW_encode(RRLP__Flags__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rRLP__APDU.RAW_encode(RRLP__APDU__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  if (field_bssgpPduType !=  os_132) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_132.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__POSITION__COMMAND_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
BVCI_template field_bVCI;
RRLP__Flags__BSSGP_template field_rRLP__Flags;
RRLP__APDU__BSSGP_template field_rRLP__APDU;
};

void PDU__BSSGP__POSITION__COMMAND_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_rRLP__Flags = ANY_VALUE;
single_value->field_rRLP__APDU = ANY_VALUE;
}
}
}

void PDU__BSSGP__POSITION__COMMAND_template::copy_value(const PDU__BSSGP__POSITION__COMMAND& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.rRLP__Flags().is_bound()) {
  single_value->field_rRLP__Flags = other_value.rRLP__Flags();
} else {
  single_value->field_rRLP__Flags.clean_up();
}
if (other_value.rRLP__APDU().is_bound()) {
  single_value->field_rRLP__APDU = other_value.rRLP__APDU();
} else {
  single_value->field_rRLP__APDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__POSITION__COMMAND_template::copy_template(const PDU__BSSGP__POSITION__COMMAND_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rRLP__Flags().get_selection()) {
single_value->field_rRLP__Flags = other_value.rRLP__Flags();
} else {
single_value->field_rRLP__Flags.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rRLP__APDU().get_selection()) {
single_value->field_rRLP__APDU = other_value.rRLP__APDU();
} else {
single_value->field_rRLP__APDU.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__POSITION__COMMAND_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__POSITION__COMMAND_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__POSITION__COMMAND_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__POSITION__COMMAND_template::PDU__BSSGP__POSITION__COMMAND_template()
{
}

PDU__BSSGP__POSITION__COMMAND_template::PDU__BSSGP__POSITION__COMMAND_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__POSITION__COMMAND_template::PDU__BSSGP__POSITION__COMMAND_template(const PDU__BSSGP__POSITION__COMMAND& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__POSITION__COMMAND_template::PDU__BSSGP__POSITION__COMMAND_template(const OPTIONAL<PDU__BSSGP__POSITION__COMMAND>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__POSITION__COMMAND&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND from an unbound optional field.");
}
}

PDU__BSSGP__POSITION__COMMAND_template::PDU__BSSGP__POSITION__COMMAND_template(PDU__BSSGP__POSITION__COMMAND_template* p_precondition, PDU__BSSGP__POSITION__COMMAND_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__POSITION__COMMAND_template::PDU__BSSGP__POSITION__COMMAND_template(Dynamic_Match_Interface<PDU__BSSGP__POSITION__COMMAND>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__POSITION__COMMAND>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__POSITION__COMMAND_template::PDU__BSSGP__POSITION__COMMAND_template(const PDU__BSSGP__POSITION__COMMAND_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__POSITION__COMMAND_template::~PDU__BSSGP__POSITION__COMMAND_template()
{
clean_up();
}

PDU__BSSGP__POSITION__COMMAND_template& PDU__BSSGP__POSITION__COMMAND_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__POSITION__COMMAND_template& PDU__BSSGP__POSITION__COMMAND_template::operator=(const PDU__BSSGP__POSITION__COMMAND& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__POSITION__COMMAND_template& PDU__BSSGP__POSITION__COMMAND_template::operator=(const OPTIONAL<PDU__BSSGP__POSITION__COMMAND>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__POSITION__COMMAND&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
}
return *this;
}

PDU__BSSGP__POSITION__COMMAND_template& PDU__BSSGP__POSITION__COMMAND_template::operator=(const PDU__BSSGP__POSITION__COMMAND_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__POSITION__COMMAND_template::match(const PDU__BSSGP__POSITION__COMMAND& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.rRLP__Flags().is_bound()) return FALSE;
if(!single_value->field_rRLP__Flags.match(other_value.rRLP__Flags(), legacy))return FALSE;
if(!other_value.rRLP__APDU().is_bound()) return FALSE;
if(!single_value->field_rRLP__APDU.match(other_value.rRLP__APDU(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
}
return FALSE;
}

boolean PDU__BSSGP__POSITION__COMMAND_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_bVCI.is_bound()
 || single_value->field_rRLP__Flags.is_bound()
 || single_value->field_rRLP__APDU.is_bound();
}

boolean PDU__BSSGP__POSITION__COMMAND_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_bVCI.is_value()
 && single_value->field_rRLP__Flags.is_value()
 && single_value->field_rRLP__APDU.is_value();
}

void PDU__BSSGP__POSITION__COMMAND_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__POSITION__COMMAND PDU__BSSGP__POSITION__COMMAND_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
PDU__BSSGP__POSITION__COMMAND ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_rRLP__Flags.is_bound()) {
ret_val.rRLP__Flags() = single_value->field_rRLP__Flags.valueof();
}
if (single_value->field_rRLP__APDU.is_bound()) {
ret_val.rRLP__APDU() = single_value->field_rRLP__APDU.valueof();
}
return ret_val;
}

void PDU__BSSGP__POSITION__COMMAND_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__POSITION__COMMAND_template[list_length];
}

PDU__BSSGP__POSITION__COMMAND_template& PDU__BSSGP__POSITION__COMMAND_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__POSITION__COMMAND_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__POSITION__COMMAND_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__POSITION__COMMAND_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__POSITION__COMMAND_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
return single_value->field_tLLI;
}

BVCI_template& PDU__BSSGP__POSITION__COMMAND_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__POSITION__COMMAND_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
return single_value->field_bVCI;
}

RRLP__Flags__BSSGP_template& PDU__BSSGP__POSITION__COMMAND_template::rRLP__Flags()
{
set_specific();
return single_value->field_rRLP__Flags;
}

const RRLP__Flags__BSSGP_template& PDU__BSSGP__POSITION__COMMAND_template::rRLP__Flags() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rRLP_Flags of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
return single_value->field_rRLP__Flags;
}

RRLP__APDU__BSSGP_template& PDU__BSSGP__POSITION__COMMAND_template::rRLP__APDU()
{
set_specific();
return single_value->field_rRLP__APDU;
}

const RRLP__APDU__BSSGP_template& PDU__BSSGP__POSITION__COMMAND_template::rRLP__APDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rRLP_APDU of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
return single_value->field_rRLP__APDU;
}

int PDU__BSSGP__POSITION__COMMAND_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND 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.PDU_BSSGP_POSITION_COMMAND containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
  }
  return 0;
}

void PDU__BSSGP__POSITION__COMMAND_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", rRLP_Flags := ");
single_value->field_rRLP__Flags.log();
TTCN_Logger::log_event_str(", rRLP_APDU := ");
single_value->field_rRLP__APDU.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__POSITION__COMMAND_template::log_match(const PDU__BSSGP__POSITION__COMMAND& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rRLP__Flags.match(match_value.rRLP__Flags(), legacy)){
TTCN_Logger::log_logmatch_info(".rRLP_Flags");
single_value->field_rRLP__Flags.log_match(match_value.rRLP__Flags(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rRLP__APDU.match(match_value.rRLP__APDU(), legacy)){
TTCN_Logger::log_logmatch_info(".rRLP_APDU");
single_value->field_rRLP__APDU.log_match(match_value.rRLP__APDU(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", rRLP_Flags := ");
single_value->field_rRLP__Flags.log_match(match_value.rRLP__Flags(), legacy);
TTCN_Logger::log_event_str(", rRLP_APDU := ");
single_value->field_rRLP__APDU.log_match(match_value.rRLP__APDU(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__POSITION__COMMAND_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_bVCI.encode_text(text_buf);
single_value->field_rRLP__Flags.encode_text(text_buf);
single_value->field_rRLP__APDU.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
}
}

void PDU__BSSGP__POSITION__COMMAND_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_bVCI.decode_text(text_buf);
single_value->field_rRLP__Flags.decode_text(text_buf);
single_value->field_rRLP__APDU.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__POSITION__COMMAND_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND.");
}
}

void PDU__BSSGP__POSITION__COMMAND_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__POSITION__COMMAND_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rRLP__Flags().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rRLP__APDU().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_Flags")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__Flags().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_APDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__APDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_POSITION_COMMAND: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__POSITION__COMMAND_template* precondition = new PDU__BSSGP__POSITION__COMMAND_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__POSITION__COMMAND_template* implied_template = new PDU__BSSGP__POSITION__COMMAND_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__POSITION__COMMAND_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__POSITION__COMMAND_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
single_value->field_bVCI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
single_value->field_rRLP__Flags.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
single_value->field_rRLP__APDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_COMMAND");
}

boolean PDU__BSSGP__POSITION__COMMAND_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__POSITION__COMMAND_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__POSITION__RESPONSE::PDU__BSSGP__POSITION__RESPONSE()
{
}

PDU__BSSGP__POSITION__RESPONSE::PDU__BSSGP__POSITION__RESPONSE(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const BVCI& par_bVCI,
    const OPTIONAL< RRLP__Flags__BSSGP >& par_rRLP__Flags,
    const OPTIONAL< RRLP__APDU__BSSGP >& par_rRLP__APDU,
    const OPTIONAL< LCS__Cause__BSSGP >& par_lCS__Cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_bVCI(par_bVCI),
  field_rRLP__Flags(par_rRLP__Flags),
  field_rRLP__APDU(par_rRLP__APDU),
  field_lCS__Cause(par_lCS__Cause)
{
}

PDU__BSSGP__POSITION__RESPONSE::PDU__BSSGP__POSITION__RESPONSE(const PDU__BSSGP__POSITION__RESPONSE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
else field_bVCI.clean_up();
if (other_value.rRLP__Flags().is_bound()) field_rRLP__Flags = other_value.rRLP__Flags();
else field_rRLP__Flags.clean_up();
if (other_value.rRLP__APDU().is_bound()) field_rRLP__APDU = other_value.rRLP__APDU();
else field_rRLP__APDU.clean_up();
if (other_value.lCS__Cause().is_bound()) field_lCS__Cause = other_value.lCS__Cause();
else field_lCS__Cause.clean_up();
}

void PDU__BSSGP__POSITION__RESPONSE::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_bVCI.clean_up();
field_rRLP__Flags.clean_up();
field_rRLP__APDU.clean_up();
field_lCS__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__POSITION__RESPONSE::get_descriptor() const { return &PDU__BSSGP__POSITION__RESPONSE_descr_; }
PDU__BSSGP__POSITION__RESPONSE& PDU__BSSGP__POSITION__RESPONSE::operator=(const PDU__BSSGP__POSITION__RESPONSE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.bVCI().is_bound()) field_bVCI = other_value.bVCI();
  else field_bVCI.clean_up();
  if (other_value.rRLP__Flags().is_bound()) field_rRLP__Flags = other_value.rRLP__Flags();
  else field_rRLP__Flags.clean_up();
  if (other_value.rRLP__APDU().is_bound()) field_rRLP__APDU = other_value.rRLP__APDU();
  else field_rRLP__APDU.clean_up();
  if (other_value.lCS__Cause().is_bound()) field_lCS__Cause = other_value.lCS__Cause();
  else field_lCS__Cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__POSITION__RESPONSE::operator==(const PDU__BSSGP__POSITION__RESPONSE& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_bVCI==other_value.field_bVCI
  && field_rRLP__Flags==other_value.field_rRLP__Flags
  && field_rRLP__APDU==other_value.field_rRLP__APDU
  && field_lCS__Cause==other_value.field_lCS__Cause;
}

boolean PDU__BSSGP__POSITION__RESPONSE::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_bVCI.is_bound())
  || (OPTIONAL_OMIT == field_rRLP__Flags.get_selection() || field_rRLP__Flags.is_bound())
  || (OPTIONAL_OMIT == field_rRLP__APDU.get_selection() || field_rRLP__APDU.is_bound())
  || (OPTIONAL_OMIT == field_lCS__Cause.get_selection() || field_lCS__Cause.is_bound());
}
boolean PDU__BSSGP__POSITION__RESPONSE::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_bVCI.is_value()
  && (OPTIONAL_OMIT == field_rRLP__Flags.get_selection() || field_rRLP__Flags.is_value())
  && (OPTIONAL_OMIT == field_rRLP__APDU.get_selection() || field_rRLP__APDU.is_value())
  && (OPTIONAL_OMIT == field_lCS__Cause.get_selection() || field_lCS__Cause.is_value());
}
int PDU__BSSGP__POSITION__RESPONSE::size_of() const
{
  int ret_val = 3;
  if (field_rRLP__Flags.ispresent()) ret_val++;
  if (field_rRLP__APDU.ispresent()) ret_val++;
  if (field_lCS__Cause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__POSITION__RESPONSE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
field_bVCI.log();
TTCN_Logger::log_event_str(", rRLP_Flags := ");
field_rRLP__Flags.log();
TTCN_Logger::log_event_str(", rRLP_APDU := ");
field_rRLP__APDU.log();
TTCN_Logger::log_event_str(", lCS_Cause := ");
field_lCS__Cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__POSITION__RESPONSE::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (bVCI().is_bound()) bVCI().set_implicit_omit();
if (!rRLP__Flags().is_bound()) rRLP__Flags() = OMIT_VALUE;
else rRLP__Flags().set_implicit_omit();
if (!rRLP__APDU().is_bound()) rRLP__APDU() = OMIT_VALUE;
else rRLP__APDU().set_implicit_omit();
if (!lCS__Cause().is_bound()) lCS__Cause() = OMIT_VALUE;
else lCS__Cause().set_implicit_omit();
}

void PDU__BSSGP__POSITION__RESPONSE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rRLP__Flags().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rRLP__APDU().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lCS__Cause().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_Flags")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__Flags().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_APDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__APDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
  }
}

void PDU__BSSGP__POSITION__RESPONSE::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_bVCI.encode_text(text_buf);
field_rRLP__Flags.encode_text(text_buf);
field_rRLP__APDU.encode_text(text_buf);
field_lCS__Cause.encode_text(text_buf);
}

void PDU__BSSGP__POSITION__RESPONSE::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_bVCI.decode_text(text_buf);
field_rRLP__Flags.decode_text(text_buf);
field_rRLP__APDU.decode_text(text_buf);
field_lCS__Cause.decode_text(text_buf);
}

void PDU__BSSGP__POSITION__RESPONSE::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__POSITION__RESPONSE::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__POSITION__RESPONSE::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, BVCI_descr_.raw->forceomit);
  decoded_field_length = field_bVCI.RAW_decode(BVCI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_rRLP__Flags = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, RRLP__Flags__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_rRLP__Flags().RAW_decode(RRLP__Flags__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_rRLP__Flags = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_rRLP__Flags=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_rRLP__APDU = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, RRLP__APDU__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_rRLP__APDU().RAW_decode(RRLP__APDU__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_rRLP__APDU = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_rRLP__APDU=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_lCS__Cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, LCS__Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lCS__Cause().RAW_decode(LCS__Cause__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_lCS__Cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lCS__Cause=OMIT_VALUE;
  if (field_bssgpPduType !=  os_92) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__POSITION__RESPONSE::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BVCI_descr_.raw);
  if (field_rRLP__Flags.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RRLP__Flags__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_rRLP__APDU.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RRLP__APDU__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_lCS__Cause.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, LCS__Cause__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_bVCI.RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[2]);
  if (field_rRLP__Flags.ispresent()) {
  encoded_length += field_rRLP__Flags().RAW_encode(RRLP__Flags__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_rRLP__APDU.ispresent()) {
  encoded_length += field_rRLP__APDU().RAW_encode(RRLP__APDU__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_lCS__Cause.ispresent()) {
  encoded_length += field_lCS__Cause().RAW_encode(LCS__Cause__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_bssgpPduType !=  os_92) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_92.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__POSITION__RESPONSE_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
BVCI_template field_bVCI;
RRLP__Flags__BSSGP_template field_rRLP__Flags;
RRLP__APDU__BSSGP_template field_rRLP__APDU;
LCS__Cause__BSSGP_template field_lCS__Cause;
};

void PDU__BSSGP__POSITION__RESPONSE_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_bVCI = ANY_VALUE;
single_value->field_rRLP__Flags = ANY_OR_OMIT;
single_value->field_rRLP__APDU = ANY_OR_OMIT;
single_value->field_lCS__Cause = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__POSITION__RESPONSE_template::copy_value(const PDU__BSSGP__POSITION__RESPONSE& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.bVCI().is_bound()) {
  single_value->field_bVCI = other_value.bVCI();
} else {
  single_value->field_bVCI.clean_up();
}
if (other_value.rRLP__Flags().is_bound()) {
  if (other_value.rRLP__Flags().ispresent()) single_value->field_rRLP__Flags = other_value.rRLP__Flags()();
  else single_value->field_rRLP__Flags = OMIT_VALUE;
} else {
  single_value->field_rRLP__Flags.clean_up();
}
if (other_value.rRLP__APDU().is_bound()) {
  if (other_value.rRLP__APDU().ispresent()) single_value->field_rRLP__APDU = other_value.rRLP__APDU()();
  else single_value->field_rRLP__APDU = OMIT_VALUE;
} else {
  single_value->field_rRLP__APDU.clean_up();
}
if (other_value.lCS__Cause().is_bound()) {
  if (other_value.lCS__Cause().ispresent()) single_value->field_lCS__Cause = other_value.lCS__Cause()();
  else single_value->field_lCS__Cause = OMIT_VALUE;
} else {
  single_value->field_lCS__Cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__POSITION__RESPONSE_template::copy_template(const PDU__BSSGP__POSITION__RESPONSE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bVCI().get_selection()) {
single_value->field_bVCI = other_value.bVCI();
} else {
single_value->field_bVCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rRLP__Flags().get_selection()) {
single_value->field_rRLP__Flags = other_value.rRLP__Flags();
} else {
single_value->field_rRLP__Flags.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rRLP__APDU().get_selection()) {
single_value->field_rRLP__APDU = other_value.rRLP__APDU();
} else {
single_value->field_rRLP__APDU.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__Cause().get_selection()) {
single_value->field_lCS__Cause = other_value.lCS__Cause();
} else {
single_value->field_lCS__Cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__POSITION__RESPONSE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__POSITION__RESPONSE_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__POSITION__RESPONSE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__POSITION__RESPONSE_template::PDU__BSSGP__POSITION__RESPONSE_template()
{
}

PDU__BSSGP__POSITION__RESPONSE_template::PDU__BSSGP__POSITION__RESPONSE_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__POSITION__RESPONSE_template::PDU__BSSGP__POSITION__RESPONSE_template(const PDU__BSSGP__POSITION__RESPONSE& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__POSITION__RESPONSE_template::PDU__BSSGP__POSITION__RESPONSE_template(const OPTIONAL<PDU__BSSGP__POSITION__RESPONSE>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__POSITION__RESPONSE&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE from an unbound optional field.");
}
}

PDU__BSSGP__POSITION__RESPONSE_template::PDU__BSSGP__POSITION__RESPONSE_template(PDU__BSSGP__POSITION__RESPONSE_template* p_precondition, PDU__BSSGP__POSITION__RESPONSE_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__POSITION__RESPONSE_template::PDU__BSSGP__POSITION__RESPONSE_template(Dynamic_Match_Interface<PDU__BSSGP__POSITION__RESPONSE>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__POSITION__RESPONSE>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__POSITION__RESPONSE_template::PDU__BSSGP__POSITION__RESPONSE_template(const PDU__BSSGP__POSITION__RESPONSE_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__POSITION__RESPONSE_template::~PDU__BSSGP__POSITION__RESPONSE_template()
{
clean_up();
}

PDU__BSSGP__POSITION__RESPONSE_template& PDU__BSSGP__POSITION__RESPONSE_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__POSITION__RESPONSE_template& PDU__BSSGP__POSITION__RESPONSE_template::operator=(const PDU__BSSGP__POSITION__RESPONSE& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__POSITION__RESPONSE_template& PDU__BSSGP__POSITION__RESPONSE_template::operator=(const OPTIONAL<PDU__BSSGP__POSITION__RESPONSE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__POSITION__RESPONSE&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
}
return *this;
}

PDU__BSSGP__POSITION__RESPONSE_template& PDU__BSSGP__POSITION__RESPONSE_template::operator=(const PDU__BSSGP__POSITION__RESPONSE_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__POSITION__RESPONSE_template::match(const PDU__BSSGP__POSITION__RESPONSE& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.bVCI().is_bound()) return FALSE;
if(!single_value->field_bVCI.match(other_value.bVCI(), legacy))return FALSE;
if(!other_value.rRLP__Flags().is_bound()) return FALSE;
if((other_value.rRLP__Flags().ispresent() ? !single_value->field_rRLP__Flags.match((const RRLP__Flags__BSSGP&)other_value.rRLP__Flags(), legacy) : !single_value->field_rRLP__Flags.match_omit(legacy)))return FALSE;
if(!other_value.rRLP__APDU().is_bound()) return FALSE;
if((other_value.rRLP__APDU().ispresent() ? !single_value->field_rRLP__APDU.match((const RRLP__APDU__BSSGP&)other_value.rRLP__APDU(), legacy) : !single_value->field_rRLP__APDU.match_omit(legacy)))return FALSE;
if(!other_value.lCS__Cause().is_bound()) return FALSE;
if((other_value.lCS__Cause().ispresent() ? !single_value->field_lCS__Cause.match((const LCS__Cause__BSSGP&)other_value.lCS__Cause(), legacy) : !single_value->field_lCS__Cause.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
}
return FALSE;
}

boolean PDU__BSSGP__POSITION__RESPONSE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_bVCI.is_bound()
 || (single_value->field_rRLP__Flags.is_omit() || single_value->field_rRLP__Flags.is_bound())
 || (single_value->field_rRLP__APDU.is_omit() || single_value->field_rRLP__APDU.is_bound())
 || (single_value->field_lCS__Cause.is_omit() || single_value->field_lCS__Cause.is_bound());
}

boolean PDU__BSSGP__POSITION__RESPONSE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_bVCI.is_value()
 && (single_value->field_rRLP__Flags.is_omit() || single_value->field_rRLP__Flags.is_value())
 && (single_value->field_rRLP__APDU.is_omit() || single_value->field_rRLP__APDU.is_value())
 && (single_value->field_lCS__Cause.is_omit() || single_value->field_lCS__Cause.is_value());
}

void PDU__BSSGP__POSITION__RESPONSE_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__POSITION__RESPONSE PDU__BSSGP__POSITION__RESPONSE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
PDU__BSSGP__POSITION__RESPONSE ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_bVCI.is_bound()) {
ret_val.bVCI() = single_value->field_bVCI.valueof();
}
if (single_value->field_rRLP__Flags.is_omit()) ret_val.rRLP__Flags() = OMIT_VALUE;
else if (single_value->field_rRLP__Flags.is_bound()) {
ret_val.rRLP__Flags() = single_value->field_rRLP__Flags.valueof();
}
if (single_value->field_rRLP__APDU.is_omit()) ret_val.rRLP__APDU() = OMIT_VALUE;
else if (single_value->field_rRLP__APDU.is_bound()) {
ret_val.rRLP__APDU() = single_value->field_rRLP__APDU.valueof();
}
if (single_value->field_lCS__Cause.is_omit()) ret_val.lCS__Cause() = OMIT_VALUE;
else if (single_value->field_lCS__Cause.is_bound()) {
ret_val.lCS__Cause() = single_value->field_lCS__Cause.valueof();
}
return ret_val;
}

void PDU__BSSGP__POSITION__RESPONSE_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__POSITION__RESPONSE_template[list_length];
}

PDU__BSSGP__POSITION__RESPONSE_template& PDU__BSSGP__POSITION__RESPONSE_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__POSITION__RESPONSE_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__POSITION__RESPONSE_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
return single_value->field_tLLI;
}

BVCI_template& PDU__BSSGP__POSITION__RESPONSE_template::bVCI()
{
set_specific();
return single_value->field_bVCI;
}

const BVCI_template& PDU__BSSGP__POSITION__RESPONSE_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bVCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
return single_value->field_bVCI;
}

RRLP__Flags__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::rRLP__Flags()
{
set_specific();
return single_value->field_rRLP__Flags;
}

const RRLP__Flags__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::rRLP__Flags() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rRLP_Flags of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
return single_value->field_rRLP__Flags;
}

RRLP__APDU__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::rRLP__APDU()
{
set_specific();
return single_value->field_rRLP__APDU;
}

const RRLP__APDU__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::rRLP__APDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rRLP_APDU of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
return single_value->field_rRLP__APDU;
}

LCS__Cause__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::lCS__Cause()
{
set_specific();
return single_value->field_lCS__Cause;
}

const LCS__Cause__BSSGP_template& PDU__BSSGP__POSITION__RESPONSE_template::lCS__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_Cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
return single_value->field_lCS__Cause;
}

int PDU__BSSGP__POSITION__RESPONSE_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_rRLP__Flags.is_present()) ret_val++;
      if (single_value->field_rRLP__APDU.is_present()) ret_val++;
      if (single_value->field_lCS__Cause.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
  }
  return 0;
}

void PDU__BSSGP__POSITION__RESPONSE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log();
TTCN_Logger::log_event_str(", rRLP_Flags := ");
single_value->field_rRLP__Flags.log();
TTCN_Logger::log_event_str(", rRLP_APDU := ");
single_value->field_rRLP__APDU.log();
TTCN_Logger::log_event_str(", lCS_Cause := ");
single_value->field_lCS__Cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__POSITION__RESPONSE_template::log_match(const PDU__BSSGP__POSITION__RESPONSE& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bVCI.match(match_value.bVCI(), legacy)){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rRLP__Flags().ispresent()){
if(!single_value->field_rRLP__Flags.match(match_value.rRLP__Flags(), legacy)){
TTCN_Logger::log_logmatch_info(".rRLP_Flags");
single_value->field_rRLP__Flags.log_match(match_value.rRLP__Flags(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rRLP__Flags.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rRLP_Flags := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rRLP__Flags.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.rRLP__APDU().ispresent()){
if(!single_value->field_rRLP__APDU.match(match_value.rRLP__APDU(), legacy)){
TTCN_Logger::log_logmatch_info(".rRLP_APDU");
single_value->field_rRLP__APDU.log_match(match_value.rRLP__APDU(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rRLP__APDU.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rRLP_APDU := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rRLP__APDU.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lCS__Cause().ispresent()){
if(!single_value->field_lCS__Cause.match(match_value.lCS__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_Cause");
single_value->field_lCS__Cause.log_match(match_value.lCS__Cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lCS__Cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lCS_Cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lCS__Cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", bVCI := ");
single_value->field_bVCI.log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(", rRLP_Flags := ");
if (match_value.rRLP__Flags().ispresent()) {
single_value->field_rRLP__Flags.log_match(match_value.rRLP__Flags(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rRLP__Flags.log();
if (single_value->field_rRLP__Flags.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", rRLP_APDU := ");
if (match_value.rRLP__APDU().ispresent()) {
single_value->field_rRLP__APDU.log_match(match_value.rRLP__APDU(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rRLP__APDU.log();
if (single_value->field_rRLP__APDU.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lCS_Cause := ");
if (match_value.lCS__Cause().ispresent()) {
single_value->field_lCS__Cause.log_match(match_value.lCS__Cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lCS__Cause.log();
if (single_value->field_lCS__Cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__POSITION__RESPONSE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_bVCI.encode_text(text_buf);
single_value->field_rRLP__Flags.encode_text(text_buf);
single_value->field_rRLP__APDU.encode_text(text_buf);
single_value->field_lCS__Cause.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
}
}

void PDU__BSSGP__POSITION__RESPONSE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_bVCI.decode_text(text_buf);
single_value->field_rRLP__Flags.decode_text(text_buf);
single_value->field_rRLP__APDU.decode_text(text_buf);
single_value->field_lCS__Cause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__POSITION__RESPONSE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE.");
}
}

void PDU__BSSGP__POSITION__RESPONSE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__POSITION__RESPONSE_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bVCI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rRLP__Flags().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rRLP__APDU().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lCS__Cause().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bVCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bVCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_Flags")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__Flags().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rRLP_APDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRLP__APDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lCS_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__POSITION__RESPONSE_template* precondition = new PDU__BSSGP__POSITION__RESPONSE_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__POSITION__RESPONSE_template* implied_template = new PDU__BSSGP__POSITION__RESPONSE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__POSITION__RESPONSE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__POSITION__RESPONSE_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
single_value->field_bVCI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
single_value->field_rRLP__Flags.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
single_value->field_rRLP__APDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
single_value->field_lCS__Cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_POSITION_RESPONSE");
}

boolean PDU__BSSGP__POSITION__RESPONSE_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__POSITION__RESPONSE_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__RAN__INFORMATION__REQUEST::PDU__BSSGP__RAN__INFORMATION__REQUEST()
{
}

PDU__BSSGP__RAN__INFORMATION__REQUEST::PDU__BSSGP__RAN__INFORMATION__REQUEST(const OCTETSTRING& par_bssgpPduType,
    const RIM__Routing__Information& par_destination__Cell__Identifier,
    const RIM__Routing__Information& par_source__Cell__Identifier,
    const RAN__Information__Request__RIM__Container& par_rIM__Container)
  :   field_bssgpPduType(par_bssgpPduType),
  field_destination__Cell__Identifier(par_destination__Cell__Identifier),
  field_source__Cell__Identifier(par_source__Cell__Identifier),
  field_rIM__Container(par_rIM__Container)
{
}

PDU__BSSGP__RAN__INFORMATION__REQUEST::PDU__BSSGP__RAN__INFORMATION__REQUEST(const PDU__BSSGP__RAN__INFORMATION__REQUEST& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.destination__Cell__Identifier().is_bound()) field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
else field_destination__Cell__Identifier.clean_up();
if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
else field_source__Cell__Identifier.clean_up();
if (other_value.rIM__Container().is_bound()) field_rIM__Container = other_value.rIM__Container();
else field_rIM__Container.clean_up();
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST::clean_up()
{
field_bssgpPduType.clean_up();
field_destination__Cell__Identifier.clean_up();
field_source__Cell__Identifier.clean_up();
field_rIM__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RAN__INFORMATION__REQUEST::get_descriptor() const { return &PDU__BSSGP__RAN__INFORMATION__REQUEST_descr_; }
PDU__BSSGP__RAN__INFORMATION__REQUEST& PDU__BSSGP__RAN__INFORMATION__REQUEST::operator=(const PDU__BSSGP__RAN__INFORMATION__REQUEST& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.destination__Cell__Identifier().is_bound()) field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
  else field_destination__Cell__Identifier.clean_up();
  if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
  else field_source__Cell__Identifier.clean_up();
  if (other_value.rIM__Container().is_bound()) field_rIM__Container = other_value.rIM__Container();
  else field_rIM__Container.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RAN__INFORMATION__REQUEST::operator==(const PDU__BSSGP__RAN__INFORMATION__REQUEST& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_destination__Cell__Identifier==other_value.field_destination__Cell__Identifier
  && field_source__Cell__Identifier==other_value.field_source__Cell__Identifier
  && field_rIM__Container==other_value.field_rIM__Container;
}

boolean PDU__BSSGP__RAN__INFORMATION__REQUEST::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_destination__Cell__Identifier.is_bound())
  || (field_source__Cell__Identifier.is_bound())
  || (field_rIM__Container.is_bound());
}
boolean PDU__BSSGP__RAN__INFORMATION__REQUEST::is_value() const
{
return field_bssgpPduType.is_value()
  && field_destination__Cell__Identifier.is_value()
  && field_source__Cell__Identifier.is_value()
  && field_rIM__Container.is_value();
}
void PDU__BSSGP__RAN__INFORMATION__REQUEST::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", destination_Cell_Identifier := ");
field_destination__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", rIM_Container := ");
field_rIM__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (destination__Cell__Identifier().is_bound()) destination__Cell__Identifier().set_implicit_omit();
if (source__Cell__Identifier().is_bound()) source__Cell__Identifier().set_implicit_omit();
if (rIM__Container().is_bound()) rIM__Container().set_implicit_omit();
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destination__Cell__Identifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Container().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destination_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destination__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "rIM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__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.PDU_BSSGP_RAN_INFORMATION_REQUEST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST");
  }
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_destination__Cell__Identifier.encode_text(text_buf);
field_source__Cell__Identifier.encode_text(text_buf);
field_rIM__Container.encode_text(text_buf);
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_destination__Cell__Identifier.decode_text(text_buf);
field_source__Cell__Identifier.decode_text(text_buf);
field_rIM__Container.decode_text(text_buf);
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__RAN__INFORMATION__REQUEST::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RIM__Routing__Information_descr_.raw->forceomit);
  decoded_field_length = field_destination__Cell__Identifier.RAW_decode(RIM__Routing__Information_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, RIM__Routing__Information_descr_.raw->forceomit);
  decoded_field_length = field_source__Cell__Identifier.RAW_decode(RIM__Routing__Information_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, RAN__Information__Request__RIM__Container_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Container.RAW_decode(RAN__Information__Request__RIM__Container_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_139) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RAN__INFORMATION__REQUEST::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, RIM__Routing__Information_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RIM__Routing__Information_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RAN__Information__Request__RIM__Container_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destination__Cell__Identifier.RAW_encode(RIM__Routing__Information_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_source__Cell__Identifier.RAW_encode(RIM__Routing__Information_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rIM__Container.RAW_encode(RAN__Information__Request__RIM__Container_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  os_139) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_139.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RAN__INFORMATION__REQUEST_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
RIM__Routing__Information_template field_destination__Cell__Identifier;
RIM__Routing__Information_template field_source__Cell__Identifier;
RAN__Information__Request__RIM__Container_template field_rIM__Container;
};

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_destination__Cell__Identifier = ANY_VALUE;
single_value->field_source__Cell__Identifier = ANY_VALUE;
single_value->field_rIM__Container = ANY_VALUE;
}
}
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::copy_value(const PDU__BSSGP__RAN__INFORMATION__REQUEST& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.destination__Cell__Identifier().is_bound()) {
  single_value->field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
} else {
  single_value->field_destination__Cell__Identifier.clean_up();
}
if (other_value.source__Cell__Identifier().is_bound()) {
  single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
  single_value->field_source__Cell__Identifier.clean_up();
}
if (other_value.rIM__Container().is_bound()) {
  single_value->field_rIM__Container = other_value.rIM__Container();
} else {
  single_value->field_rIM__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::copy_template(const PDU__BSSGP__RAN__INFORMATION__REQUEST_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destination__Cell__Identifier().get_selection()) {
single_value->field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
} else {
single_value->field_destination__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__Cell__Identifier().get_selection()) {
single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
single_value->field_source__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Container().get_selection()) {
single_value->field_rIM__Container = other_value.rIM__Container();
} else {
single_value->field_rIM__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 PDU__BSSGP__RAN__INFORMATION__REQUEST_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RAN__INFORMATION__REQUEST_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RAN__INFORMATION__REQUEST_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::PDU__BSSGP__RAN__INFORMATION__REQUEST_template()
{
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::PDU__BSSGP__RAN__INFORMATION__REQUEST_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::PDU__BSSGP__RAN__INFORMATION__REQUEST_template(const PDU__BSSGP__RAN__INFORMATION__REQUEST& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::PDU__BSSGP__RAN__INFORMATION__REQUEST_template(const OPTIONAL<PDU__BSSGP__RAN__INFORMATION__REQUEST>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RAN__INFORMATION__REQUEST&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST from an unbound optional field.");
}
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::PDU__BSSGP__RAN__INFORMATION__REQUEST_template(PDU__BSSGP__RAN__INFORMATION__REQUEST_template* p_precondition, PDU__BSSGP__RAN__INFORMATION__REQUEST_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::PDU__BSSGP__RAN__INFORMATION__REQUEST_template(Dynamic_Match_Interface<PDU__BSSGP__RAN__INFORMATION__REQUEST>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__RAN__INFORMATION__REQUEST>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::PDU__BSSGP__RAN__INFORMATION__REQUEST_template(const PDU__BSSGP__RAN__INFORMATION__REQUEST_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template::~PDU__BSSGP__RAN__INFORMATION__REQUEST_template()
{
clean_up();
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::operator=(const PDU__BSSGP__RAN__INFORMATION__REQUEST& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::operator=(const OPTIONAL<PDU__BSSGP__RAN__INFORMATION__REQUEST>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RAN__INFORMATION__REQUEST&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
}
return *this;
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::operator=(const PDU__BSSGP__RAN__INFORMATION__REQUEST_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__RAN__INFORMATION__REQUEST_template::match(const PDU__BSSGP__RAN__INFORMATION__REQUEST& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.destination__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_destination__Cell__Identifier.match(other_value.destination__Cell__Identifier(), legacy))return FALSE;
if(!other_value.source__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_source__Cell__Identifier.match(other_value.source__Cell__Identifier(), legacy))return FALSE;
if(!other_value.rIM__Container().is_bound()) return FALSE;
if(!single_value->field_rIM__Container.match(other_value.rIM__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.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
}
return FALSE;
}

boolean PDU__BSSGP__RAN__INFORMATION__REQUEST_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_destination__Cell__Identifier.is_bound()
 || single_value->field_source__Cell__Identifier.is_bound()
 || single_value->field_rIM__Container.is_bound();
}

boolean PDU__BSSGP__RAN__INFORMATION__REQUEST_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_destination__Cell__Identifier.is_value()
 && single_value->field_source__Cell__Identifier.is_value()
 && single_value->field_rIM__Container.is_value();
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__RAN__INFORMATION__REQUEST PDU__BSSGP__RAN__INFORMATION__REQUEST_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
PDU__BSSGP__RAN__INFORMATION__REQUEST ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_destination__Cell__Identifier.is_bound()) {
ret_val.destination__Cell__Identifier() = single_value->field_destination__Cell__Identifier.valueof();
}
if (single_value->field_source__Cell__Identifier.is_bound()) {
ret_val.source__Cell__Identifier() = single_value->field_source__Cell__Identifier.valueof();
}
if (single_value->field_rIM__Container.is_bound()) {
ret_val.rIM__Container() = single_value->field_rIM__Container.valueof();
}
return ret_val;
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RAN__INFORMATION__REQUEST_template[list_length];
}

PDU__BSSGP__RAN__INFORMATION__REQUEST_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
return single_value->field_bssgpPduType;
}

RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::destination__Cell__Identifier()
{
set_specific();
return single_value->field_destination__Cell__Identifier;
}

const RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::destination__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destination_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
return single_value->field_destination__Cell__Identifier;
}

RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::source__Cell__Identifier()
{
set_specific();
return single_value->field_source__Cell__Identifier;
}

const RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::source__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
return single_value->field_source__Cell__Identifier;
}

RAN__Information__Request__RIM__Container_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::rIM__Container()
{
set_specific();
return single_value->field_rIM__Container;
}

const RAN__Information__Request__RIM__Container_template& PDU__BSSGP__RAN__INFORMATION__REQUEST_template::rIM__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Container of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
return single_value->field_rIM__Container;
}

int PDU__BSSGP__RAN__INFORMATION__REQUEST_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
  }
  return 0;
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", destination_Cell_Identifier := ");
single_value->field_destination__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", rIM_Container := ");
single_value->field_rIM__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 PDU__BSSGP__RAN__INFORMATION__REQUEST_template::log_match(const PDU__BSSGP__RAN__INFORMATION__REQUEST& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destination__Cell__Identifier.match(match_value.destination__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".destination_Cell_Identifier");
single_value->field_destination__Cell__Identifier.log_match(match_value.destination__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_source__Cell__Identifier.match(match_value.source__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".source_Cell_Identifier");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__Container.match(match_value.rIM__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Container");
single_value->field_rIM__Container.log_match(match_value.rIM__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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", destination_Cell_Identifier := ");
single_value->field_destination__Cell__Identifier.log_match(match_value.destination__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", rIM_Container := ");
single_value->field_rIM__Container.log_match(match_value.rIM__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 PDU__BSSGP__RAN__INFORMATION__REQUEST_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_destination__Cell__Identifier.encode_text(text_buf);
single_value->field_source__Cell__Identifier.encode_text(text_buf);
single_value->field_rIM__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.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
}
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_destination__Cell__Identifier.decode_text(text_buf);
single_value->field_source__Cell__Identifier.decode_text(text_buf);
single_value->field_rIM__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 PDU__BSSGP__RAN__INFORMATION__REQUEST_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST.");
}
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__RAN__INFORMATION__REQUEST_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destination__Cell__Identifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Container().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destination_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destination__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "rIM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__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.PDU_BSSGP_RAN_INFORMATION_REQUEST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RAN__INFORMATION__REQUEST_template* precondition = new PDU__BSSGP__RAN__INFORMATION__REQUEST_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RAN__INFORMATION__REQUEST_template* implied_template = new PDU__BSSGP__RAN__INFORMATION__REQUEST_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RAN__INFORMATION__REQUEST_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RAN__INFORMATION__REQUEST_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST");
single_value->field_destination__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST");
single_value->field_source__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST");
single_value->field_rIM__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION_REQUEST");
}

boolean PDU__BSSGP__RAN__INFORMATION__REQUEST_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__RAN__INFORMATION__REQUEST_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__RAN__INFORMATION::PDU__BSSGP__RAN__INFORMATION()
{
}

PDU__BSSGP__RAN__INFORMATION::PDU__BSSGP__RAN__INFORMATION(const OCTETSTRING& par_bssgpPduType,
    const RIM__Routing__Information& par_destination__Cell__Identifier,
    const RIM__Routing__Information& par_source__Cell__Identifier,
    const RAN__Information__RIM__Container& par_rIM__Container)
  :   field_bssgpPduType(par_bssgpPduType),
  field_destination__Cell__Identifier(par_destination__Cell__Identifier),
  field_source__Cell__Identifier(par_source__Cell__Identifier),
  field_rIM__Container(par_rIM__Container)
{
}

PDU__BSSGP__RAN__INFORMATION::PDU__BSSGP__RAN__INFORMATION(const PDU__BSSGP__RAN__INFORMATION& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.destination__Cell__Identifier().is_bound()) field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
else field_destination__Cell__Identifier.clean_up();
if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
else field_source__Cell__Identifier.clean_up();
if (other_value.rIM__Container().is_bound()) field_rIM__Container = other_value.rIM__Container();
else field_rIM__Container.clean_up();
}

void PDU__BSSGP__RAN__INFORMATION::clean_up()
{
field_bssgpPduType.clean_up();
field_destination__Cell__Identifier.clean_up();
field_source__Cell__Identifier.clean_up();
field_rIM__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RAN__INFORMATION::get_descriptor() const { return &PDU__BSSGP__RAN__INFORMATION_descr_; }
PDU__BSSGP__RAN__INFORMATION& PDU__BSSGP__RAN__INFORMATION::operator=(const PDU__BSSGP__RAN__INFORMATION& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.destination__Cell__Identifier().is_bound()) field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
  else field_destination__Cell__Identifier.clean_up();
  if (other_value.source__Cell__Identifier().is_bound()) field_source__Cell__Identifier = other_value.source__Cell__Identifier();
  else field_source__Cell__Identifier.clean_up();
  if (other_value.rIM__Container().is_bound()) field_rIM__Container = other_value.rIM__Container();
  else field_rIM__Container.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RAN__INFORMATION::operator==(const PDU__BSSGP__RAN__INFORMATION& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_destination__Cell__Identifier==other_value.field_destination__Cell__Identifier
  && field_source__Cell__Identifier==other_value.field_source__Cell__Identifier
  && field_rIM__Container==other_value.field_rIM__Container;
}

boolean PDU__BSSGP__RAN__INFORMATION::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_destination__Cell__Identifier.is_bound())
  || (field_source__Cell__Identifier.is_bound())
  || (field_rIM__Container.is_bound());
}
boolean PDU__BSSGP__RAN__INFORMATION::is_value() const
{
return field_bssgpPduType.is_value()
  && field_destination__Cell__Identifier.is_value()
  && field_source__Cell__Identifier.is_value()
  && field_rIM__Container.is_value();
}
void PDU__BSSGP__RAN__INFORMATION::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", destination_Cell_Identifier := ");
field_destination__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", rIM_Container := ");
field_rIM__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RAN__INFORMATION::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (destination__Cell__Identifier().is_bound()) destination__Cell__Identifier().set_implicit_omit();
if (source__Cell__Identifier().is_bound()) source__Cell__Identifier().set_implicit_omit();
if (rIM__Container().is_bound()) rIM__Container().set_implicit_omit();
}

void PDU__BSSGP__RAN__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 (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destination__Cell__Identifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Container().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destination_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destination__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "rIM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__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.PDU_BSSGP_RAN_INFORMATION: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION");
  }
}

void PDU__BSSGP__RAN__INFORMATION::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_destination__Cell__Identifier.encode_text(text_buf);
field_source__Cell__Identifier.encode_text(text_buf);
field_rIM__Container.encode_text(text_buf);
}

void PDU__BSSGP__RAN__INFORMATION::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_destination__Cell__Identifier.decode_text(text_buf);
field_source__Cell__Identifier.decode_text(text_buf);
field_rIM__Container.decode_text(text_buf);
}

void PDU__BSSGP__RAN__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 PDU__BSSGP__RAN__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 PDU__BSSGP__RAN__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;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RIM__Routing__Information_descr_.raw->forceomit);
  decoded_field_length = field_destination__Cell__Identifier.RAW_decode(RIM__Routing__Information_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, RIM__Routing__Information_descr_.raw->forceomit);
  decoded_field_length = field_source__Cell__Identifier.RAW_decode(RIM__Routing__Information_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, RAN__Information__RIM__Container_descr_.raw->forceomit);
  decoded_field_length = field_rIM__Container.RAW_decode(RAN__Information__RIM__Container_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_118) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RAN__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 = 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, RIM__Routing__Information_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RIM__Routing__Information_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RAN__Information__RIM__Container_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destination__Cell__Identifier.RAW_encode(RIM__Routing__Information_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_source__Cell__Identifier.RAW_encode(RIM__Routing__Information_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rIM__Container.RAW_encode(RAN__Information__RIM__Container_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  os_118) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_118.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RAN__INFORMATION_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
RIM__Routing__Information_template field_destination__Cell__Identifier;
RIM__Routing__Information_template field_source__Cell__Identifier;
RAN__Information__RIM__Container_template field_rIM__Container;
};

void PDU__BSSGP__RAN__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_bssgpPduType = ANY_VALUE;
single_value->field_destination__Cell__Identifier = ANY_VALUE;
single_value->field_source__Cell__Identifier = ANY_VALUE;
single_value->field_rIM__Container = ANY_VALUE;
}
}
}

void PDU__BSSGP__RAN__INFORMATION_template::copy_value(const PDU__BSSGP__RAN__INFORMATION& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.destination__Cell__Identifier().is_bound()) {
  single_value->field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
} else {
  single_value->field_destination__Cell__Identifier.clean_up();
}
if (other_value.source__Cell__Identifier().is_bound()) {
  single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
  single_value->field_source__Cell__Identifier.clean_up();
}
if (other_value.rIM__Container().is_bound()) {
  single_value->field_rIM__Container = other_value.rIM__Container();
} else {
  single_value->field_rIM__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RAN__INFORMATION_template::copy_template(const PDU__BSSGP__RAN__INFORMATION_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destination__Cell__Identifier().get_selection()) {
single_value->field_destination__Cell__Identifier = other_value.destination__Cell__Identifier();
} else {
single_value->field_destination__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__Cell__Identifier().get_selection()) {
single_value->field_source__Cell__Identifier = other_value.source__Cell__Identifier();
} else {
single_value->field_source__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rIM__Container().get_selection()) {
single_value->field_rIM__Container = other_value.rIM__Container();
} else {
single_value->field_rIM__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 PDU__BSSGP__RAN__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 PDU__BSSGP__RAN__INFORMATION_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RAN__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.PDU_BSSGP_RAN_INFORMATION.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RAN__INFORMATION_template::PDU__BSSGP__RAN__INFORMATION_template()
{
}

PDU__BSSGP__RAN__INFORMATION_template::PDU__BSSGP__RAN__INFORMATION_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__RAN__INFORMATION_template::PDU__BSSGP__RAN__INFORMATION_template(const PDU__BSSGP__RAN__INFORMATION& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__RAN__INFORMATION_template::PDU__BSSGP__RAN__INFORMATION_template(const OPTIONAL<PDU__BSSGP__RAN__INFORMATION>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RAN__INFORMATION&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION from an unbound optional field.");
}
}

PDU__BSSGP__RAN__INFORMATION_template::PDU__BSSGP__RAN__INFORMATION_template(PDU__BSSGP__RAN__INFORMATION_template* p_precondition, PDU__BSSGP__RAN__INFORMATION_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__RAN__INFORMATION_template::PDU__BSSGP__RAN__INFORMATION_template(Dynamic_Match_Interface<PDU__BSSGP__RAN__INFORMATION>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__RAN__INFORMATION>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__RAN__INFORMATION_template::PDU__BSSGP__RAN__INFORMATION_template(const PDU__BSSGP__RAN__INFORMATION_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__RAN__INFORMATION_template::~PDU__BSSGP__RAN__INFORMATION_template()
{
clean_up();
}

PDU__BSSGP__RAN__INFORMATION_template& PDU__BSSGP__RAN__INFORMATION_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__RAN__INFORMATION_template& PDU__BSSGP__RAN__INFORMATION_template::operator=(const PDU__BSSGP__RAN__INFORMATION& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__RAN__INFORMATION_template& PDU__BSSGP__RAN__INFORMATION_template::operator=(const OPTIONAL<PDU__BSSGP__RAN__INFORMATION>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RAN__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.PDU_BSSGP_RAN_INFORMATION.");
}
return *this;
}

PDU__BSSGP__RAN__INFORMATION_template& PDU__BSSGP__RAN__INFORMATION_template::operator=(const PDU__BSSGP__RAN__INFORMATION_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__RAN__INFORMATION_template::match(const PDU__BSSGP__RAN__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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.destination__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_destination__Cell__Identifier.match(other_value.destination__Cell__Identifier(), legacy))return FALSE;
if(!other_value.source__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_source__Cell__Identifier.match(other_value.source__Cell__Identifier(), legacy))return FALSE;
if(!other_value.rIM__Container().is_bound()) return FALSE;
if(!single_value->field_rIM__Container.match(other_value.rIM__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.PDU_BSSGP_RAN_INFORMATION.");
}
return FALSE;
}

boolean PDU__BSSGP__RAN__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_bssgpPduType.is_bound()
 || single_value->field_destination__Cell__Identifier.is_bound()
 || single_value->field_source__Cell__Identifier.is_bound()
 || single_value->field_rIM__Container.is_bound();
}

boolean PDU__BSSGP__RAN__INFORMATION_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_destination__Cell__Identifier.is_value()
 && single_value->field_source__Cell__Identifier.is_value()
 && single_value->field_rIM__Container.is_value();
}

void PDU__BSSGP__RAN__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;
}

PDU__BSSGP__RAN__INFORMATION PDU__BSSGP__RAN__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.PDU_BSSGP_RAN_INFORMATION.");
PDU__BSSGP__RAN__INFORMATION ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_destination__Cell__Identifier.is_bound()) {
ret_val.destination__Cell__Identifier() = single_value->field_destination__Cell__Identifier.valueof();
}
if (single_value->field_source__Cell__Identifier.is_bound()) {
ret_val.source__Cell__Identifier() = single_value->field_source__Cell__Identifier.valueof();
}
if (single_value->field_rIM__Container.is_bound()) {
ret_val.rIM__Container() = single_value->field_rIM__Container.valueof();
}
return ret_val;
}

void PDU__BSSGP__RAN__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.PDU_BSSGP_RAN_INFORMATION.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RAN__INFORMATION_template[list_length];
}

PDU__BSSGP__RAN__INFORMATION_template& PDU__BSSGP__RAN__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.PDU_BSSGP_RAN_INFORMATION.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__RAN__INFORMATION_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RAN__INFORMATION_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
return single_value->field_bssgpPduType;
}

RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION_template::destination__Cell__Identifier()
{
set_specific();
return single_value->field_destination__Cell__Identifier;
}

const RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION_template::destination__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destination_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
return single_value->field_destination__Cell__Identifier;
}

RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION_template::source__Cell__Identifier()
{
set_specific();
return single_value->field_source__Cell__Identifier;
}

const RIM__Routing__Information_template& PDU__BSSGP__RAN__INFORMATION_template::source__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_Cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
return single_value->field_source__Cell__Identifier;
}

RAN__Information__RIM__Container_template& PDU__BSSGP__RAN__INFORMATION_template::rIM__Container()
{
set_specific();
return single_value->field_rIM__Container;
}

const RAN__Information__RIM__Container_template& PDU__BSSGP__RAN__INFORMATION_template::rIM__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rIM_Container of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
return single_value->field_rIM__Container;
}

int PDU__BSSGP__RAN__INFORMATION_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_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.PDU_BSSGP_RAN_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.PDU_BSSGP_RAN_INFORMATION containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION.");
  }
  return 0;
}

void PDU__BSSGP__RAN__INFORMATION_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", destination_Cell_Identifier := ");
single_value->field_destination__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log();
TTCN_Logger::log_event_str(", rIM_Container := ");
single_value->field_rIM__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 PDU__BSSGP__RAN__INFORMATION_template::log_match(const PDU__BSSGP__RAN__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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destination__Cell__Identifier.match(match_value.destination__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".destination_Cell_Identifier");
single_value->field_destination__Cell__Identifier.log_match(match_value.destination__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_source__Cell__Identifier.match(match_value.source__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".source_Cell_Identifier");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rIM__Container.match(match_value.rIM__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".rIM_Container");
single_value->field_rIM__Container.log_match(match_value.rIM__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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", destination_Cell_Identifier := ");
single_value->field_destination__Cell__Identifier.log_match(match_value.destination__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", source_Cell_Identifier := ");
single_value->field_source__Cell__Identifier.log_match(match_value.source__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", rIM_Container := ");
single_value->field_rIM__Container.log_match(match_value.rIM__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 PDU__BSSGP__RAN__INFORMATION_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_destination__Cell__Identifier.encode_text(text_buf);
single_value->field_source__Cell__Identifier.encode_text(text_buf);
single_value->field_rIM__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.PDU_BSSGP_RAN_INFORMATION.");
}
}

void PDU__BSSGP__RAN__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_bssgpPduType.decode_text(text_buf);
single_value->field_destination__Cell__Identifier.decode_text(text_buf);
single_value->field_source__Cell__Identifier.decode_text(text_buf);
single_value->field_rIM__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 PDU__BSSGP__RAN__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.PDU_BSSGP_RAN_INFORMATION.");
}
}

void PDU__BSSGP__RAN__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: {
    PDU__BSSGP__RAN__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 (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_RAN_INFORMATION has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destination__Cell__Identifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) source__Cell__Identifier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rIM__Container().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destination_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destination__Cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__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(), "rIM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rIM__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.PDU_BSSGP_RAN_INFORMATION: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RAN__INFORMATION_template* precondition = new PDU__BSSGP__RAN__INFORMATION_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RAN__INFORMATION_template* implied_template = new PDU__BSSGP__RAN__INFORMATION_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RAN__INFORMATION_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RAN__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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION");
single_value->field_destination__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION");
single_value->field_source__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_INFORMATION");
single_value->field_rIM__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RAN_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.PDU_BSSGP_RAN_INFORMATION");
}

boolean PDU__BSSGP__RAN__INFORMATION_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__RAN__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;
}


} /* end of namespace */
