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

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

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

/* Including header files */

#include "MobileL3_GMM_SM_Types.hh"

namespace MobileL3__GMM__SM__Types {

/* Member functions of C++ classes */

PacketFilterIdentifier__CreateAddReplaceTFT::PacketFilterIdentifier__CreateAddReplaceTFT()
{
}

PacketFilterIdentifier__CreateAddReplaceTFT::PacketFilterIdentifier__CreateAddReplaceTFT(const BITSTRING& par_packetFilterIdentifier,
    const BITSTRING& par_packetFilterDirection,
    const BITSTRING& par_spare)
  :   field_packetFilterIdentifier(par_packetFilterIdentifier),
  field_packetFilterDirection(par_packetFilterDirection),
  field_spare(par_spare)
{
}

PacketFilterIdentifier__CreateAddReplaceTFT::PacketFilterIdentifier__CreateAddReplaceTFT(const PacketFilterIdentifier__CreateAddReplaceTFT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT.");
if (other_value.packetFilterIdentifier().is_bound()) field_packetFilterIdentifier = other_value.packetFilterIdentifier();
else field_packetFilterIdentifier.clean_up();
if (other_value.packetFilterDirection().is_bound()) field_packetFilterDirection = other_value.packetFilterDirection();
else field_packetFilterDirection.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void PacketFilterIdentifier__CreateAddReplaceTFT::clean_up()
{
field_packetFilterIdentifier.clean_up();
field_packetFilterDirection.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* PacketFilterIdentifier__CreateAddReplaceTFT::get_descriptor() const { return &PacketFilterIdentifier__CreateAddReplaceTFT_descr_; }
PacketFilterIdentifier__CreateAddReplaceTFT& PacketFilterIdentifier__CreateAddReplaceTFT::operator=(const PacketFilterIdentifier__CreateAddReplaceTFT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT.");
  if (other_value.packetFilterIdentifier().is_bound()) field_packetFilterIdentifier = other_value.packetFilterIdentifier();
  else field_packetFilterIdentifier.clean_up();
  if (other_value.packetFilterDirection().is_bound()) field_packetFilterDirection = other_value.packetFilterDirection();
  else field_packetFilterDirection.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean PacketFilterIdentifier__CreateAddReplaceTFT::operator==(const PacketFilterIdentifier__CreateAddReplaceTFT& other_value) const
{
return field_packetFilterIdentifier==other_value.field_packetFilterIdentifier
  && field_packetFilterDirection==other_value.field_packetFilterDirection
  && field_spare==other_value.field_spare;
}

boolean PacketFilterIdentifier__CreateAddReplaceTFT::is_bound() const
{
return (field_packetFilterIdentifier.is_bound())
  || (field_packetFilterDirection.is_bound())
  || (field_spare.is_bound());
}
boolean PacketFilterIdentifier__CreateAddReplaceTFT::is_value() const
{
return field_packetFilterIdentifier.is_value()
  && field_packetFilterDirection.is_value()
  && field_spare.is_value();
}
void PacketFilterIdentifier__CreateAddReplaceTFT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ packetFilterIdentifier := ");
field_packetFilterIdentifier.log();
TTCN_Logger::log_event_str(", packetFilterDirection := ");
field_packetFilterDirection.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void PacketFilterIdentifier__CreateAddReplaceTFT::set_implicit_omit()
{
if (packetFilterIdentifier().is_bound()) packetFilterIdentifier().set_implicit_omit();
if (packetFilterDirection().is_bound()) packetFilterDirection().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void PacketFilterIdentifier__CreateAddReplaceTFT::encode_text(Text_Buf& text_buf) const
{
field_packetFilterIdentifier.encode_text(text_buf);
field_packetFilterDirection.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void PacketFilterIdentifier__CreateAddReplaceTFT::decode_text(Text_Buf& text_buf)
{
field_packetFilterIdentifier.decode_text(text_buf);
field_packetFilterDirection.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

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

int PacketFilterIdentifier__CreateAddReplaceTFT::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::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT2_descr_.raw);
  encoded_length += field_packetFilterIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_packetFilterDirection.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PacketFilterIdentifier__CreateAddReplaceTFT_template::single_value_struct {
BITSTRING_template field_packetFilterIdentifier;
BITSTRING_template field_packetFilterDirection;
BITSTRING_template field_spare;
};

void PacketFilterIdentifier__CreateAddReplaceTFT_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_packetFilterIdentifier = ANY_VALUE;
single_value->field_packetFilterDirection = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void PacketFilterIdentifier__CreateAddReplaceTFT_template::copy_value(const PacketFilterIdentifier__CreateAddReplaceTFT& other_value)
{
single_value = new single_value_struct;
if (other_value.packetFilterIdentifier().is_bound()) {
  single_value->field_packetFilterIdentifier = other_value.packetFilterIdentifier();
} else {
  single_value->field_packetFilterIdentifier.clean_up();
}
if (other_value.packetFilterDirection().is_bound()) {
  single_value->field_packetFilterDirection = other_value.packetFilterDirection();
} else {
  single_value->field_packetFilterDirection.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PacketFilterIdentifier__CreateAddReplaceTFT_template::copy_template(const PacketFilterIdentifier__CreateAddReplaceTFT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.packetFilterIdentifier().get_selection()) {
single_value->field_packetFilterIdentifier = other_value.packetFilterIdentifier();
} else {
single_value->field_packetFilterIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.packetFilterDirection().get_selection()) {
single_value->field_packetFilterDirection = other_value.packetFilterDirection();
} else {
single_value->field_packetFilterDirection.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PacketFilterIdentifier__CreateAddReplaceTFT_template[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 PacketFilterIdentifier__CreateAddReplaceTFT_template(*other_value.implication_.precondition);
implication_.implied_template = new PacketFilterIdentifier__CreateAddReplaceTFT_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT.");
break;
}
set_selection(other_value);
}

PacketFilterIdentifier__CreateAddReplaceTFT_template::PacketFilterIdentifier__CreateAddReplaceTFT_template()
{
}

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

PacketFilterIdentifier__CreateAddReplaceTFT_template::PacketFilterIdentifier__CreateAddReplaceTFT_template(const PacketFilterIdentifier__CreateAddReplaceTFT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

PacketFilterIdentifier__CreateAddReplaceTFT PacketFilterIdentifier__CreateAddReplaceTFT_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT.");
PacketFilterIdentifier__CreateAddReplaceTFT ret_val;
if (single_value->field_packetFilterIdentifier.is_bound()) {
ret_val.packetFilterIdentifier() = single_value->field_packetFilterIdentifier.valueof();
}
if (single_value->field_packetFilterDirection.is_bound()) {
ret_val.packetFilterDirection() = single_value->field_packetFilterDirection.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& PacketFilterIdentifier__CreateAddReplaceTFT_template::packetFilterIdentifier()
{
set_specific();
return single_value->field_packetFilterIdentifier;
}

const BITSTRING_template& PacketFilterIdentifier__CreateAddReplaceTFT_template::packetFilterIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field packetFilterIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT.");
return single_value->field_packetFilterIdentifier;
}

BITSTRING_template& PacketFilterIdentifier__CreateAddReplaceTFT_template::packetFilterDirection()
{
set_specific();
return single_value->field_packetFilterDirection;
}

const BITSTRING_template& PacketFilterIdentifier__CreateAddReplaceTFT_template::packetFilterDirection() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field packetFilterDirection of a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT.");
return single_value->field_packetFilterDirection;
}

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

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

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

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

void PacketFilterIdentifier__CreateAddReplaceTFT_template::log_match(const PacketFilterIdentifier__CreateAddReplaceTFT& 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_packetFilterIdentifier.match(match_value.packetFilterIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".packetFilterIdentifier");
single_value->field_packetFilterIdentifier.log_match(match_value.packetFilterIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_packetFilterDirection.match(match_value.packetFilterDirection(), legacy)){
TTCN_Logger::log_logmatch_info(".packetFilterDirection");
single_value->field_packetFilterDirection.log_match(match_value.packetFilterDirection(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ packetFilterIdentifier := ");
single_value->field_packetFilterIdentifier.log_match(match_value.packetFilterIdentifier(), legacy);
TTCN_Logger::log_event_str(", packetFilterDirection := ");
single_value->field_packetFilterDirection.log_match(match_value.packetFilterDirection(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PacketFilterIdentifier__CreateAddReplaceTFT_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (packetFilterIdentifier().is_bound()) packetFilterIdentifier().set_implicit_omit();
if (packetFilterDirection().is_bound()) packetFilterDirection().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void PacketFilterIdentifier__CreateAddReplaceTFT_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_packetFilterIdentifier.decode_text(text_buf);
single_value->field_packetFilterDirection.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PacketFilterIdentifier__CreateAddReplaceTFT_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT.");
}
}

void PacketFilterIdentifier__CreateAddReplaceTFT_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: {
    PacketFilterIdentifier__CreateAddReplaceTFT_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT 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) packetFilterIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) packetFilterDirection().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFilterIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFilterIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFilterDirection")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFilterDirection().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PacketFilterIdentifier__CreateAddReplaceTFT_template* precondition = new PacketFilterIdentifier__CreateAddReplaceTFT_template;
    precondition->set_param(*param.get_elem(0));
    PacketFilterIdentifier__CreateAddReplaceTFT_template* implied_template = new PacketFilterIdentifier__CreateAddReplaceTFT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PacketFilterIdentifier__CreateAddReplaceTFT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT");
  }
  is_ifpresent = param.get_ifpresent();
}

void PacketFilterIdentifier__CreateAddReplaceTFT_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_packetFilterIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT");
single_value->field_packetFilterDirection.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterIdentifier_CreateAddReplaceTFT");
}

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

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

PacketFilter::PacketFilter()
{
}

PacketFilter::PacketFilter(const PacketFilterIdentifier__CreateAddReplaceTFT& par_identifier,
    const OCTETSTRING& par_evaluationPrecedence,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_contents)
  :   field_identifier(par_identifier),
  field_evaluationPrecedence(par_evaluationPrecedence),
  field_lengthIndicator(par_lengthIndicator),
  field_contents(par_contents)
{
}

PacketFilter::PacketFilter(const PacketFilter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PacketFilter.");
if (other_value.identifier().is_bound()) field_identifier = other_value.identifier();
else field_identifier.clean_up();
if (other_value.evaluationPrecedence().is_bound()) field_evaluationPrecedence = other_value.evaluationPrecedence();
else field_evaluationPrecedence.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.contents().is_bound()) field_contents = other_value.contents();
else field_contents.clean_up();
}

void PacketFilter::clean_up()
{
field_identifier.clean_up();
field_evaluationPrecedence.clean_up();
field_lengthIndicator.clean_up();
field_contents.clean_up();
}

const TTCN_Typedescriptor_t* PacketFilter::get_descriptor() const { return &PacketFilter_descr_; }
PacketFilter& PacketFilter::operator=(const PacketFilter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PacketFilter.");
  if (other_value.identifier().is_bound()) field_identifier = other_value.identifier();
  else field_identifier.clean_up();
  if (other_value.evaluationPrecedence().is_bound()) field_evaluationPrecedence = other_value.evaluationPrecedence();
  else field_evaluationPrecedence.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.contents().is_bound()) field_contents = other_value.contents();
  else field_contents.clean_up();
}
return *this;
}

boolean PacketFilter::operator==(const PacketFilter& other_value) const
{
return field_identifier==other_value.field_identifier
  && field_evaluationPrecedence==other_value.field_evaluationPrecedence
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_contents==other_value.field_contents;
}

boolean PacketFilter::is_bound() const
{
return (field_identifier.is_bound())
  || (field_evaluationPrecedence.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_contents.is_bound());
}
boolean PacketFilter::is_value() const
{
return field_identifier.is_value()
  && field_evaluationPrecedence.is_value()
  && field_lengthIndicator.is_value()
  && field_contents.is_value();
}
void PacketFilter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ identifier := ");
field_identifier.log();
TTCN_Logger::log_event_str(", evaluationPrecedence := ");
field_evaluationPrecedence.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", contents := ");
field_contents.log();
TTCN_Logger::log_event_str(" }");
}

void PacketFilter::set_implicit_omit()
{
if (identifier().is_bound()) identifier().set_implicit_omit();
if (evaluationPrecedence().is_bound()) evaluationPrecedence().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (contents().is_bound()) contents().set_implicit_omit();
}

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

void PacketFilter::encode_text(Text_Buf& text_buf) const
{
field_identifier.encode_text(text_buf);
field_evaluationPrecedence.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_contents.encode_text(text_buf);
}

void PacketFilter::decode_text(Text_Buf& text_buf)
{
field_identifier.decode_text(text_buf);
field_evaluationPrecedence.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_contents.decode_text(text_buf);
}

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

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

int PacketFilter::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, PacketFilterIdentifier__CreateAddReplaceTFT_descr_.raw->forceomit);
  decoded_field_length = field_identifier.RAW_decode(PacketFilterIdentifier__CreateAddReplaceTFT_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_evaluationPrecedence.RAW_decode(General__Types::OCT1_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, PacketFilter_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PacketFilter_lengthIndicator_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());
  INTEGER tmp2 = field_lengthIndicator.convert_to_Integer(PacketFilter_lengthIndicator_descr_);
  field_lengthIndicator = tmp2;
  value_of_length_field2 += tmp2.get_long_long_val() * 8;
  RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_contents.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PacketFilter::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, PacketFilterIdentifier__CreateAddReplaceTFT_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PacketFilter_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  encoded_length += field_identifier.RAW_encode(PacketFilterIdentifier__CreateAddReplaceTFT_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_evaluationPrecedence.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->coding_descr = &PacketFilter_lengthIndicator_descr_;
  myleaf.body.node.nodes[2]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->length = 8;
  myleaf.body.node.nodes[2]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_contents.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PacketFilter_template::single_value_struct {
PacketFilterIdentifier__CreateAddReplaceTFT_template field_identifier;
OCTETSTRING_template field_evaluationPrecedence;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_contents;
};

void PacketFilter_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_identifier = ANY_VALUE;
single_value->field_evaluationPrecedence = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_contents = ANY_VALUE;
}
}
}

void PacketFilter_template::copy_value(const PacketFilter& other_value)
{
single_value = new single_value_struct;
if (other_value.identifier().is_bound()) {
  single_value->field_identifier = other_value.identifier();
} else {
  single_value->field_identifier.clean_up();
}
if (other_value.evaluationPrecedence().is_bound()) {
  single_value->field_evaluationPrecedence = other_value.evaluationPrecedence();
} else {
  single_value->field_evaluationPrecedence.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.contents().is_bound()) {
  single_value->field_contents = other_value.contents();
} else {
  single_value->field_contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PacketFilter_template::copy_template(const PacketFilter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.identifier().get_selection()) {
single_value->field_identifier = other_value.identifier();
} else {
single_value->field_identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.evaluationPrecedence().get_selection()) {
single_value->field_evaluationPrecedence = other_value.evaluationPrecedence();
} else {
single_value->field_evaluationPrecedence.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.contents().get_selection()) {
single_value->field_contents = other_value.contents();
} else {
single_value->field_contents.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PacketFilter_template[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 PacketFilter_template(*other_value.implication_.precondition);
implication_.implied_template = new PacketFilter_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PacketFilter.");
break;
}
set_selection(other_value);
}

PacketFilter_template::PacketFilter_template()
{
}

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

PacketFilter_template::PacketFilter_template(const PacketFilter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PacketFilter_template::match(const PacketFilter& 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.identifier().is_bound()) return FALSE;
if(!single_value->field_identifier.match(other_value.identifier(), legacy))return FALSE;
if(!other_value.evaluationPrecedence().is_bound()) return FALSE;
if(!single_value->field_evaluationPrecedence.match(other_value.evaluationPrecedence(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.contents().is_bound()) return FALSE;
if(!single_value->field_contents.match(other_value.contents(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PacketFilter.");
}
return FALSE;
}

boolean PacketFilter_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_identifier.is_bound()
 || single_value->field_evaluationPrecedence.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_contents.is_bound();
}

boolean PacketFilter_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_identifier.is_value()
 && single_value->field_evaluationPrecedence.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_contents.is_value();
}

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

PacketFilter PacketFilter_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilter.");
PacketFilter ret_val;
if (single_value->field_identifier.is_bound()) {
ret_val.identifier() = single_value->field_identifier.valueof();
}
if (single_value->field_evaluationPrecedence.is_bound()) {
ret_val.evaluationPrecedence() = single_value->field_evaluationPrecedence.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_contents.is_bound()) {
ret_val.contents() = single_value->field_contents.valueof();
}
return ret_val;
}

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

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

PacketFilterIdentifier__CreateAddReplaceTFT_template& PacketFilter_template::identifier()
{
set_specific();
return single_value->field_identifier;
}

const PacketFilterIdentifier__CreateAddReplaceTFT_template& PacketFilter_template::identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field identifier of a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilter.");
return single_value->field_identifier;
}

OCTETSTRING_template& PacketFilter_template::evaluationPrecedence()
{
set_specific();
return single_value->field_evaluationPrecedence;
}

const OCTETSTRING_template& PacketFilter_template::evaluationPrecedence() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field evaluationPrecedence of a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilter.");
return single_value->field_evaluationPrecedence;
}

INTEGER_template& PacketFilter_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& PacketFilter_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilter.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& PacketFilter_template::contents()
{
set_specific();
return single_value->field_contents;
}

const OCTETSTRING_template& PacketFilter_template::contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field contents of a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilter.");
return single_value->field_contents;
}

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

void PacketFilter_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ identifier := ");
single_value->field_identifier.log();
TTCN_Logger::log_event_str(", evaluationPrecedence := ");
single_value->field_evaluationPrecedence.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", contents := ");
single_value->field_contents.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PacketFilter_template::log_match(const PacketFilter& 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_identifier.match(match_value.identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".identifier");
single_value->field_identifier.log_match(match_value.identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_evaluationPrecedence.match(match_value.evaluationPrecedence(), legacy)){
TTCN_Logger::log_logmatch_info(".evaluationPrecedence");
single_value->field_evaluationPrecedence.log_match(match_value.evaluationPrecedence(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_contents.match(match_value.contents(), legacy)){
TTCN_Logger::log_logmatch_info(".contents");
single_value->field_contents.log_match(match_value.contents(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ identifier := ");
single_value->field_identifier.log_match(match_value.identifier(), legacy);
TTCN_Logger::log_event_str(", evaluationPrecedence := ");
single_value->field_evaluationPrecedence.log_match(match_value.evaluationPrecedence(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", contents := ");
single_value->field_contents.log_match(match_value.contents(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PacketFilter_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (identifier().is_bound()) identifier().set_implicit_omit();
if (evaluationPrecedence().is_bound()) evaluationPrecedence().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (contents().is_bound()) contents().set_implicit_omit();
}

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

void PacketFilter_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_identifier.decode_text(text_buf);
single_value->field_evaluationPrecedence.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_contents.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PacketFilter_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.PacketFilter.");
}
}

void PacketFilter_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: {
    PacketFilter_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PacketFilter 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) identifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) evaluationPrecedence().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) contents().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "evaluationPrecedence")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          evaluationPrecedence().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PacketFilter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PacketFilter_template* precondition = new PacketFilter_template;
    precondition->set_param(*param.get_elem(0));
    PacketFilter_template* implied_template = new PacketFilter_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PacketFilter_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PacketFilter");
  }
  is_ifpresent = param.get_ifpresent();
}

void PacketFilter_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_identifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilter");
single_value->field_evaluationPrecedence.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilter");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilter");
single_value->field_contents.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilter");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilter");
}

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

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

TrafficFlowTemplateV__CreateAddReplaceTFT::TrafficFlowTemplateV__CreateAddReplaceTFT()
{
}

TrafficFlowTemplateV__CreateAddReplaceTFT::TrafficFlowTemplateV__CreateAddReplaceTFT(const INTEGER& par_numberOfPacketFilters,
    const BITSTRING& par_eBIT,
    const BITSTRING& par_operationCodeTFT,
    const PacketFilterList__CreateAddReplaceTFT& par_packetFilterList__CreateAddReplaceTFT,
    const OPTIONAL< ParametersList >& par_parametersList)
  :   field_numberOfPacketFilters(par_numberOfPacketFilters),
  field_eBIT(par_eBIT),
  field_operationCodeTFT(par_operationCodeTFT),
  field_packetFilterList__CreateAddReplaceTFT(par_packetFilterList__CreateAddReplaceTFT),
  field_parametersList(par_parametersList)
{
}

TrafficFlowTemplateV__CreateAddReplaceTFT::TrafficFlowTemplateV__CreateAddReplaceTFT(const TrafficFlowTemplateV__CreateAddReplaceTFT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
if (other_value.numberOfPacketFilters().is_bound()) field_numberOfPacketFilters = other_value.numberOfPacketFilters();
else field_numberOfPacketFilters.clean_up();
if (other_value.eBIT().is_bound()) field_eBIT = other_value.eBIT();
else field_eBIT.clean_up();
if (other_value.operationCodeTFT().is_bound()) field_operationCodeTFT = other_value.operationCodeTFT();
else field_operationCodeTFT.clean_up();
if (other_value.packetFilterList__CreateAddReplaceTFT().is_bound()) field_packetFilterList__CreateAddReplaceTFT = other_value.packetFilterList__CreateAddReplaceTFT();
else field_packetFilterList__CreateAddReplaceTFT.clean_up();
if (other_value.parametersList().is_bound()) field_parametersList = other_value.parametersList();
else field_parametersList.clean_up();
}

void TrafficFlowTemplateV__CreateAddReplaceTFT::clean_up()
{
field_numberOfPacketFilters.clean_up();
field_eBIT.clean_up();
field_operationCodeTFT.clean_up();
field_packetFilterList__CreateAddReplaceTFT.clean_up();
field_parametersList.clean_up();
}

const TTCN_Typedescriptor_t* TrafficFlowTemplateV__CreateAddReplaceTFT::get_descriptor() const { return &TrafficFlowTemplateV__CreateAddReplaceTFT_descr_; }
TrafficFlowTemplateV__CreateAddReplaceTFT& TrafficFlowTemplateV__CreateAddReplaceTFT::operator=(const TrafficFlowTemplateV__CreateAddReplaceTFT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
  if (other_value.numberOfPacketFilters().is_bound()) field_numberOfPacketFilters = other_value.numberOfPacketFilters();
  else field_numberOfPacketFilters.clean_up();
  if (other_value.eBIT().is_bound()) field_eBIT = other_value.eBIT();
  else field_eBIT.clean_up();
  if (other_value.operationCodeTFT().is_bound()) field_operationCodeTFT = other_value.operationCodeTFT();
  else field_operationCodeTFT.clean_up();
  if (other_value.packetFilterList__CreateAddReplaceTFT().is_bound()) field_packetFilterList__CreateAddReplaceTFT = other_value.packetFilterList__CreateAddReplaceTFT();
  else field_packetFilterList__CreateAddReplaceTFT.clean_up();
  if (other_value.parametersList().is_bound()) field_parametersList = other_value.parametersList();
  else field_parametersList.clean_up();
}
return *this;
}

boolean TrafficFlowTemplateV__CreateAddReplaceTFT::operator==(const TrafficFlowTemplateV__CreateAddReplaceTFT& other_value) const
{
return field_numberOfPacketFilters==other_value.field_numberOfPacketFilters
  && field_eBIT==other_value.field_eBIT
  && field_operationCodeTFT==other_value.field_operationCodeTFT
  && field_packetFilterList__CreateAddReplaceTFT==other_value.field_packetFilterList__CreateAddReplaceTFT
  && field_parametersList==other_value.field_parametersList;
}

boolean TrafficFlowTemplateV__CreateAddReplaceTFT::is_bound() const
{
return (field_numberOfPacketFilters.is_bound())
  || (field_eBIT.is_bound())
  || (field_operationCodeTFT.is_bound())
  || (field_packetFilterList__CreateAddReplaceTFT.is_bound())
  || (OPTIONAL_OMIT == field_parametersList.get_selection() || field_parametersList.is_bound());
}
boolean TrafficFlowTemplateV__CreateAddReplaceTFT::is_value() const
{
return field_numberOfPacketFilters.is_value()
  && field_eBIT.is_value()
  && field_operationCodeTFT.is_value()
  && field_packetFilterList__CreateAddReplaceTFT.is_value()
  && (OPTIONAL_OMIT == field_parametersList.get_selection() || field_parametersList.is_value());
}
int TrafficFlowTemplateV__CreateAddReplaceTFT::size_of() const
{
  int ret_val = 4;
  if (field_parametersList.ispresent()) ret_val++;
  return ret_val;
}

void TrafficFlowTemplateV__CreateAddReplaceTFT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ numberOfPacketFilters := ");
field_numberOfPacketFilters.log();
TTCN_Logger::log_event_str(", eBIT := ");
field_eBIT.log();
TTCN_Logger::log_event_str(", operationCodeTFT := ");
field_operationCodeTFT.log();
TTCN_Logger::log_event_str(", packetFilterList_CreateAddReplaceTFT := ");
field_packetFilterList__CreateAddReplaceTFT.log();
TTCN_Logger::log_event_str(", parametersList := ");
field_parametersList.log();
TTCN_Logger::log_event_str(" }");
}

void TrafficFlowTemplateV__CreateAddReplaceTFT::set_implicit_omit()
{
if (numberOfPacketFilters().is_bound()) numberOfPacketFilters().set_implicit_omit();
if (eBIT().is_bound()) eBIT().set_implicit_omit();
if (operationCodeTFT().is_bound()) operationCodeTFT().set_implicit_omit();
if (packetFilterList__CreateAddReplaceTFT().is_bound()) packetFilterList__CreateAddReplaceTFT().set_implicit_omit();
if (!parametersList().is_bound()) parametersList() = OMIT_VALUE;
else parametersList().set_implicit_omit();
}

void TrafficFlowTemplateV__CreateAddReplaceTFT::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT 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) numberOfPacketFilters().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eBIT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCodeTFT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) packetFilterList__CreateAddReplaceTFT().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) parametersList().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(), "numberOfPacketFilters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberOfPacketFilters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eBIT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eBIT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCodeTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCodeTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFilterList_CreateAddReplaceTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFilterList__CreateAddReplaceTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parametersList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parametersList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
  }
}

void TrafficFlowTemplateV__CreateAddReplaceTFT::encode_text(Text_Buf& text_buf) const
{
field_numberOfPacketFilters.encode_text(text_buf);
field_eBIT.encode_text(text_buf);
field_operationCodeTFT.encode_text(text_buf);
field_packetFilterList__CreateAddReplaceTFT.encode_text(text_buf);
field_parametersList.encode_text(text_buf);
}

void TrafficFlowTemplateV__CreateAddReplaceTFT::decode_text(Text_Buf& text_buf)
{
field_numberOfPacketFilters.decode_text(text_buf);
field_eBIT.decode_text(text_buf);
field_operationCodeTFT.decode_text(text_buf);
field_packetFilterList__CreateAddReplaceTFT.decode_text(text_buf);
field_parametersList.decode_text(text_buf);
}

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

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

int TrafficFlowTemplateV__CreateAddReplaceTFT::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, TrafficFlowTemplateV__CreateAddReplaceTFT_numberOfPacketFilters_descr_.raw->forceomit);
  decoded_field_length = field_numberOfPacketFilters.RAW_decode(TrafficFlowTemplateV__CreateAddReplaceTFT_numberOfPacketFilters_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_numberOfPacketFilters.convert_to_Integer(TrafficFlowTemplateV__CreateAddReplaceTFT_numberOfPacketFilters_descr_);
  field_numberOfPacketFilters = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_eBIT.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_operationCodeTFT.RAW_decode(General__Types::BIT3_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, PacketFilterList__CreateAddReplaceTFT_descr_.raw->forceomit);
  decoded_field_length = field_packetFilterList__CreateAddReplaceTFT.RAW_decode(PacketFilterList__CreateAddReplaceTFT_descr_, p_buf, limit, local_top_order, no_err, value_of_length_field0, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  if (limit > 0 && field_eBIT ==  bs_2){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_parametersList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, TrafficFlowTemplateV__CreateAddReplaceTFT_parametersList_descr_.raw->forceomit);
  decoded_field_length = field_parametersList().RAW_decode(TrafficFlowTemplateV__CreateAddReplaceTFT_parametersList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_parametersList = 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_parametersList=OMIT_VALUE;
  if (field_operationCodeTFT !=  bs_15 && field_operationCodeTFT !=  bs_16 && field_operationCodeTFT !=  bs_17) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TrafficFlowTemplateV__CreateAddReplaceTFT::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, TrafficFlowTemplateV__CreateAddReplaceTFT_numberOfPacketFilters_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PacketFilterList__CreateAddReplaceTFT_descr_.raw);
  if (field_parametersList.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, TrafficFlowTemplateV__CreateAddReplaceTFT_parametersList_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += 4;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &TrafficFlowTemplateV__CreateAddReplaceTFT_numberOfPacketFilters_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 4;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_eBIT.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_operationCodeTFT.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_packetFilterList__CreateAddReplaceTFT.RAW_encode(PacketFilterList__CreateAddReplaceTFT_descr_, *myleaf.body.node.nodes[3]);
  if (field_parametersList.ispresent()) {
  encoded_length += field_parametersList().RAW_encode(TrafficFlowTemplateV__CreateAddReplaceTFT_parametersList_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_parametersList.ispresent() && (field_eBIT !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_operationCodeTFT !=  bs_15 && field_operationCodeTFT !=  bs_16 && field_operationCodeTFT !=  bs_17) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_15.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+1;
  int new_pos1[]={2};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_16.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+1;
  int new_pos2[]={2};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   bs_17.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct TrafficFlowTemplateV__CreateAddReplaceTFT_template::single_value_struct {
INTEGER_template field_numberOfPacketFilters;
BITSTRING_template field_eBIT;
BITSTRING_template field_operationCodeTFT;
PacketFilterList__CreateAddReplaceTFT_template field_packetFilterList__CreateAddReplaceTFT;
ParametersList_template field_parametersList;
};

void TrafficFlowTemplateV__CreateAddReplaceTFT_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_numberOfPacketFilters = ANY_VALUE;
single_value->field_eBIT = ANY_VALUE;
single_value->field_operationCodeTFT = ANY_VALUE;
single_value->field_packetFilterList__CreateAddReplaceTFT = ANY_VALUE;
single_value->field_parametersList = ANY_OR_OMIT;
}
}
}

void TrafficFlowTemplateV__CreateAddReplaceTFT_template::copy_value(const TrafficFlowTemplateV__CreateAddReplaceTFT& other_value)
{
single_value = new single_value_struct;
if (other_value.numberOfPacketFilters().is_bound()) {
  single_value->field_numberOfPacketFilters = other_value.numberOfPacketFilters();
} else {
  single_value->field_numberOfPacketFilters.clean_up();
}
if (other_value.eBIT().is_bound()) {
  single_value->field_eBIT = other_value.eBIT();
} else {
  single_value->field_eBIT.clean_up();
}
if (other_value.operationCodeTFT().is_bound()) {
  single_value->field_operationCodeTFT = other_value.operationCodeTFT();
} else {
  single_value->field_operationCodeTFT.clean_up();
}
if (other_value.packetFilterList__CreateAddReplaceTFT().is_bound()) {
  single_value->field_packetFilterList__CreateAddReplaceTFT = other_value.packetFilterList__CreateAddReplaceTFT();
} else {
  single_value->field_packetFilterList__CreateAddReplaceTFT.clean_up();
}
if (other_value.parametersList().is_bound()) {
  if (other_value.parametersList().ispresent()) single_value->field_parametersList = other_value.parametersList()();
  else single_value->field_parametersList = OMIT_VALUE;
} else {
  single_value->field_parametersList.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TrafficFlowTemplateV__CreateAddReplaceTFT_template::copy_template(const TrafficFlowTemplateV__CreateAddReplaceTFT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.numberOfPacketFilters().get_selection()) {
single_value->field_numberOfPacketFilters = other_value.numberOfPacketFilters();
} else {
single_value->field_numberOfPacketFilters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eBIT().get_selection()) {
single_value->field_eBIT = other_value.eBIT();
} else {
single_value->field_eBIT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.operationCodeTFT().get_selection()) {
single_value->field_operationCodeTFT = other_value.operationCodeTFT();
} else {
single_value->field_operationCodeTFT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.packetFilterList__CreateAddReplaceTFT().get_selection()) {
single_value->field_packetFilterList__CreateAddReplaceTFT = other_value.packetFilterList__CreateAddReplaceTFT();
} else {
single_value->field_packetFilterList__CreateAddReplaceTFT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.parametersList().get_selection()) {
single_value->field_parametersList = other_value.parametersList();
} else {
single_value->field_parametersList.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 TrafficFlowTemplateV__CreateAddReplaceTFT_template[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 TrafficFlowTemplateV__CreateAddReplaceTFT_template(*other_value.implication_.precondition);
implication_.implied_template = new TrafficFlowTemplateV__CreateAddReplaceTFT_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
break;
}
set_selection(other_value);
}

TrafficFlowTemplateV__CreateAddReplaceTFT_template::TrafficFlowTemplateV__CreateAddReplaceTFT_template()
{
}

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

TrafficFlowTemplateV__CreateAddReplaceTFT_template::TrafficFlowTemplateV__CreateAddReplaceTFT_template(const TrafficFlowTemplateV__CreateAddReplaceTFT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TrafficFlowTemplateV__CreateAddReplaceTFT_template::match(const TrafficFlowTemplateV__CreateAddReplaceTFT& 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.numberOfPacketFilters().is_bound()) return FALSE;
if(!single_value->field_numberOfPacketFilters.match(other_value.numberOfPacketFilters(), legacy))return FALSE;
if(!other_value.eBIT().is_bound()) return FALSE;
if(!single_value->field_eBIT.match(other_value.eBIT(), legacy))return FALSE;
if(!other_value.operationCodeTFT().is_bound()) return FALSE;
if(!single_value->field_operationCodeTFT.match(other_value.operationCodeTFT(), legacy))return FALSE;
if(!other_value.packetFilterList__CreateAddReplaceTFT().is_bound()) return FALSE;
if(!single_value->field_packetFilterList__CreateAddReplaceTFT.match(other_value.packetFilterList__CreateAddReplaceTFT(), legacy))return FALSE;
if(!other_value.parametersList().is_bound()) return FALSE;
if((other_value.parametersList().ispresent() ? !single_value->field_parametersList.match((const ParametersList&)other_value.parametersList(), legacy) : !single_value->field_parametersList.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
}
return FALSE;
}

boolean TrafficFlowTemplateV__CreateAddReplaceTFT_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_numberOfPacketFilters.is_bound()
 || single_value->field_eBIT.is_bound()
 || single_value->field_operationCodeTFT.is_bound()
 || single_value->field_packetFilterList__CreateAddReplaceTFT.is_bound()
 || (single_value->field_parametersList.is_omit() || single_value->field_parametersList.is_bound());
}

boolean TrafficFlowTemplateV__CreateAddReplaceTFT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_numberOfPacketFilters.is_value()
 && single_value->field_eBIT.is_value()
 && single_value->field_operationCodeTFT.is_value()
 && single_value->field_packetFilterList__CreateAddReplaceTFT.is_value()
 && (single_value->field_parametersList.is_omit() || single_value->field_parametersList.is_value());
}

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

TrafficFlowTemplateV__CreateAddReplaceTFT TrafficFlowTemplateV__CreateAddReplaceTFT_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
TrafficFlowTemplateV__CreateAddReplaceTFT ret_val;
if (single_value->field_numberOfPacketFilters.is_bound()) {
ret_val.numberOfPacketFilters() = single_value->field_numberOfPacketFilters.valueof();
}
if (single_value->field_eBIT.is_bound()) {
ret_val.eBIT() = single_value->field_eBIT.valueof();
}
if (single_value->field_operationCodeTFT.is_bound()) {
ret_val.operationCodeTFT() = single_value->field_operationCodeTFT.valueof();
}
if (single_value->field_packetFilterList__CreateAddReplaceTFT.is_bound()) {
ret_val.packetFilterList__CreateAddReplaceTFT() = single_value->field_packetFilterList__CreateAddReplaceTFT.valueof();
}
if (single_value->field_parametersList.is_omit()) ret_val.parametersList() = OMIT_VALUE;
else if (single_value->field_parametersList.is_bound()) {
ret_val.parametersList() = single_value->field_parametersList.valueof();
}
return ret_val;
}

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

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

INTEGER_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::numberOfPacketFilters()
{
set_specific();
return single_value->field_numberOfPacketFilters;
}

const INTEGER_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::numberOfPacketFilters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field numberOfPacketFilters of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
return single_value->field_numberOfPacketFilters;
}

BITSTRING_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::eBIT()
{
set_specific();
return single_value->field_eBIT;
}

const BITSTRING_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::eBIT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eBIT of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
return single_value->field_eBIT;
}

BITSTRING_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::operationCodeTFT()
{
set_specific();
return single_value->field_operationCodeTFT;
}

const BITSTRING_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::operationCodeTFT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field operationCodeTFT of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
return single_value->field_operationCodeTFT;
}

PacketFilterList__CreateAddReplaceTFT_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::packetFilterList__CreateAddReplaceTFT()
{
set_specific();
return single_value->field_packetFilterList__CreateAddReplaceTFT;
}

const PacketFilterList__CreateAddReplaceTFT_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::packetFilterList__CreateAddReplaceTFT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field packetFilterList_CreateAddReplaceTFT of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
return single_value->field_packetFilterList__CreateAddReplaceTFT;
}

ParametersList_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::parametersList()
{
set_specific();
return single_value->field_parametersList;
}

const ParametersList_template& TrafficFlowTemplateV__CreateAddReplaceTFT_template::parametersList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parametersList of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
return single_value->field_parametersList;
}

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

void TrafficFlowTemplateV__CreateAddReplaceTFT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ numberOfPacketFilters := ");
single_value->field_numberOfPacketFilters.log();
TTCN_Logger::log_event_str(", eBIT := ");
single_value->field_eBIT.log();
TTCN_Logger::log_event_str(", operationCodeTFT := ");
single_value->field_operationCodeTFT.log();
TTCN_Logger::log_event_str(", packetFilterList_CreateAddReplaceTFT := ");
single_value->field_packetFilterList__CreateAddReplaceTFT.log();
TTCN_Logger::log_event_str(", parametersList := ");
single_value->field_parametersList.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 TrafficFlowTemplateV__CreateAddReplaceTFT_template::log_match(const TrafficFlowTemplateV__CreateAddReplaceTFT& 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_numberOfPacketFilters.match(match_value.numberOfPacketFilters(), legacy)){
TTCN_Logger::log_logmatch_info(".numberOfPacketFilters");
single_value->field_numberOfPacketFilters.log_match(match_value.numberOfPacketFilters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eBIT.match(match_value.eBIT(), legacy)){
TTCN_Logger::log_logmatch_info(".eBIT");
single_value->field_eBIT.log_match(match_value.eBIT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_operationCodeTFT.match(match_value.operationCodeTFT(), legacy)){
TTCN_Logger::log_logmatch_info(".operationCodeTFT");
single_value->field_operationCodeTFT.log_match(match_value.operationCodeTFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_packetFilterList__CreateAddReplaceTFT.match(match_value.packetFilterList__CreateAddReplaceTFT(), legacy)){
TTCN_Logger::log_logmatch_info(".packetFilterList_CreateAddReplaceTFT");
single_value->field_packetFilterList__CreateAddReplaceTFT.log_match(match_value.packetFilterList__CreateAddReplaceTFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.parametersList().ispresent()){
if(!single_value->field_parametersList.match(match_value.parametersList(), legacy)){
TTCN_Logger::log_logmatch_info(".parametersList");
single_value->field_parametersList.log_match(match_value.parametersList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_parametersList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".parametersList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_parametersList.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("{ numberOfPacketFilters := ");
single_value->field_numberOfPacketFilters.log_match(match_value.numberOfPacketFilters(), legacy);
TTCN_Logger::log_event_str(", eBIT := ");
single_value->field_eBIT.log_match(match_value.eBIT(), legacy);
TTCN_Logger::log_event_str(", operationCodeTFT := ");
single_value->field_operationCodeTFT.log_match(match_value.operationCodeTFT(), legacy);
TTCN_Logger::log_event_str(", packetFilterList_CreateAddReplaceTFT := ");
single_value->field_packetFilterList__CreateAddReplaceTFT.log_match(match_value.packetFilterList__CreateAddReplaceTFT(), legacy);
TTCN_Logger::log_event_str(", parametersList := ");
if (match_value.parametersList().ispresent()) {
single_value->field_parametersList.log_match(match_value.parametersList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_parametersList.log();
if (single_value->field_parametersList.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 TrafficFlowTemplateV__CreateAddReplaceTFT_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (numberOfPacketFilters().is_bound()) numberOfPacketFilters().set_implicit_omit();
if (eBIT().is_bound()) eBIT().set_implicit_omit();
if (operationCodeTFT().is_bound()) operationCodeTFT().set_implicit_omit();
if (packetFilterList__CreateAddReplaceTFT().is_bound()) packetFilterList__CreateAddReplaceTFT().set_implicit_omit();
if (!parametersList().is_bound()) parametersList() = OMIT_VALUE;
else parametersList().set_implicit_omit();
}

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

void TrafficFlowTemplateV__CreateAddReplaceTFT_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_numberOfPacketFilters.decode_text(text_buf);
single_value->field_eBIT.decode_text(text_buf);
single_value->field_operationCodeTFT.decode_text(text_buf);
single_value->field_packetFilterList__CreateAddReplaceTFT.decode_text(text_buf);
single_value->field_parametersList.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 TrafficFlowTemplateV__CreateAddReplaceTFT_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT.");
}
}

void TrafficFlowTemplateV__CreateAddReplaceTFT_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: {
    TrafficFlowTemplateV__CreateAddReplaceTFT_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT 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) numberOfPacketFilters().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eBIT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCodeTFT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) packetFilterList__CreateAddReplaceTFT().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) parametersList().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(), "numberOfPacketFilters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberOfPacketFilters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eBIT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eBIT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCodeTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCodeTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFilterList_CreateAddReplaceTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFilterList__CreateAddReplaceTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parametersList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parametersList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrafficFlowTemplateV__CreateAddReplaceTFT_template* precondition = new TrafficFlowTemplateV__CreateAddReplaceTFT_template;
    precondition->set_param(*param.get_elem(0));
    TrafficFlowTemplateV__CreateAddReplaceTFT_template* implied_template = new TrafficFlowTemplateV__CreateAddReplaceTFT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrafficFlowTemplateV__CreateAddReplaceTFT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrafficFlowTemplateV__CreateAddReplaceTFT_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_numberOfPacketFilters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
single_value->field_eBIT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
single_value->field_operationCodeTFT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
single_value->field_packetFilterList__CreateAddReplaceTFT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
single_value->field_parametersList.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_CreateAddReplaceTFT");
}

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

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


const Parameter ParametersList::UNBOUND_ELEM;
ParametersList::ParametersList()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void ParametersList_template::copy_template(const ParametersList_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (Parameter_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new Parameter_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new Parameter_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ParametersList_template[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 ParametersList_template(*other_value.implication_.precondition);
implication_.implied_template = new ParametersList_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ParametersList.");
break;
}
set_selection(other_value);
}

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

ParametersList_template::ParametersList_template()
{
}

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

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

ParametersList_template::ParametersList_template(const ParametersList& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ParametersList_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

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

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

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

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

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

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

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

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

boolean ParametersList_template::match(const ParametersList& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ParametersList.");
}
return FALSE;
}

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

ParametersList ParametersList_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.ParametersList.");
ParametersList ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

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

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

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

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

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

void ParametersList_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void ParametersList_template::log_match(const ParametersList& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void ParametersList_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @MobileL3_GMM_SM_Types.ParametersList.");
single_value.value_elements = (Parameter_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new Parameter_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ParametersList_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @MobileL3_GMM_SM_Types.ParametersList.");
}
}

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

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

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

void ParametersList_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ParametersList_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ParametersList_template* precondition = new ParametersList_template;
    precondition->set_param(*param.get_elem(0));
    ParametersList_template* implied_template = new ParametersList_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ParametersList_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@MobileL3_GMM_SM_Types.ParametersList");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void ParametersList_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ParametersList");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.ParametersList");
}

boolean ParametersList_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
Parameter::Parameter()
{
}

Parameter::Parameter(const OCTETSTRING& par_parameterIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_contents)
  :   field_parameterIdentifier(par_parameterIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_contents(par_contents)
{
}

Parameter::Parameter(const Parameter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.Parameter.");
if (other_value.parameterIdentifier().is_bound()) field_parameterIdentifier = other_value.parameterIdentifier();
else field_parameterIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.contents().is_bound()) field_contents = other_value.contents();
else field_contents.clean_up();
}

void Parameter::clean_up()
{
field_parameterIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_contents.clean_up();
}

const TTCN_Typedescriptor_t* Parameter::get_descriptor() const { return &Parameter_descr_; }
Parameter& Parameter::operator=(const Parameter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.Parameter.");
  if (other_value.parameterIdentifier().is_bound()) field_parameterIdentifier = other_value.parameterIdentifier();
  else field_parameterIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.contents().is_bound()) field_contents = other_value.contents();
  else field_contents.clean_up();
}
return *this;
}

boolean Parameter::operator==(const Parameter& other_value) const
{
return field_parameterIdentifier==other_value.field_parameterIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_contents==other_value.field_contents;
}

boolean Parameter::is_bound() const
{
return (field_parameterIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_contents.is_bound());
}
boolean Parameter::is_value() const
{
return field_parameterIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_contents.is_value();
}
void Parameter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ parameterIdentifier := ");
field_parameterIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", contents := ");
field_contents.log();
TTCN_Logger::log_event_str(" }");
}

void Parameter::set_implicit_omit()
{
if (parameterIdentifier().is_bound()) parameterIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (contents().is_bound()) contents().set_implicit_omit();
}

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

void Parameter::encode_text(Text_Buf& text_buf) const
{
field_parameterIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_contents.encode_text(text_buf);
}

void Parameter::decode_text(Text_Buf& text_buf)
{
field_parameterIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_contents.decode_text(text_buf);
}

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

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

int Parameter::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_parameterIdentifier.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, Parameter_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Parameter_lengthIndicator_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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(Parameter_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_contents.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), 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());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Parameter::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, Parameter_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_parameterIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &Parameter_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_contents.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct Parameter_template::single_value_struct {
OCTETSTRING_template field_parameterIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_contents;
};

void Parameter_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_parameterIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_contents = ANY_VALUE;
}
}
}

void Parameter_template::copy_value(const Parameter& other_value)
{
single_value = new single_value_struct;
if (other_value.parameterIdentifier().is_bound()) {
  single_value->field_parameterIdentifier = other_value.parameterIdentifier();
} else {
  single_value->field_parameterIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.contents().is_bound()) {
  single_value->field_contents = other_value.contents();
} else {
  single_value->field_contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Parameter_template::copy_template(const Parameter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.parameterIdentifier().get_selection()) {
single_value->field_parameterIdentifier = other_value.parameterIdentifier();
} else {
single_value->field_parameterIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.contents().get_selection()) {
single_value->field_contents = other_value.contents();
} else {
single_value->field_contents.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Parameter_template[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 Parameter_template(*other_value.implication_.precondition);
implication_.implied_template = new Parameter_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.Parameter.");
break;
}
set_selection(other_value);
}

Parameter_template::Parameter_template()
{
}

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

Parameter_template::Parameter_template(const Parameter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Parameter_template::match(const Parameter& 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.parameterIdentifier().is_bound()) return FALSE;
if(!single_value->field_parameterIdentifier.match(other_value.parameterIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.contents().is_bound()) return FALSE;
if(!single_value->field_contents.match(other_value.contents(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.Parameter.");
}
return FALSE;
}

boolean Parameter_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_parameterIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_contents.is_bound();
}

boolean Parameter_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_parameterIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_contents.is_value();
}

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

Parameter Parameter_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.Parameter.");
Parameter ret_val;
if (single_value->field_parameterIdentifier.is_bound()) {
ret_val.parameterIdentifier() = single_value->field_parameterIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_contents.is_bound()) {
ret_val.contents() = single_value->field_contents.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& Parameter_template::parameterIdentifier()
{
set_specific();
return single_value->field_parameterIdentifier;
}

const OCTETSTRING_template& Parameter_template::parameterIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parameterIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.Parameter.");
return single_value->field_parameterIdentifier;
}

INTEGER_template& Parameter_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& Parameter_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.Parameter.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Parameter_template::contents()
{
set_specific();
return single_value->field_contents;
}

const OCTETSTRING_template& Parameter_template::contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field contents of a non-specific template of type @MobileL3_GMM_SM_Types.Parameter.");
return single_value->field_contents;
}

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

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

void Parameter_template::log_match(const Parameter& 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_parameterIdentifier.match(match_value.parameterIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".parameterIdentifier");
single_value->field_parameterIdentifier.log_match(match_value.parameterIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_contents.match(match_value.contents(), legacy)){
TTCN_Logger::log_logmatch_info(".contents");
single_value->field_contents.log_match(match_value.contents(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ parameterIdentifier := ");
single_value->field_parameterIdentifier.log_match(match_value.parameterIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", contents := ");
single_value->field_contents.log_match(match_value.contents(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Parameter_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (parameterIdentifier().is_bound()) parameterIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (contents().is_bound()) contents().set_implicit_omit();
}

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

void Parameter_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_parameterIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_contents.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Parameter_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.Parameter.");
}
}

void Parameter_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: {
    Parameter_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.Parameter 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) parameterIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) contents().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(), "parameterIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.Parameter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Parameter_template* precondition = new Parameter_template;
    precondition->set_param(*param.get_elem(0));
    Parameter_template* implied_template = new Parameter_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Parameter_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.Parameter");
  }
  is_ifpresent = param.get_ifpresent();
}

void Parameter_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_parameterIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.Parameter");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.Parameter");
single_value->field_contents.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.Parameter");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.Parameter");
}

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

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


const PacketFilterIdentifier PacketFilterList__DeletePacketFilter::UNBOUND_ELEM;
PacketFilterList__DeletePacketFilter::PacketFilterList__DeletePacketFilter()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void PacketFilterList__DeletePacketFilter_template::copy_template(const PacketFilterList__DeletePacketFilter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (PacketFilterIdentifier_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new PacketFilterIdentifier_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new PacketFilterIdentifier_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PacketFilterList__DeletePacketFilter_template[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 PacketFilterList__DeletePacketFilter_template(*other_value.implication_.precondition);
implication_.implied_template = new PacketFilterList__DeletePacketFilter_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter.");
break;
}
set_selection(other_value);
}

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

PacketFilterList__DeletePacketFilter_template::PacketFilterList__DeletePacketFilter_template()
{
}

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

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

PacketFilterList__DeletePacketFilter_template::PacketFilterList__DeletePacketFilter_template(const PacketFilterList__DeletePacketFilter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void PacketFilterList__DeletePacketFilter_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

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

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

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

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

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

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

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

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

boolean PacketFilterList__DeletePacketFilter_template::match(const PacketFilterList__DeletePacketFilter& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter.");
}
return FALSE;
}

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

PacketFilterList__DeletePacketFilter PacketFilterList__DeletePacketFilter_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter.");
PacketFilterList__DeletePacketFilter ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

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

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

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

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

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

void PacketFilterList__DeletePacketFilter_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void PacketFilterList__DeletePacketFilter_template::log_match(const PacketFilterList__DeletePacketFilter& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PacketFilterList__DeletePacketFilter_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter.");
single_value.value_elements = (PacketFilterIdentifier_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new PacketFilterIdentifier_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PacketFilterList__DeletePacketFilter_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter.");
}
}

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

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

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

void PacketFilterList__DeletePacketFilter_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PacketFilterList__DeletePacketFilter_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PacketFilterList__DeletePacketFilter_template* precondition = new PacketFilterList__DeletePacketFilter_template;
    precondition->set_param(*param.get_elem(0));
    PacketFilterList__DeletePacketFilter_template* implied_template = new PacketFilterList__DeletePacketFilter_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PacketFilterList__DeletePacketFilter_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void PacketFilterList__DeletePacketFilter_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterList_DeletePacketFilter");
}

boolean PacketFilterList__DeletePacketFilter_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
PacketFilterIdentifier::PacketFilterIdentifier()
{
}

PacketFilterIdentifier::PacketFilterIdentifier(const BITSTRING& par_packetFilterIdentifier,
    const BITSTRING& par_spare)
  :   field_packetFilterIdentifier(par_packetFilterIdentifier),
  field_spare(par_spare)
{
}

PacketFilterIdentifier::PacketFilterIdentifier(const PacketFilterIdentifier& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier.");
if (other_value.packetFilterIdentifier().is_bound()) field_packetFilterIdentifier = other_value.packetFilterIdentifier();
else field_packetFilterIdentifier.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void PacketFilterIdentifier::clean_up()
{
field_packetFilterIdentifier.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* PacketFilterIdentifier::get_descriptor() const { return &PacketFilterIdentifier_descr_; }
PacketFilterIdentifier& PacketFilterIdentifier::operator=(const PacketFilterIdentifier& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier.");
  if (other_value.packetFilterIdentifier().is_bound()) field_packetFilterIdentifier = other_value.packetFilterIdentifier();
  else field_packetFilterIdentifier.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean PacketFilterIdentifier::operator==(const PacketFilterIdentifier& other_value) const
{
return field_packetFilterIdentifier==other_value.field_packetFilterIdentifier
  && field_spare==other_value.field_spare;
}

boolean PacketFilterIdentifier::is_bound() const
{
return (field_packetFilterIdentifier.is_bound())
  || (field_spare.is_bound());
}
boolean PacketFilterIdentifier::is_value() const
{
return field_packetFilterIdentifier.is_value()
  && field_spare.is_value();
}
void PacketFilterIdentifier::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ packetFilterIdentifier := ");
field_packetFilterIdentifier.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void PacketFilterIdentifier::set_implicit_omit()
{
if (packetFilterIdentifier().is_bound()) packetFilterIdentifier().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void PacketFilterIdentifier::encode_text(Text_Buf& text_buf) const
{
field_packetFilterIdentifier.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void PacketFilterIdentifier::decode_text(Text_Buf& text_buf)
{
field_packetFilterIdentifier.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int PacketFilterIdentifier::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_packetFilterIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PacketFilterIdentifier::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::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_packetFilterIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PacketFilterIdentifier_template::single_value_struct {
BITSTRING_template field_packetFilterIdentifier;
BITSTRING_template field_spare;
};

void PacketFilterIdentifier_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_packetFilterIdentifier = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void PacketFilterIdentifier_template::copy_value(const PacketFilterIdentifier& other_value)
{
single_value = new single_value_struct;
if (other_value.packetFilterIdentifier().is_bound()) {
  single_value->field_packetFilterIdentifier = other_value.packetFilterIdentifier();
} else {
  single_value->field_packetFilterIdentifier.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PacketFilterIdentifier_template::copy_template(const PacketFilterIdentifier_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.packetFilterIdentifier().get_selection()) {
single_value->field_packetFilterIdentifier = other_value.packetFilterIdentifier();
} else {
single_value->field_packetFilterIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PacketFilterIdentifier_template[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 PacketFilterIdentifier_template(*other_value.implication_.precondition);
implication_.implied_template = new PacketFilterIdentifier_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier.");
break;
}
set_selection(other_value);
}

PacketFilterIdentifier_template::PacketFilterIdentifier_template()
{
}

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

PacketFilterIdentifier_template::PacketFilterIdentifier_template(const PacketFilterIdentifier& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

PacketFilterIdentifier PacketFilterIdentifier_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier.");
PacketFilterIdentifier ret_val;
if (single_value->field_packetFilterIdentifier.is_bound()) {
ret_val.packetFilterIdentifier() = single_value->field_packetFilterIdentifier.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& PacketFilterIdentifier_template::packetFilterIdentifier()
{
set_specific();
return single_value->field_packetFilterIdentifier;
}

const BITSTRING_template& PacketFilterIdentifier_template::packetFilterIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field packetFilterIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier.");
return single_value->field_packetFilterIdentifier;
}

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

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

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

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

void PacketFilterIdentifier_template::log_match(const PacketFilterIdentifier& 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_packetFilterIdentifier.match(match_value.packetFilterIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".packetFilterIdentifier");
single_value->field_packetFilterIdentifier.log_match(match_value.packetFilterIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ packetFilterIdentifier := ");
single_value->field_packetFilterIdentifier.log_match(match_value.packetFilterIdentifier(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PacketFilterIdentifier_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (packetFilterIdentifier().is_bound()) packetFilterIdentifier().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void PacketFilterIdentifier_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_packetFilterIdentifier.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PacketFilterIdentifier_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier.");
}
}

void PacketFilterIdentifier_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: {
    PacketFilterIdentifier_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PacketFilterIdentifier 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) packetFilterIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFilterIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFilterIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PacketFilterIdentifier: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PacketFilterIdentifier_template* precondition = new PacketFilterIdentifier_template;
    precondition->set_param(*param.get_elem(0));
    PacketFilterIdentifier_template* implied_template = new PacketFilterIdentifier_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PacketFilterIdentifier_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PacketFilterIdentifier");
  }
  is_ifpresent = param.get_ifpresent();
}

void PacketFilterIdentifier_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_packetFilterIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterIdentifier");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterIdentifier");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFilterIdentifier");
}

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

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

TrafficFlowTemplateV__DeletePacketFilter::TrafficFlowTemplateV__DeletePacketFilter()
{
}

TrafficFlowTemplateV__DeletePacketFilter::TrafficFlowTemplateV__DeletePacketFilter(const INTEGER& par_numberOfPacketFilters,
    const BITSTRING& par_eBIT,
    const BITSTRING& par_operationCodeTFT,
    const PacketFilterList__DeletePacketFilter& par_packetFilterList__DeletePacketFilter,
    const OPTIONAL< ParametersList >& par_parametersList)
  :   field_numberOfPacketFilters(par_numberOfPacketFilters),
  field_eBIT(par_eBIT),
  field_operationCodeTFT(par_operationCodeTFT),
  field_packetFilterList__DeletePacketFilter(par_packetFilterList__DeletePacketFilter),
  field_parametersList(par_parametersList)
{
}

TrafficFlowTemplateV__DeletePacketFilter::TrafficFlowTemplateV__DeletePacketFilter(const TrafficFlowTemplateV__DeletePacketFilter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
if (other_value.numberOfPacketFilters().is_bound()) field_numberOfPacketFilters = other_value.numberOfPacketFilters();
else field_numberOfPacketFilters.clean_up();
if (other_value.eBIT().is_bound()) field_eBIT = other_value.eBIT();
else field_eBIT.clean_up();
if (other_value.operationCodeTFT().is_bound()) field_operationCodeTFT = other_value.operationCodeTFT();
else field_operationCodeTFT.clean_up();
if (other_value.packetFilterList__DeletePacketFilter().is_bound()) field_packetFilterList__DeletePacketFilter = other_value.packetFilterList__DeletePacketFilter();
else field_packetFilterList__DeletePacketFilter.clean_up();
if (other_value.parametersList().is_bound()) field_parametersList = other_value.parametersList();
else field_parametersList.clean_up();
}

void TrafficFlowTemplateV__DeletePacketFilter::clean_up()
{
field_numberOfPacketFilters.clean_up();
field_eBIT.clean_up();
field_operationCodeTFT.clean_up();
field_packetFilterList__DeletePacketFilter.clean_up();
field_parametersList.clean_up();
}

const TTCN_Typedescriptor_t* TrafficFlowTemplateV__DeletePacketFilter::get_descriptor() const { return &TrafficFlowTemplateV__DeletePacketFilter_descr_; }
TrafficFlowTemplateV__DeletePacketFilter& TrafficFlowTemplateV__DeletePacketFilter::operator=(const TrafficFlowTemplateV__DeletePacketFilter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
  if (other_value.numberOfPacketFilters().is_bound()) field_numberOfPacketFilters = other_value.numberOfPacketFilters();
  else field_numberOfPacketFilters.clean_up();
  if (other_value.eBIT().is_bound()) field_eBIT = other_value.eBIT();
  else field_eBIT.clean_up();
  if (other_value.operationCodeTFT().is_bound()) field_operationCodeTFT = other_value.operationCodeTFT();
  else field_operationCodeTFT.clean_up();
  if (other_value.packetFilterList__DeletePacketFilter().is_bound()) field_packetFilterList__DeletePacketFilter = other_value.packetFilterList__DeletePacketFilter();
  else field_packetFilterList__DeletePacketFilter.clean_up();
  if (other_value.parametersList().is_bound()) field_parametersList = other_value.parametersList();
  else field_parametersList.clean_up();
}
return *this;
}

boolean TrafficFlowTemplateV__DeletePacketFilter::operator==(const TrafficFlowTemplateV__DeletePacketFilter& other_value) const
{
return field_numberOfPacketFilters==other_value.field_numberOfPacketFilters
  && field_eBIT==other_value.field_eBIT
  && field_operationCodeTFT==other_value.field_operationCodeTFT
  && field_packetFilterList__DeletePacketFilter==other_value.field_packetFilterList__DeletePacketFilter
  && field_parametersList==other_value.field_parametersList;
}

boolean TrafficFlowTemplateV__DeletePacketFilter::is_bound() const
{
return (field_numberOfPacketFilters.is_bound())
  || (field_eBIT.is_bound())
  || (field_operationCodeTFT.is_bound())
  || (field_packetFilterList__DeletePacketFilter.is_bound())
  || (OPTIONAL_OMIT == field_parametersList.get_selection() || field_parametersList.is_bound());
}
boolean TrafficFlowTemplateV__DeletePacketFilter::is_value() const
{
return field_numberOfPacketFilters.is_value()
  && field_eBIT.is_value()
  && field_operationCodeTFT.is_value()
  && field_packetFilterList__DeletePacketFilter.is_value()
  && (OPTIONAL_OMIT == field_parametersList.get_selection() || field_parametersList.is_value());
}
int TrafficFlowTemplateV__DeletePacketFilter::size_of() const
{
  int ret_val = 4;
  if (field_parametersList.ispresent()) ret_val++;
  return ret_val;
}

void TrafficFlowTemplateV__DeletePacketFilter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ numberOfPacketFilters := ");
field_numberOfPacketFilters.log();
TTCN_Logger::log_event_str(", eBIT := ");
field_eBIT.log();
TTCN_Logger::log_event_str(", operationCodeTFT := ");
field_operationCodeTFT.log();
TTCN_Logger::log_event_str(", packetFilterList_DeletePacketFilter := ");
field_packetFilterList__DeletePacketFilter.log();
TTCN_Logger::log_event_str(", parametersList := ");
field_parametersList.log();
TTCN_Logger::log_event_str(" }");
}

void TrafficFlowTemplateV__DeletePacketFilter::set_implicit_omit()
{
if (numberOfPacketFilters().is_bound()) numberOfPacketFilters().set_implicit_omit();
if (eBIT().is_bound()) eBIT().set_implicit_omit();
if (operationCodeTFT().is_bound()) operationCodeTFT().set_implicit_omit();
if (packetFilterList__DeletePacketFilter().is_bound()) packetFilterList__DeletePacketFilter().set_implicit_omit();
if (!parametersList().is_bound()) parametersList() = OMIT_VALUE;
else parametersList().set_implicit_omit();
}

void TrafficFlowTemplateV__DeletePacketFilter::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter 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) numberOfPacketFilters().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eBIT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCodeTFT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) packetFilterList__DeletePacketFilter().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) parametersList().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(), "numberOfPacketFilters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberOfPacketFilters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eBIT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eBIT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCodeTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCodeTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFilterList_DeletePacketFilter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFilterList__DeletePacketFilter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parametersList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parametersList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
  }
}

void TrafficFlowTemplateV__DeletePacketFilter::encode_text(Text_Buf& text_buf) const
{
field_numberOfPacketFilters.encode_text(text_buf);
field_eBIT.encode_text(text_buf);
field_operationCodeTFT.encode_text(text_buf);
field_packetFilterList__DeletePacketFilter.encode_text(text_buf);
field_parametersList.encode_text(text_buf);
}

void TrafficFlowTemplateV__DeletePacketFilter::decode_text(Text_Buf& text_buf)
{
field_numberOfPacketFilters.decode_text(text_buf);
field_eBIT.decode_text(text_buf);
field_operationCodeTFT.decode_text(text_buf);
field_packetFilterList__DeletePacketFilter.decode_text(text_buf);
field_parametersList.decode_text(text_buf);
}

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

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

int TrafficFlowTemplateV__DeletePacketFilter::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, TrafficFlowTemplateV__DeletePacketFilter_numberOfPacketFilters_descr_.raw->forceomit);
  decoded_field_length = field_numberOfPacketFilters.RAW_decode(TrafficFlowTemplateV__DeletePacketFilter_numberOfPacketFilters_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_numberOfPacketFilters.convert_to_Integer(TrafficFlowTemplateV__DeletePacketFilter_numberOfPacketFilters_descr_);
  field_numberOfPacketFilters = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_eBIT.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_operationCodeTFT.RAW_decode(General__Types::BIT3_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, PacketFilterList__DeletePacketFilter_descr_.raw->forceomit);
  decoded_field_length = field_packetFilterList__DeletePacketFilter.RAW_decode(PacketFilterList__DeletePacketFilter_descr_, p_buf, limit, local_top_order, no_err, value_of_length_field0, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  if (limit > 0 && field_eBIT ==  bs_2){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_parametersList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, TrafficFlowTemplateV__DeletePacketFilter_parametersList_descr_.raw->forceomit);
  decoded_field_length = field_parametersList().RAW_decode(TrafficFlowTemplateV__DeletePacketFilter_parametersList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_parametersList = 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_parametersList=OMIT_VALUE;
  if (field_operationCodeTFT !=  bs_18) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TrafficFlowTemplateV__DeletePacketFilter::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, TrafficFlowTemplateV__DeletePacketFilter_numberOfPacketFilters_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PacketFilterList__DeletePacketFilter_descr_.raw);
  if (field_parametersList.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, TrafficFlowTemplateV__DeletePacketFilter_parametersList_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += 4;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &TrafficFlowTemplateV__DeletePacketFilter_numberOfPacketFilters_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 4;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_eBIT.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_operationCodeTFT.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_packetFilterList__DeletePacketFilter.RAW_encode(PacketFilterList__DeletePacketFilter_descr_, *myleaf.body.node.nodes[3]);
  if (field_parametersList.ispresent()) {
  encoded_length += field_parametersList().RAW_encode(TrafficFlowTemplateV__DeletePacketFilter_parametersList_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_parametersList.ispresent() && (field_eBIT !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_operationCodeTFT !=  bs_18) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_18.RAW_encode(General__Types::BIT3_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 TrafficFlowTemplateV__DeletePacketFilter_template::single_value_struct {
INTEGER_template field_numberOfPacketFilters;
BITSTRING_template field_eBIT;
BITSTRING_template field_operationCodeTFT;
PacketFilterList__DeletePacketFilter_template field_packetFilterList__DeletePacketFilter;
ParametersList_template field_parametersList;
};

void TrafficFlowTemplateV__DeletePacketFilter_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_numberOfPacketFilters = ANY_VALUE;
single_value->field_eBIT = ANY_VALUE;
single_value->field_operationCodeTFT = ANY_VALUE;
single_value->field_packetFilterList__DeletePacketFilter = ANY_VALUE;
single_value->field_parametersList = ANY_OR_OMIT;
}
}
}

void TrafficFlowTemplateV__DeletePacketFilter_template::copy_value(const TrafficFlowTemplateV__DeletePacketFilter& other_value)
{
single_value = new single_value_struct;
if (other_value.numberOfPacketFilters().is_bound()) {
  single_value->field_numberOfPacketFilters = other_value.numberOfPacketFilters();
} else {
  single_value->field_numberOfPacketFilters.clean_up();
}
if (other_value.eBIT().is_bound()) {
  single_value->field_eBIT = other_value.eBIT();
} else {
  single_value->field_eBIT.clean_up();
}
if (other_value.operationCodeTFT().is_bound()) {
  single_value->field_operationCodeTFT = other_value.operationCodeTFT();
} else {
  single_value->field_operationCodeTFT.clean_up();
}
if (other_value.packetFilterList__DeletePacketFilter().is_bound()) {
  single_value->field_packetFilterList__DeletePacketFilter = other_value.packetFilterList__DeletePacketFilter();
} else {
  single_value->field_packetFilterList__DeletePacketFilter.clean_up();
}
if (other_value.parametersList().is_bound()) {
  if (other_value.parametersList().ispresent()) single_value->field_parametersList = other_value.parametersList()();
  else single_value->field_parametersList = OMIT_VALUE;
} else {
  single_value->field_parametersList.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TrafficFlowTemplateV__DeletePacketFilter_template::copy_template(const TrafficFlowTemplateV__DeletePacketFilter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.numberOfPacketFilters().get_selection()) {
single_value->field_numberOfPacketFilters = other_value.numberOfPacketFilters();
} else {
single_value->field_numberOfPacketFilters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eBIT().get_selection()) {
single_value->field_eBIT = other_value.eBIT();
} else {
single_value->field_eBIT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.operationCodeTFT().get_selection()) {
single_value->field_operationCodeTFT = other_value.operationCodeTFT();
} else {
single_value->field_operationCodeTFT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.packetFilterList__DeletePacketFilter().get_selection()) {
single_value->field_packetFilterList__DeletePacketFilter = other_value.packetFilterList__DeletePacketFilter();
} else {
single_value->field_packetFilterList__DeletePacketFilter.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.parametersList().get_selection()) {
single_value->field_parametersList = other_value.parametersList();
} else {
single_value->field_parametersList.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 TrafficFlowTemplateV__DeletePacketFilter_template[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 TrafficFlowTemplateV__DeletePacketFilter_template(*other_value.implication_.precondition);
implication_.implied_template = new TrafficFlowTemplateV__DeletePacketFilter_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
break;
}
set_selection(other_value);
}

TrafficFlowTemplateV__DeletePacketFilter_template::TrafficFlowTemplateV__DeletePacketFilter_template()
{
}

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

TrafficFlowTemplateV__DeletePacketFilter_template::TrafficFlowTemplateV__DeletePacketFilter_template(const TrafficFlowTemplateV__DeletePacketFilter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TrafficFlowTemplateV__DeletePacketFilter_template::match(const TrafficFlowTemplateV__DeletePacketFilter& 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.numberOfPacketFilters().is_bound()) return FALSE;
if(!single_value->field_numberOfPacketFilters.match(other_value.numberOfPacketFilters(), legacy))return FALSE;
if(!other_value.eBIT().is_bound()) return FALSE;
if(!single_value->field_eBIT.match(other_value.eBIT(), legacy))return FALSE;
if(!other_value.operationCodeTFT().is_bound()) return FALSE;
if(!single_value->field_operationCodeTFT.match(other_value.operationCodeTFT(), legacy))return FALSE;
if(!other_value.packetFilterList__DeletePacketFilter().is_bound()) return FALSE;
if(!single_value->field_packetFilterList__DeletePacketFilter.match(other_value.packetFilterList__DeletePacketFilter(), legacy))return FALSE;
if(!other_value.parametersList().is_bound()) return FALSE;
if((other_value.parametersList().ispresent() ? !single_value->field_parametersList.match((const ParametersList&)other_value.parametersList(), legacy) : !single_value->field_parametersList.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
}
return FALSE;
}

boolean TrafficFlowTemplateV__DeletePacketFilter_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_numberOfPacketFilters.is_bound()
 || single_value->field_eBIT.is_bound()
 || single_value->field_operationCodeTFT.is_bound()
 || single_value->field_packetFilterList__DeletePacketFilter.is_bound()
 || (single_value->field_parametersList.is_omit() || single_value->field_parametersList.is_bound());
}

boolean TrafficFlowTemplateV__DeletePacketFilter_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_numberOfPacketFilters.is_value()
 && single_value->field_eBIT.is_value()
 && single_value->field_operationCodeTFT.is_value()
 && single_value->field_packetFilterList__DeletePacketFilter.is_value()
 && (single_value->field_parametersList.is_omit() || single_value->field_parametersList.is_value());
}

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

TrafficFlowTemplateV__DeletePacketFilter TrafficFlowTemplateV__DeletePacketFilter_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
TrafficFlowTemplateV__DeletePacketFilter ret_val;
if (single_value->field_numberOfPacketFilters.is_bound()) {
ret_val.numberOfPacketFilters() = single_value->field_numberOfPacketFilters.valueof();
}
if (single_value->field_eBIT.is_bound()) {
ret_val.eBIT() = single_value->field_eBIT.valueof();
}
if (single_value->field_operationCodeTFT.is_bound()) {
ret_val.operationCodeTFT() = single_value->field_operationCodeTFT.valueof();
}
if (single_value->field_packetFilterList__DeletePacketFilter.is_bound()) {
ret_val.packetFilterList__DeletePacketFilter() = single_value->field_packetFilterList__DeletePacketFilter.valueof();
}
if (single_value->field_parametersList.is_omit()) ret_val.parametersList() = OMIT_VALUE;
else if (single_value->field_parametersList.is_bound()) {
ret_val.parametersList() = single_value->field_parametersList.valueof();
}
return ret_val;
}

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

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

INTEGER_template& TrafficFlowTemplateV__DeletePacketFilter_template::numberOfPacketFilters()
{
set_specific();
return single_value->field_numberOfPacketFilters;
}

const INTEGER_template& TrafficFlowTemplateV__DeletePacketFilter_template::numberOfPacketFilters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field numberOfPacketFilters of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
return single_value->field_numberOfPacketFilters;
}

BITSTRING_template& TrafficFlowTemplateV__DeletePacketFilter_template::eBIT()
{
set_specific();
return single_value->field_eBIT;
}

const BITSTRING_template& TrafficFlowTemplateV__DeletePacketFilter_template::eBIT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eBIT of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
return single_value->field_eBIT;
}

BITSTRING_template& TrafficFlowTemplateV__DeletePacketFilter_template::operationCodeTFT()
{
set_specific();
return single_value->field_operationCodeTFT;
}

const BITSTRING_template& TrafficFlowTemplateV__DeletePacketFilter_template::operationCodeTFT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field operationCodeTFT of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
return single_value->field_operationCodeTFT;
}

PacketFilterList__DeletePacketFilter_template& TrafficFlowTemplateV__DeletePacketFilter_template::packetFilterList__DeletePacketFilter()
{
set_specific();
return single_value->field_packetFilterList__DeletePacketFilter;
}

const PacketFilterList__DeletePacketFilter_template& TrafficFlowTemplateV__DeletePacketFilter_template::packetFilterList__DeletePacketFilter() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field packetFilterList_DeletePacketFilter of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
return single_value->field_packetFilterList__DeletePacketFilter;
}

ParametersList_template& TrafficFlowTemplateV__DeletePacketFilter_template::parametersList()
{
set_specific();
return single_value->field_parametersList;
}

const ParametersList_template& TrafficFlowTemplateV__DeletePacketFilter_template::parametersList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parametersList of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
return single_value->field_parametersList;
}

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

void TrafficFlowTemplateV__DeletePacketFilter_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ numberOfPacketFilters := ");
single_value->field_numberOfPacketFilters.log();
TTCN_Logger::log_event_str(", eBIT := ");
single_value->field_eBIT.log();
TTCN_Logger::log_event_str(", operationCodeTFT := ");
single_value->field_operationCodeTFT.log();
TTCN_Logger::log_event_str(", packetFilterList_DeletePacketFilter := ");
single_value->field_packetFilterList__DeletePacketFilter.log();
TTCN_Logger::log_event_str(", parametersList := ");
single_value->field_parametersList.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 TrafficFlowTemplateV__DeletePacketFilter_template::log_match(const TrafficFlowTemplateV__DeletePacketFilter& 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_numberOfPacketFilters.match(match_value.numberOfPacketFilters(), legacy)){
TTCN_Logger::log_logmatch_info(".numberOfPacketFilters");
single_value->field_numberOfPacketFilters.log_match(match_value.numberOfPacketFilters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eBIT.match(match_value.eBIT(), legacy)){
TTCN_Logger::log_logmatch_info(".eBIT");
single_value->field_eBIT.log_match(match_value.eBIT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_operationCodeTFT.match(match_value.operationCodeTFT(), legacy)){
TTCN_Logger::log_logmatch_info(".operationCodeTFT");
single_value->field_operationCodeTFT.log_match(match_value.operationCodeTFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_packetFilterList__DeletePacketFilter.match(match_value.packetFilterList__DeletePacketFilter(), legacy)){
TTCN_Logger::log_logmatch_info(".packetFilterList_DeletePacketFilter");
single_value->field_packetFilterList__DeletePacketFilter.log_match(match_value.packetFilterList__DeletePacketFilter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.parametersList().ispresent()){
if(!single_value->field_parametersList.match(match_value.parametersList(), legacy)){
TTCN_Logger::log_logmatch_info(".parametersList");
single_value->field_parametersList.log_match(match_value.parametersList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_parametersList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".parametersList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_parametersList.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("{ numberOfPacketFilters := ");
single_value->field_numberOfPacketFilters.log_match(match_value.numberOfPacketFilters(), legacy);
TTCN_Logger::log_event_str(", eBIT := ");
single_value->field_eBIT.log_match(match_value.eBIT(), legacy);
TTCN_Logger::log_event_str(", operationCodeTFT := ");
single_value->field_operationCodeTFT.log_match(match_value.operationCodeTFT(), legacy);
TTCN_Logger::log_event_str(", packetFilterList_DeletePacketFilter := ");
single_value->field_packetFilterList__DeletePacketFilter.log_match(match_value.packetFilterList__DeletePacketFilter(), legacy);
TTCN_Logger::log_event_str(", parametersList := ");
if (match_value.parametersList().ispresent()) {
single_value->field_parametersList.log_match(match_value.parametersList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_parametersList.log();
if (single_value->field_parametersList.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 TrafficFlowTemplateV__DeletePacketFilter_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (numberOfPacketFilters().is_bound()) numberOfPacketFilters().set_implicit_omit();
if (eBIT().is_bound()) eBIT().set_implicit_omit();
if (operationCodeTFT().is_bound()) operationCodeTFT().set_implicit_omit();
if (packetFilterList__DeletePacketFilter().is_bound()) packetFilterList__DeletePacketFilter().set_implicit_omit();
if (!parametersList().is_bound()) parametersList() = OMIT_VALUE;
else parametersList().set_implicit_omit();
}

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

void TrafficFlowTemplateV__DeletePacketFilter_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_numberOfPacketFilters.decode_text(text_buf);
single_value->field_eBIT.decode_text(text_buf);
single_value->field_operationCodeTFT.decode_text(text_buf);
single_value->field_packetFilterList__DeletePacketFilter.decode_text(text_buf);
single_value->field_parametersList.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 TrafficFlowTemplateV__DeletePacketFilter_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter.");
}
}

void TrafficFlowTemplateV__DeletePacketFilter_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: {
    TrafficFlowTemplateV__DeletePacketFilter_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter 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) numberOfPacketFilters().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eBIT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCodeTFT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) packetFilterList__DeletePacketFilter().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) parametersList().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(), "numberOfPacketFilters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberOfPacketFilters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eBIT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eBIT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCodeTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCodeTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFilterList_DeletePacketFilter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFilterList__DeletePacketFilter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parametersList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parametersList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrafficFlowTemplateV__DeletePacketFilter_template* precondition = new TrafficFlowTemplateV__DeletePacketFilter_template;
    precondition->set_param(*param.get_elem(0));
    TrafficFlowTemplateV__DeletePacketFilter_template* implied_template = new TrafficFlowTemplateV__DeletePacketFilter_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrafficFlowTemplateV__DeletePacketFilter_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrafficFlowTemplateV__DeletePacketFilter_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_numberOfPacketFilters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
single_value->field_eBIT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
single_value->field_operationCodeTFT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
single_value->field_packetFilterList__DeletePacketFilter.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
single_value->field_parametersList.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_DeletePacketFilter");
}

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

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

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation()
{
}

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation(const BITSTRING& par_numberOfPacketFilters,
    const BITSTRING& par_eBIT,
    const BITSTRING& par_operationCodeTFT,
    const OPTIONAL< ParametersList >& par_parametersList)
  :   field_numberOfPacketFilters(par_numberOfPacketFilters),
  field_eBIT(par_eBIT),
  field_operationCodeTFT(par_operationCodeTFT),
  field_parametersList(par_parametersList)
{
}

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
if (other_value.numberOfPacketFilters().is_bound()) field_numberOfPacketFilters = other_value.numberOfPacketFilters();
else field_numberOfPacketFilters.clean_up();
if (other_value.eBIT().is_bound()) field_eBIT = other_value.eBIT();
else field_eBIT.clean_up();
if (other_value.operationCodeTFT().is_bound()) field_operationCodeTFT = other_value.operationCodeTFT();
else field_operationCodeTFT.clean_up();
if (other_value.parametersList().is_bound()) field_parametersList = other_value.parametersList();
else field_parametersList.clean_up();
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::clean_up()
{
field_numberOfPacketFilters.clean_up();
field_eBIT.clean_up();
field_operationCodeTFT.clean_up();
field_parametersList.clean_up();
}

const TTCN_Typedescriptor_t* TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::get_descriptor() const { return &TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_descr_; }
TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::operator=(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
  if (other_value.numberOfPacketFilters().is_bound()) field_numberOfPacketFilters = other_value.numberOfPacketFilters();
  else field_numberOfPacketFilters.clean_up();
  if (other_value.eBIT().is_bound()) field_eBIT = other_value.eBIT();
  else field_eBIT.clean_up();
  if (other_value.operationCodeTFT().is_bound()) field_operationCodeTFT = other_value.operationCodeTFT();
  else field_operationCodeTFT.clean_up();
  if (other_value.parametersList().is_bound()) field_parametersList = other_value.parametersList();
  else field_parametersList.clean_up();
}
return *this;
}

boolean TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::operator==(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& other_value) const
{
return field_numberOfPacketFilters==other_value.field_numberOfPacketFilters
  && field_eBIT==other_value.field_eBIT
  && field_operationCodeTFT==other_value.field_operationCodeTFT
  && field_parametersList==other_value.field_parametersList;
}

boolean TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::is_bound() const
{
return (field_numberOfPacketFilters.is_bound())
  || (field_eBIT.is_bound())
  || (field_operationCodeTFT.is_bound())
  || (OPTIONAL_OMIT == field_parametersList.get_selection() || field_parametersList.is_bound());
}
boolean TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::is_value() const
{
return field_numberOfPacketFilters.is_value()
  && field_eBIT.is_value()
  && field_operationCodeTFT.is_value()
  && (OPTIONAL_OMIT == field_parametersList.get_selection() || field_parametersList.is_value());
}
int TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::size_of() const
{
  int ret_val = 3;
  if (field_parametersList.ispresent()) ret_val++;
  return ret_val;
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ numberOfPacketFilters := ");
field_numberOfPacketFilters.log();
TTCN_Logger::log_event_str(", eBIT := ");
field_eBIT.log();
TTCN_Logger::log_event_str(", operationCodeTFT := ");
field_operationCodeTFT.log();
TTCN_Logger::log_event_str(", parametersList := ");
field_parametersList.log();
TTCN_Logger::log_event_str(" }");
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::set_implicit_omit()
{
if (numberOfPacketFilters().is_bound()) numberOfPacketFilters().set_implicit_omit();
if (eBIT().is_bound()) eBIT().set_implicit_omit();
if (operationCodeTFT().is_bound()) operationCodeTFT().set_implicit_omit();
if (!parametersList().is_bound()) parametersList() = OMIT_VALUE;
else parametersList().set_implicit_omit();
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation 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) numberOfPacketFilters().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eBIT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCodeTFT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) parametersList().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(), "numberOfPacketFilters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberOfPacketFilters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eBIT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eBIT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCodeTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCodeTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parametersList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parametersList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
  }
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::encode_text(Text_Buf& text_buf) const
{
field_numberOfPacketFilters.encode_text(text_buf);
field_eBIT.encode_text(text_buf);
field_operationCodeTFT.encode_text(text_buf);
field_parametersList.encode_text(text_buf);
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::decode_text(Text_Buf& text_buf)
{
field_numberOfPacketFilters.decode_text(text_buf);
field_eBIT.decode_text(text_buf);
field_operationCodeTFT.decode_text(text_buf);
field_parametersList.decode_text(text_buf);
}

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

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

int TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_numberOfPacketFilters.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_eBIT.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_operationCodeTFT.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_eBIT ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_parametersList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_parametersList_descr_.raw->forceomit);
  decoded_field_length = field_parametersList().RAW_decode(TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_parametersList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_parametersList = 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_parametersList=OMIT_VALUE;
  if (field_operationCodeTFT !=  bs_19 && field_operationCodeTFT !=  bs_20) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT3_descr_.raw);
  if (field_parametersList.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_parametersList_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_numberOfPacketFilters.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eBIT.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_operationCodeTFT.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  if (field_parametersList.ispresent()) {
  encoded_length += field_parametersList().RAW_encode(TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_parametersList_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_parametersList.ispresent() && (field_eBIT !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_operationCodeTFT !=  bs_19 && field_operationCodeTFT !=  bs_20) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_19.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+1;
  int new_pos1[]={2};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_20.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::single_value_struct {
BITSTRING_template field_numberOfPacketFilters;
BITSTRING_template field_eBIT;
BITSTRING_template field_operationCodeTFT;
ParametersList_template field_parametersList;
};

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_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_numberOfPacketFilters = ANY_VALUE;
single_value->field_eBIT = ANY_VALUE;
single_value->field_operationCodeTFT = ANY_VALUE;
single_value->field_parametersList = ANY_OR_OMIT;
}
}
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::copy_value(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& other_value)
{
single_value = new single_value_struct;
if (other_value.numberOfPacketFilters().is_bound()) {
  single_value->field_numberOfPacketFilters = other_value.numberOfPacketFilters();
} else {
  single_value->field_numberOfPacketFilters.clean_up();
}
if (other_value.eBIT().is_bound()) {
  single_value->field_eBIT = other_value.eBIT();
} else {
  single_value->field_eBIT.clean_up();
}
if (other_value.operationCodeTFT().is_bound()) {
  single_value->field_operationCodeTFT = other_value.operationCodeTFT();
} else {
  single_value->field_operationCodeTFT.clean_up();
}
if (other_value.parametersList().is_bound()) {
  if (other_value.parametersList().ispresent()) single_value->field_parametersList = other_value.parametersList()();
  else single_value->field_parametersList = OMIT_VALUE;
} else {
  single_value->field_parametersList.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::copy_template(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.numberOfPacketFilters().get_selection()) {
single_value->field_numberOfPacketFilters = other_value.numberOfPacketFilters();
} else {
single_value->field_numberOfPacketFilters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eBIT().get_selection()) {
single_value->field_eBIT = other_value.eBIT();
} else {
single_value->field_eBIT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.operationCodeTFT().get_selection()) {
single_value->field_operationCodeTFT = other_value.operationCodeTFT();
} else {
single_value->field_operationCodeTFT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.parametersList().get_selection()) {
single_value->field_parametersList = other_value.parametersList();
} else {
single_value->field_parametersList.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 TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template[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 TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template(*other_value.implication_.precondition);
implication_.implied_template = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
break;
}
set_selection(other_value);
}

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template()
{
}

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

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::match(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& 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.numberOfPacketFilters().is_bound()) return FALSE;
if(!single_value->field_numberOfPacketFilters.match(other_value.numberOfPacketFilters(), legacy))return FALSE;
if(!other_value.eBIT().is_bound()) return FALSE;
if(!single_value->field_eBIT.match(other_value.eBIT(), legacy))return FALSE;
if(!other_value.operationCodeTFT().is_bound()) return FALSE;
if(!single_value->field_operationCodeTFT.match(other_value.operationCodeTFT(), legacy))return FALSE;
if(!other_value.parametersList().is_bound()) return FALSE;
if((other_value.parametersList().ispresent() ? !single_value->field_parametersList.match((const ParametersList&)other_value.parametersList(), legacy) : !single_value->field_parametersList.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
}
return FALSE;
}

boolean TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_numberOfPacketFilters.is_bound()
 || single_value->field_eBIT.is_bound()
 || single_value->field_operationCodeTFT.is_bound()
 || (single_value->field_parametersList.is_omit() || single_value->field_parametersList.is_bound());
}

boolean TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_numberOfPacketFilters.is_value()
 && single_value->field_eBIT.is_value()
 && single_value->field_operationCodeTFT.is_value()
 && (single_value->field_parametersList.is_omit() || single_value->field_parametersList.is_value());
}

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

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation ret_val;
if (single_value->field_numberOfPacketFilters.is_bound()) {
ret_val.numberOfPacketFilters() = single_value->field_numberOfPacketFilters.valueof();
}
if (single_value->field_eBIT.is_bound()) {
ret_val.eBIT() = single_value->field_eBIT.valueof();
}
if (single_value->field_operationCodeTFT.is_bound()) {
ret_val.operationCodeTFT() = single_value->field_operationCodeTFT.valueof();
}
if (single_value->field_parametersList.is_omit()) ret_val.parametersList() = OMIT_VALUE;
else if (single_value->field_parametersList.is_bound()) {
ret_val.parametersList() = single_value->field_parametersList.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::numberOfPacketFilters()
{
set_specific();
return single_value->field_numberOfPacketFilters;
}

const BITSTRING_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::numberOfPacketFilters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field numberOfPacketFilters of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
return single_value->field_numberOfPacketFilters;
}

BITSTRING_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::eBIT()
{
set_specific();
return single_value->field_eBIT;
}

const BITSTRING_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::eBIT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eBIT of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
return single_value->field_eBIT;
}

BITSTRING_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::operationCodeTFT()
{
set_specific();
return single_value->field_operationCodeTFT;
}

const BITSTRING_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::operationCodeTFT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field operationCodeTFT of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
return single_value->field_operationCodeTFT;
}

ParametersList_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::parametersList()
{
set_specific();
return single_value->field_parametersList;
}

const ParametersList_template& TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::parametersList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parametersList of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
return single_value->field_parametersList;
}

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

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ numberOfPacketFilters := ");
single_value->field_numberOfPacketFilters.log();
TTCN_Logger::log_event_str(", eBIT := ");
single_value->field_eBIT.log();
TTCN_Logger::log_event_str(", operationCodeTFT := ");
single_value->field_operationCodeTFT.log();
TTCN_Logger::log_event_str(", parametersList := ");
single_value->field_parametersList.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 TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::log_match(const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& 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_numberOfPacketFilters.match(match_value.numberOfPacketFilters(), legacy)){
TTCN_Logger::log_logmatch_info(".numberOfPacketFilters");
single_value->field_numberOfPacketFilters.log_match(match_value.numberOfPacketFilters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eBIT.match(match_value.eBIT(), legacy)){
TTCN_Logger::log_logmatch_info(".eBIT");
single_value->field_eBIT.log_match(match_value.eBIT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_operationCodeTFT.match(match_value.operationCodeTFT(), legacy)){
TTCN_Logger::log_logmatch_info(".operationCodeTFT");
single_value->field_operationCodeTFT.log_match(match_value.operationCodeTFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.parametersList().ispresent()){
if(!single_value->field_parametersList.match(match_value.parametersList(), legacy)){
TTCN_Logger::log_logmatch_info(".parametersList");
single_value->field_parametersList.log_match(match_value.parametersList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_parametersList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".parametersList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_parametersList.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("{ numberOfPacketFilters := ");
single_value->field_numberOfPacketFilters.log_match(match_value.numberOfPacketFilters(), legacy);
TTCN_Logger::log_event_str(", eBIT := ");
single_value->field_eBIT.log_match(match_value.eBIT(), legacy);
TTCN_Logger::log_event_str(", operationCodeTFT := ");
single_value->field_operationCodeTFT.log_match(match_value.operationCodeTFT(), legacy);
TTCN_Logger::log_event_str(", parametersList := ");
if (match_value.parametersList().ispresent()) {
single_value->field_parametersList.log_match(match_value.parametersList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_parametersList.log();
if (single_value->field_parametersList.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 TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (numberOfPacketFilters().is_bound()) numberOfPacketFilters().set_implicit_omit();
if (eBIT().is_bound()) eBIT().set_implicit_omit();
if (operationCodeTFT().is_bound()) operationCodeTFT().set_implicit_omit();
if (!parametersList().is_bound()) parametersList() = OMIT_VALUE;
else parametersList().set_implicit_omit();
}

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

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_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_numberOfPacketFilters.decode_text(text_buf);
single_value->field_eBIT.decode_text(text_buf);
single_value->field_operationCodeTFT.decode_text(text_buf);
single_value->field_parametersList.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 TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation.");
}
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_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: {
    TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation 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) numberOfPacketFilters().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eBIT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCodeTFT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) parametersList().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(), "numberOfPacketFilters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberOfPacketFilters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eBIT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eBIT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCodeTFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCodeTFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parametersList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parametersList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template* precondition = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template;
    precondition->set_param(*param.get_elem(0));
    TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template* implied_template = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_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_numberOfPacketFilters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
single_value->field_eBIT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
single_value->field_operationCodeTFT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
single_value->field_parametersList.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
}

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

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

TrafficFlowTemplateLV::TrafficFlowTemplateLV()
{
}

TrafficFlowTemplateLV::TrafficFlowTemplateLV(const INTEGER& par_lengthIndicator,
    const TrafficFlowTemplateV& par_valueField)
  :   field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

TrafficFlowTemplateLV::TrafficFlowTemplateLV(const TrafficFlowTemplateLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void TrafficFlowTemplateLV::clean_up()
{
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* TrafficFlowTemplateLV::get_descriptor() const { return &TrafficFlowTemplateLV_descr_; }
TrafficFlowTemplateLV& TrafficFlowTemplateLV::operator=(const TrafficFlowTemplateLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

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

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

void TrafficFlowTemplateLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

void TrafficFlowTemplateLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void TrafficFlowTemplateLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

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

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

int TrafficFlowTemplateLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, TrafficFlowTemplateLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(TrafficFlowTemplateLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(TrafficFlowTemplateLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, TrafficFlowTemplateV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(TrafficFlowTemplateV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), 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());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TrafficFlowTemplateLV::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, TrafficFlowTemplateLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TrafficFlowTemplateV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &TrafficFlowTemplateLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_valueField.RAW_encode(TrafficFlowTemplateV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct TrafficFlowTemplateLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
TrafficFlowTemplateV_template field_valueField;
};

void TrafficFlowTemplateLV_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_lengthIndicator = ANY_VALUE;
single_value->field_valueField = ANY_VALUE;
}
}
}

void TrafficFlowTemplateLV_template::copy_value(const TrafficFlowTemplateLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TrafficFlowTemplateLV_template::copy_template(const TrafficFlowTemplateLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TrafficFlowTemplateLV_template[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 TrafficFlowTemplateLV_template(*other_value.implication_.precondition);
implication_.implied_template = new TrafficFlowTemplateLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV.");
break;
}
set_selection(other_value);
}

TrafficFlowTemplateLV_template::TrafficFlowTemplateLV_template()
{
}

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

TrafficFlowTemplateLV_template::TrafficFlowTemplateLV_template(const TrafficFlowTemplateLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

TrafficFlowTemplateLV TrafficFlowTemplateLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV.");
TrafficFlowTemplateLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

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

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

INTEGER_template& TrafficFlowTemplateLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& TrafficFlowTemplateLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV.");
return single_value->field_lengthIndicator;
}

TrafficFlowTemplateV_template& TrafficFlowTemplateLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const TrafficFlowTemplateV_template& TrafficFlowTemplateLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV.");
return single_value->field_valueField;
}

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

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

void TrafficFlowTemplateLV_template::log_match(const TrafficFlowTemplateLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TrafficFlowTemplateLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

void TrafficFlowTemplateLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TrafficFlowTemplateLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV.");
}
}

void TrafficFlowTemplateLV_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: {
    TrafficFlowTemplateLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) valueField().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrafficFlowTemplateLV_template* precondition = new TrafficFlowTemplateLV_template;
    precondition->set_param(*param.get_elem(0));
    TrafficFlowTemplateLV_template* implied_template = new TrafficFlowTemplateLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrafficFlowTemplateLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrafficFlowTemplateLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateLV");
}

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

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

TrafficFlowTemplateTLV::TrafficFlowTemplateTLV()
{
}

TrafficFlowTemplateTLV::TrafficFlowTemplateTLV(const OCTETSTRING& par_elementIdentifier,
    const TrafficFlowTemplateLV& par_trafficFlowTemplateLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_trafficFlowTemplateLV(par_trafficFlowTemplateLV)
{
}

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

void TrafficFlowTemplateTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_trafficFlowTemplateLV.clean_up();
}

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

boolean TrafficFlowTemplateTLV::operator==(const TrafficFlowTemplateTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_trafficFlowTemplateLV==other_value.field_trafficFlowTemplateLV;
}

boolean TrafficFlowTemplateTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_trafficFlowTemplateLV.is_bound());
}
boolean TrafficFlowTemplateTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_trafficFlowTemplateLV.is_value();
}
void TrafficFlowTemplateTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", trafficFlowTemplateLV := ");
field_trafficFlowTemplateLV.log();
TTCN_Logger::log_event_str(" }");
}

void TrafficFlowTemplateTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (trafficFlowTemplateLV().is_bound()) trafficFlowTemplateLV().set_implicit_omit();
}

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

void TrafficFlowTemplateTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_trafficFlowTemplateLV.encode_text(text_buf);
}

void TrafficFlowTemplateTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_trafficFlowTemplateLV.decode_text(text_buf);
}

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

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

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

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

struct TrafficFlowTemplateTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
TrafficFlowTemplateLV_template field_trafficFlowTemplateLV;
};

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

void TrafficFlowTemplateTLV_template::copy_value(const TrafficFlowTemplateTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.trafficFlowTemplateLV().is_bound()) {
  single_value->field_trafficFlowTemplateLV = other_value.trafficFlowTemplateLV();
} else {
  single_value->field_trafficFlowTemplateLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TrafficFlowTemplateTLV_template::copy_template(const TrafficFlowTemplateTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.trafficFlowTemplateLV().get_selection()) {
single_value->field_trafficFlowTemplateLV = other_value.trafficFlowTemplateLV();
} else {
single_value->field_trafficFlowTemplateLV.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 TrafficFlowTemplateTLV_template[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 TrafficFlowTemplateTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new TrafficFlowTemplateTLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateTLV.");
break;
}
set_selection(other_value);
}

TrafficFlowTemplateTLV_template::TrafficFlowTemplateTLV_template()
{
}

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

TrafficFlowTemplateTLV_template::TrafficFlowTemplateTLV_template(const TrafficFlowTemplateTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

TrafficFlowTemplateTLV TrafficFlowTemplateTLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateTLV.");
TrafficFlowTemplateTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_trafficFlowTemplateLV.is_bound()) {
ret_val.trafficFlowTemplateLV() = single_value->field_trafficFlowTemplateLV.valueof();
}
return ret_val;
}

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

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

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

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

TrafficFlowTemplateLV_template& TrafficFlowTemplateTLV_template::trafficFlowTemplateLV()
{
set_specific();
return single_value->field_trafficFlowTemplateLV;
}

const TrafficFlowTemplateLV_template& TrafficFlowTemplateTLV_template::trafficFlowTemplateLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field trafficFlowTemplateLV of a non-specific template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateTLV.");
return single_value->field_trafficFlowTemplateLV;
}

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

void TrafficFlowTemplateTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", trafficFlowTemplateLV := ");
single_value->field_trafficFlowTemplateLV.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 TrafficFlowTemplateTLV_template::log_match(const TrafficFlowTemplateTLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_trafficFlowTemplateLV.match(match_value.trafficFlowTemplateLV(), legacy)){
TTCN_Logger::log_logmatch_info(".trafficFlowTemplateLV");
single_value->field_trafficFlowTemplateLV.log_match(match_value.trafficFlowTemplateLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", trafficFlowTemplateLV := ");
single_value->field_trafficFlowTemplateLV.log_match(match_value.trafficFlowTemplateLV(), 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 TrafficFlowTemplateTLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (trafficFlowTemplateLV().is_bound()) trafficFlowTemplateLV().set_implicit_omit();
}

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

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

void TrafficFlowTemplateTLV_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: {
    TrafficFlowTemplateTLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateTLV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) trafficFlowTemplateLV().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trafficFlowTemplateLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trafficFlowTemplateLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrafficFlowTemplateTLV_template* precondition = new TrafficFlowTemplateTLV_template;
    precondition->set_param(*param.get_elem(0));
    TrafficFlowTemplateTLV_template* implied_template = new TrafficFlowTemplateTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrafficFlowTemplateTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

TemporaryMobileGroupIDLV::TemporaryMobileGroupIDLV()
{
}

TemporaryMobileGroupIDLV::TemporaryMobileGroupIDLV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_mBMSServiceID,
    const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2)
  :   field_lengthIndicator(par_lengthIndicator),
  field_mBMSServiceID(par_mBMSServiceID),
  field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2)
{
}

TemporaryMobileGroupIDLV::TemporaryMobileGroupIDLV(const TemporaryMobileGroupIDLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mBMSServiceID().is_bound()) field_mBMSServiceID = other_value.mBMSServiceID();
else field_mBMSServiceID.clean_up();
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
}

void TemporaryMobileGroupIDLV::clean_up()
{
field_lengthIndicator.clean_up();
field_mBMSServiceID.clean_up();
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
}

const TTCN_Typedescriptor_t* TemporaryMobileGroupIDLV::get_descriptor() const { return &TemporaryMobileGroupIDLV_descr_; }
TemporaryMobileGroupIDLV& TemporaryMobileGroupIDLV::operator=(const TemporaryMobileGroupIDLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mBMSServiceID().is_bound()) field_mBMSServiceID = other_value.mBMSServiceID();
  else field_mBMSServiceID.clean_up();
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
}
return *this;
}

boolean TemporaryMobileGroupIDLV::operator==(const TemporaryMobileGroupIDLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_mBMSServiceID==other_value.field_mBMSServiceID
  && field_mccDigit1==other_value.field_mccDigit1
  && field_mccDigit2==other_value.field_mccDigit2
  && field_mccDigit3==other_value.field_mccDigit3
  && field_mncDigit3==other_value.field_mncDigit3
  && field_mncDigit1==other_value.field_mncDigit1
  && field_mncDigit2==other_value.field_mncDigit2;
}

boolean TemporaryMobileGroupIDLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_mBMSServiceID.is_bound())
  || (field_mccDigit1.is_bound())
  || (field_mccDigit2.is_bound())
  || (field_mccDigit3.is_bound())
  || (field_mncDigit3.is_bound())
  || (field_mncDigit1.is_bound())
  || (field_mncDigit2.is_bound());
}
boolean TemporaryMobileGroupIDLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_mBMSServiceID.is_value()
  && field_mccDigit1.is_value()
  && field_mccDigit2.is_value()
  && field_mccDigit3.is_value()
  && field_mncDigit3.is_value()
  && field_mncDigit1.is_value()
  && field_mncDigit2.is_value();
}
void TemporaryMobileGroupIDLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mBMSServiceID := ");
field_mBMSServiceID.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
field_mncDigit2.log();
TTCN_Logger::log_event_str(" }");
}

void TemporaryMobileGroupIDLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mBMSServiceID().is_bound()) mBMSServiceID().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
}

void TemporaryMobileGroupIDLV::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 @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mBMSServiceID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMSServiceID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMSServiceID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
  }
}

void TemporaryMobileGroupIDLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_mBMSServiceID.encode_text(text_buf);
field_mccDigit1.encode_text(text_buf);
field_mccDigit2.encode_text(text_buf);
field_mccDigit3.encode_text(text_buf);
field_mncDigit3.encode_text(text_buf);
field_mncDigit1.encode_text(text_buf);
field_mncDigit2.encode_text(text_buf);
}

void TemporaryMobileGroupIDLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_mBMSServiceID.decode_text(text_buf);
field_mccDigit1.decode_text(text_buf);
field_mccDigit2.decode_text(text_buf);
field_mccDigit3.decode_text(text_buf);
field_mncDigit3.decode_text(text_buf);
field_mncDigit1.decode_text(text_buf);
field_mncDigit2.decode_text(text_buf);
}

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

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

int TemporaryMobileGroupIDLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, TemporaryMobileGroupIDLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(TemporaryMobileGroupIDLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(TemporaryMobileGroupIDLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_mBMSServiceID.RAW_decode(General__Types::OCT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), 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());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), 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());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(3, limit, value_of_length_field0, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TemporaryMobileGroupIDLV::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, TemporaryMobileGroupIDLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::HEX1_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &TemporaryMobileGroupIDLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 7;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(7);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  encoded_length += field_mBMSServiceID.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct TemporaryMobileGroupIDLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_mBMSServiceID;
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
};

void TemporaryMobileGroupIDLV_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_lengthIndicator = ANY_VALUE;
single_value->field_mBMSServiceID = ANY_VALUE;
single_value->field_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
}
}
}

void TemporaryMobileGroupIDLV_template::copy_value(const TemporaryMobileGroupIDLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mBMSServiceID().is_bound()) {
  single_value->field_mBMSServiceID = other_value.mBMSServiceID();
} else {
  single_value->field_mBMSServiceID.clean_up();
}
if (other_value.mccDigit1().is_bound()) {
  single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
  single_value->field_mccDigit1.clean_up();
}
if (other_value.mccDigit2().is_bound()) {
  single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
  single_value->field_mccDigit2.clean_up();
}
if (other_value.mccDigit3().is_bound()) {
  single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
  single_value->field_mccDigit3.clean_up();
}
if (other_value.mncDigit3().is_bound()) {
  single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
  single_value->field_mncDigit3.clean_up();
}
if (other_value.mncDigit1().is_bound()) {
  single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
  single_value->field_mncDigit1.clean_up();
}
if (other_value.mncDigit2().is_bound()) {
  single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
  single_value->field_mncDigit2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TemporaryMobileGroupIDLV_template::copy_template(const TemporaryMobileGroupIDLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMSServiceID().get_selection()) {
single_value->field_mBMSServiceID = other_value.mBMSServiceID();
} else {
single_value->field_mBMSServiceID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit1().get_selection()) {
single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
single_value->field_mccDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit2().get_selection()) {
single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
single_value->field_mccDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit3().get_selection()) {
single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
single_value->field_mccDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit3().get_selection()) {
single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
single_value->field_mncDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit1().get_selection()) {
single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
single_value->field_mncDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit2().get_selection()) {
single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
single_value->field_mncDigit2.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TemporaryMobileGroupIDLV_template[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 TemporaryMobileGroupIDLV_template(*other_value.implication_.precondition);
implication_.implied_template = new TemporaryMobileGroupIDLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
break;
}
set_selection(other_value);
}

TemporaryMobileGroupIDLV_template::TemporaryMobileGroupIDLV_template()
{
}

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

TemporaryMobileGroupIDLV_template::TemporaryMobileGroupIDLV_template(const TemporaryMobileGroupIDLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TemporaryMobileGroupIDLV_template::match(const TemporaryMobileGroupIDLV& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.mBMSServiceID().is_bound()) return FALSE;
if(!single_value->field_mBMSServiceID.match(other_value.mBMSServiceID(), legacy))return FALSE;
if(!other_value.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
}
return FALSE;
}

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

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

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

TemporaryMobileGroupIDLV TemporaryMobileGroupIDLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
TemporaryMobileGroupIDLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mBMSServiceID.is_bound()) {
ret_val.mBMSServiceID() = single_value->field_mBMSServiceID.valueof();
}
if (single_value->field_mccDigit1.is_bound()) {
ret_val.mccDigit1() = single_value->field_mccDigit1.valueof();
}
if (single_value->field_mccDigit2.is_bound()) {
ret_val.mccDigit2() = single_value->field_mccDigit2.valueof();
}
if (single_value->field_mccDigit3.is_bound()) {
ret_val.mccDigit3() = single_value->field_mccDigit3.valueof();
}
if (single_value->field_mncDigit3.is_bound()) {
ret_val.mncDigit3() = single_value->field_mncDigit3.valueof();
}
if (single_value->field_mncDigit1.is_bound()) {
ret_val.mncDigit1() = single_value->field_mncDigit1.valueof();
}
if (single_value->field_mncDigit2.is_bound()) {
ret_val.mncDigit2() = single_value->field_mncDigit2.valueof();
}
return ret_val;
}

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

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

INTEGER_template& TemporaryMobileGroupIDLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& TemporaryMobileGroupIDLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& TemporaryMobileGroupIDLV_template::mBMSServiceID()
{
set_specific();
return single_value->field_mBMSServiceID;
}

const OCTETSTRING_template& TemporaryMobileGroupIDLV_template::mBMSServiceID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMSServiceID of a non-specific template of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
return single_value->field_mBMSServiceID;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

void TemporaryMobileGroupIDLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mBMSServiceID := ");
single_value->field_mBMSServiceID.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TemporaryMobileGroupIDLV_template::log_match(const TemporaryMobileGroupIDLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMSServiceID.match(match_value.mBMSServiceID(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMSServiceID");
single_value->field_mBMSServiceID.log_match(match_value.mBMSServiceID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", mBMSServiceID := ");
single_value->field_mBMSServiceID.log_match(match_value.mBMSServiceID(), legacy);
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TemporaryMobileGroupIDLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mBMSServiceID().is_bound()) mBMSServiceID().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
}

void TemporaryMobileGroupIDLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mBMSServiceID.encode_text(text_buf);
single_value->field_mccDigit1.encode_text(text_buf);
single_value->field_mccDigit2.encode_text(text_buf);
single_value->field_mccDigit3.encode_text(text_buf);
single_value->field_mncDigit3.encode_text(text_buf);
single_value->field_mncDigit1.encode_text(text_buf);
single_value->field_mncDigit2.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
}
}

void TemporaryMobileGroupIDLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_mBMSServiceID.decode_text(text_buf);
single_value->field_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TemporaryMobileGroupIDLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV.");
}
}

void TemporaryMobileGroupIDLV_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: {
    TemporaryMobileGroupIDLV_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 @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mBMSServiceID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMSServiceID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMSServiceID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TemporaryMobileGroupIDLV_template* precondition = new TemporaryMobileGroupIDLV_template;
    precondition->set_param(*param.get_elem(0));
    TemporaryMobileGroupIDLV_template* implied_template = new TemporaryMobileGroupIDLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TemporaryMobileGroupIDLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void TemporaryMobileGroupIDLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
single_value->field_mBMSServiceID.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.TemporaryMobileGroupIDLV");
}

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

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

MBMSBearerCapabilitiesLV::MBMSBearerCapabilitiesLV()
{
}

MBMSBearerCapabilitiesLV::MBMSBearerCapabilitiesLV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_maxBitrateDownlink,
    const OPTIONAL< OCTETSTRING >& par_maxBitrateDownlinkExtended)
  :   field_lengthIndicator(par_lengthIndicator),
  field_maxBitrateDownlink(par_maxBitrateDownlink),
  field_maxBitrateDownlinkExtended(par_maxBitrateDownlinkExtended)
{
}

MBMSBearerCapabilitiesLV::MBMSBearerCapabilitiesLV(const MBMSBearerCapabilitiesLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.maxBitrateDownlink().is_bound()) field_maxBitrateDownlink = other_value.maxBitrateDownlink();
else field_maxBitrateDownlink.clean_up();
if (other_value.maxBitrateDownlinkExtended().is_bound()) field_maxBitrateDownlinkExtended = other_value.maxBitrateDownlinkExtended();
else field_maxBitrateDownlinkExtended.clean_up();
}

void MBMSBearerCapabilitiesLV::clean_up()
{
field_lengthIndicator.clean_up();
field_maxBitrateDownlink.clean_up();
field_maxBitrateDownlinkExtended.clean_up();
}

const TTCN_Typedescriptor_t* MBMSBearerCapabilitiesLV::get_descriptor() const { return &MBMSBearerCapabilitiesLV_descr_; }
MBMSBearerCapabilitiesLV& MBMSBearerCapabilitiesLV::operator=(const MBMSBearerCapabilitiesLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.maxBitrateDownlink().is_bound()) field_maxBitrateDownlink = other_value.maxBitrateDownlink();
  else field_maxBitrateDownlink.clean_up();
  if (other_value.maxBitrateDownlinkExtended().is_bound()) field_maxBitrateDownlinkExtended = other_value.maxBitrateDownlinkExtended();
  else field_maxBitrateDownlinkExtended.clean_up();
}
return *this;
}

boolean MBMSBearerCapabilitiesLV::operator==(const MBMSBearerCapabilitiesLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_maxBitrateDownlink==other_value.field_maxBitrateDownlink
  && field_maxBitrateDownlinkExtended==other_value.field_maxBitrateDownlinkExtended;
}

boolean MBMSBearerCapabilitiesLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_maxBitrateDownlink.is_bound())
  || (OPTIONAL_OMIT == field_maxBitrateDownlinkExtended.get_selection() || field_maxBitrateDownlinkExtended.is_bound());
}
boolean MBMSBearerCapabilitiesLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_maxBitrateDownlink.is_value()
  && (OPTIONAL_OMIT == field_maxBitrateDownlinkExtended.get_selection() || field_maxBitrateDownlinkExtended.is_value());
}
int MBMSBearerCapabilitiesLV::size_of() const
{
  int ret_val = 2;
  if (field_maxBitrateDownlinkExtended.ispresent()) ret_val++;
  return ret_val;
}

void MBMSBearerCapabilitiesLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", maxBitrateDownlink := ");
field_maxBitrateDownlink.log();
TTCN_Logger::log_event_str(", maxBitrateDownlinkExtended := ");
field_maxBitrateDownlinkExtended.log();
TTCN_Logger::log_event_str(" }");
}

void MBMSBearerCapabilitiesLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (maxBitrateDownlink().is_bound()) maxBitrateDownlink().set_implicit_omit();
if (!maxBitrateDownlinkExtended().is_bound()) maxBitrateDownlinkExtended() = OMIT_VALUE;
else maxBitrateDownlinkExtended().set_implicit_omit();
}

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

void MBMSBearerCapabilitiesLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_maxBitrateDownlink.encode_text(text_buf);
field_maxBitrateDownlinkExtended.encode_text(text_buf);
}

void MBMSBearerCapabilitiesLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_maxBitrateDownlink.decode_text(text_buf);
field_maxBitrateDownlinkExtended.decode_text(text_buf);
}

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

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

int MBMSBearerCapabilitiesLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, MBMSBearerCapabilitiesLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMSBearerCapabilitiesLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(MBMSBearerCapabilitiesLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateDownlink.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), 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());
  value_of_length_field0 -= decoded_field_length;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_maxBitrateDownlinkExtended = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateDownlinkExtended().RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_maxBitrateDownlinkExtended = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_maxBitrateDownlinkExtended=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMSBearerCapabilitiesLV::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, MBMSBearerCapabilitiesLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT1_descr_.raw);
  if (field_maxBitrateDownlinkExtended.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &MBMSBearerCapabilitiesLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  if (field_maxBitrateDownlinkExtended.ispresent()) {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = 0;
  }
  encoded_length += field_maxBitrateDownlink.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  if (field_maxBitrateDownlinkExtended.ispresent()) {
  encoded_length += field_maxBitrateDownlinkExtended().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  }
  return myleaf.length = encoded_length;
}

struct MBMSBearerCapabilitiesLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_maxBitrateDownlink;
OCTETSTRING_template field_maxBitrateDownlinkExtended;
};

void MBMSBearerCapabilitiesLV_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_lengthIndicator = ANY_VALUE;
single_value->field_maxBitrateDownlink = ANY_VALUE;
single_value->field_maxBitrateDownlinkExtended = ANY_OR_OMIT;
}
}
}

void MBMSBearerCapabilitiesLV_template::copy_value(const MBMSBearerCapabilitiesLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.maxBitrateDownlink().is_bound()) {
  single_value->field_maxBitrateDownlink = other_value.maxBitrateDownlink();
} else {
  single_value->field_maxBitrateDownlink.clean_up();
}
if (other_value.maxBitrateDownlinkExtended().is_bound()) {
  if (other_value.maxBitrateDownlinkExtended().ispresent()) single_value->field_maxBitrateDownlinkExtended = other_value.maxBitrateDownlinkExtended()();
  else single_value->field_maxBitrateDownlinkExtended = OMIT_VALUE;
} else {
  single_value->field_maxBitrateDownlinkExtended.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMSBearerCapabilitiesLV_template::copy_template(const MBMSBearerCapabilitiesLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxBitrateDownlink().get_selection()) {
single_value->field_maxBitrateDownlink = other_value.maxBitrateDownlink();
} else {
single_value->field_maxBitrateDownlink.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxBitrateDownlinkExtended().get_selection()) {
single_value->field_maxBitrateDownlinkExtended = other_value.maxBitrateDownlinkExtended();
} else {
single_value->field_maxBitrateDownlinkExtended.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 MBMSBearerCapabilitiesLV_template[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 MBMSBearerCapabilitiesLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMSBearerCapabilitiesLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
break;
}
set_selection(other_value);
}

MBMSBearerCapabilitiesLV_template::MBMSBearerCapabilitiesLV_template()
{
}

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

MBMSBearerCapabilitiesLV_template::MBMSBearerCapabilitiesLV_template(const MBMSBearerCapabilitiesLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMSBearerCapabilitiesLV_template::match(const MBMSBearerCapabilitiesLV& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.maxBitrateDownlink().is_bound()) return FALSE;
if(!single_value->field_maxBitrateDownlink.match(other_value.maxBitrateDownlink(), legacy))return FALSE;
if(!other_value.maxBitrateDownlinkExtended().is_bound()) return FALSE;
if((other_value.maxBitrateDownlinkExtended().ispresent() ? !single_value->field_maxBitrateDownlinkExtended.match((const OCTETSTRING&)other_value.maxBitrateDownlinkExtended(), legacy) : !single_value->field_maxBitrateDownlinkExtended.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
}
return FALSE;
}

boolean MBMSBearerCapabilitiesLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_maxBitrateDownlink.is_bound()
 || (single_value->field_maxBitrateDownlinkExtended.is_omit() || single_value->field_maxBitrateDownlinkExtended.is_bound());
}

boolean MBMSBearerCapabilitiesLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_maxBitrateDownlink.is_value()
 && (single_value->field_maxBitrateDownlinkExtended.is_omit() || single_value->field_maxBitrateDownlinkExtended.is_value());
}

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

MBMSBearerCapabilitiesLV MBMSBearerCapabilitiesLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
MBMSBearerCapabilitiesLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_maxBitrateDownlink.is_bound()) {
ret_val.maxBitrateDownlink() = single_value->field_maxBitrateDownlink.valueof();
}
if (single_value->field_maxBitrateDownlinkExtended.is_omit()) ret_val.maxBitrateDownlinkExtended() = OMIT_VALUE;
else if (single_value->field_maxBitrateDownlinkExtended.is_bound()) {
ret_val.maxBitrateDownlinkExtended() = single_value->field_maxBitrateDownlinkExtended.valueof();
}
return ret_val;
}

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

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

INTEGER_template& MBMSBearerCapabilitiesLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& MBMSBearerCapabilitiesLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& MBMSBearerCapabilitiesLV_template::maxBitrateDownlink()
{
set_specific();
return single_value->field_maxBitrateDownlink;
}

const OCTETSTRING_template& MBMSBearerCapabilitiesLV_template::maxBitrateDownlink() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxBitrateDownlink of a non-specific template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
return single_value->field_maxBitrateDownlink;
}

OCTETSTRING_template& MBMSBearerCapabilitiesLV_template::maxBitrateDownlinkExtended()
{
set_specific();
return single_value->field_maxBitrateDownlinkExtended;
}

const OCTETSTRING_template& MBMSBearerCapabilitiesLV_template::maxBitrateDownlinkExtended() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxBitrateDownlinkExtended of a non-specific template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
return single_value->field_maxBitrateDownlinkExtended;
}

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

void MBMSBearerCapabilitiesLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", maxBitrateDownlink := ");
single_value->field_maxBitrateDownlink.log();
TTCN_Logger::log_event_str(", maxBitrateDownlinkExtended := ");
single_value->field_maxBitrateDownlinkExtended.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 MBMSBearerCapabilitiesLV_template::log_match(const MBMSBearerCapabilitiesLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_maxBitrateDownlink.match(match_value.maxBitrateDownlink(), legacy)){
TTCN_Logger::log_logmatch_info(".maxBitrateDownlink");
single_value->field_maxBitrateDownlink.log_match(match_value.maxBitrateDownlink(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.maxBitrateDownlinkExtended().ispresent()){
if(!single_value->field_maxBitrateDownlinkExtended.match(match_value.maxBitrateDownlinkExtended(), legacy)){
TTCN_Logger::log_logmatch_info(".maxBitrateDownlinkExtended");
single_value->field_maxBitrateDownlinkExtended.log_match(match_value.maxBitrateDownlinkExtended(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_maxBitrateDownlinkExtended.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxBitrateDownlinkExtended := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxBitrateDownlinkExtended.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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", maxBitrateDownlink := ");
single_value->field_maxBitrateDownlink.log_match(match_value.maxBitrateDownlink(), legacy);
TTCN_Logger::log_event_str(", maxBitrateDownlinkExtended := ");
if (match_value.maxBitrateDownlinkExtended().ispresent()) {
single_value->field_maxBitrateDownlinkExtended.log_match(match_value.maxBitrateDownlinkExtended(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxBitrateDownlinkExtended.log();
if (single_value->field_maxBitrateDownlinkExtended.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 MBMSBearerCapabilitiesLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (maxBitrateDownlink().is_bound()) maxBitrateDownlink().set_implicit_omit();
if (!maxBitrateDownlinkExtended().is_bound()) maxBitrateDownlinkExtended() = OMIT_VALUE;
else maxBitrateDownlinkExtended().set_implicit_omit();
}

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

void MBMSBearerCapabilitiesLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_maxBitrateDownlink.decode_text(text_buf);
single_value->field_maxBitrateDownlinkExtended.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 MBMSBearerCapabilitiesLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV.");
}
}

void MBMSBearerCapabilitiesLV_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: {
    MBMSBearerCapabilitiesLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlink().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlinkExtended().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateDownlink")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateDownlink().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateDownlinkExtended")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateDownlinkExtended().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMSBearerCapabilitiesLV_template* precondition = new MBMSBearerCapabilitiesLV_template;
    precondition->set_param(*param.get_elem(0));
    MBMSBearerCapabilitiesLV_template* implied_template = new MBMSBearerCapabilitiesLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMSBearerCapabilitiesLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMSBearerCapabilitiesLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV");
single_value->field_maxBitrateDownlink.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV");
single_value->field_maxBitrateDownlinkExtended.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMSBearerCapabilitiesLV");
}

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

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

MBMSProtocolConfigOptionsTLV::MBMSProtocolConfigOptionsTLV()
{
}

MBMSProtocolConfigOptionsTLV::MBMSProtocolConfigOptionsTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_spare,
    const OCTETSTRING& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_spare(par_spare),
  field_valueField(par_valueField)
{
}

MBMSProtocolConfigOptionsTLV::MBMSProtocolConfigOptionsTLV(const MBMSProtocolConfigOptionsTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void MBMSProtocolConfigOptionsTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_spare.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* MBMSProtocolConfigOptionsTLV::get_descriptor() const { return &MBMSProtocolConfigOptionsTLV_descr_; }
MBMSProtocolConfigOptionsTLV& MBMSProtocolConfigOptionsTLV::operator=(const MBMSProtocolConfigOptionsTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

boolean MBMSProtocolConfigOptionsTLV::operator==(const MBMSProtocolConfigOptionsTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_spare==other_value.field_spare
  && field_valueField==other_value.field_valueField;
}

boolean MBMSProtocolConfigOptionsTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare.is_bound())
  || (field_valueField.is_bound());
}
boolean MBMSProtocolConfigOptionsTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_spare.is_value()
  && field_valueField.is_value();
}
void MBMSProtocolConfigOptionsTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void MBMSProtocolConfigOptionsTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

void MBMSProtocolConfigOptionsTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void MBMSProtocolConfigOptionsTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

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

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

int MBMSProtocolConfigOptionsTLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MBMSProtocolConfigOptionsTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMSProtocolConfigOptionsTLV_lengthIndicator_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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(MBMSProtocolConfigOptionsTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), 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());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_21) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMSProtocolConfigOptionsTLV::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, MBMSProtocolConfigOptionsTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &MBMSProtocolConfigOptionsTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_spare.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_valueField.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  if (field_elementIdentifier !=  os_21) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_21.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMSProtocolConfigOptionsTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_spare;
OCTETSTRING_template field_valueField;
};

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

void MBMSProtocolConfigOptionsTLV_template::copy_value(const MBMSProtocolConfigOptionsTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMSProtocolConfigOptionsTLV_template::copy_template(const MBMSProtocolConfigOptionsTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MBMSProtocolConfigOptionsTLV_template[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 MBMSProtocolConfigOptionsTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMSProtocolConfigOptionsTLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV.");
break;
}
set_selection(other_value);
}

MBMSProtocolConfigOptionsTLV_template::MBMSProtocolConfigOptionsTLV_template()
{
}

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

MBMSProtocolConfigOptionsTLV_template::MBMSProtocolConfigOptionsTLV_template(const MBMSProtocolConfigOptionsTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMSProtocolConfigOptionsTLV_template::match(const MBMSProtocolConfigOptionsTLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV.");
}
return FALSE;
}

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

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

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

MBMSProtocolConfigOptionsTLV MBMSProtocolConfigOptionsTLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV.");
MBMSProtocolConfigOptionsTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

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

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

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

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

INTEGER_template& MBMSProtocolConfigOptionsTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& MBMSProtocolConfigOptionsTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV.");
return single_value->field_lengthIndicator;
}

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

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

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

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

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

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

void MBMSProtocolConfigOptionsTLV_template::log_match(const MBMSProtocolConfigOptionsTLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void MBMSProtocolConfigOptionsTLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

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

void MBMSProtocolConfigOptionsTLV_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: {
    MBMSProtocolConfigOptionsTLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMSProtocolConfigOptionsTLV_template* precondition = new MBMSProtocolConfigOptionsTLV_template;
    precondition->set_param(*param.get_elem(0));
    MBMSProtocolConfigOptionsTLV_template* implied_template = new MBMSProtocolConfigOptionsTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMSProtocolConfigOptionsTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MBMSProtocolConfigOptionsTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

EnhancedNetworkSeviveAccessPointIDV::EnhancedNetworkSeviveAccessPointIDV()
{
}

EnhancedNetworkSeviveAccessPointIDV::EnhancedNetworkSeviveAccessPointIDV(const OCTETSTRING& par_enhancedNetworkSeviveAccessPointIDValue)
  :   field_enhancedNetworkSeviveAccessPointIDValue(par_enhancedNetworkSeviveAccessPointIDValue)
{
}

EnhancedNetworkSeviveAccessPointIDV::EnhancedNetworkSeviveAccessPointIDV(const EnhancedNetworkSeviveAccessPointIDV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV.");
if (other_value.enhancedNetworkSeviveAccessPointIDValue().is_bound()) field_enhancedNetworkSeviveAccessPointIDValue = other_value.enhancedNetworkSeviveAccessPointIDValue();
else field_enhancedNetworkSeviveAccessPointIDValue.clean_up();
}

void EnhancedNetworkSeviveAccessPointIDV::clean_up()
{
field_enhancedNetworkSeviveAccessPointIDValue.clean_up();
}

const TTCN_Typedescriptor_t* EnhancedNetworkSeviveAccessPointIDV::get_descriptor() const { return &EnhancedNetworkSeviveAccessPointIDV_descr_; }
EnhancedNetworkSeviveAccessPointIDV& EnhancedNetworkSeviveAccessPointIDV::operator=(const EnhancedNetworkSeviveAccessPointIDV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV.");
  if (other_value.enhancedNetworkSeviveAccessPointIDValue().is_bound()) field_enhancedNetworkSeviveAccessPointIDValue = other_value.enhancedNetworkSeviveAccessPointIDValue();
  else field_enhancedNetworkSeviveAccessPointIDValue.clean_up();
}
return *this;
}

boolean EnhancedNetworkSeviveAccessPointIDV::operator==(const EnhancedNetworkSeviveAccessPointIDV& other_value) const
{
return field_enhancedNetworkSeviveAccessPointIDValue==other_value.field_enhancedNetworkSeviveAccessPointIDValue;
}

boolean EnhancedNetworkSeviveAccessPointIDV::is_bound() const
{
return (field_enhancedNetworkSeviveAccessPointIDValue.is_bound());
}
boolean EnhancedNetworkSeviveAccessPointIDV::is_value() const
{
return field_enhancedNetworkSeviveAccessPointIDValue.is_value();
}
void EnhancedNetworkSeviveAccessPointIDV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ enhancedNetworkSeviveAccessPointIDValue := ");
field_enhancedNetworkSeviveAccessPointIDValue.log();
TTCN_Logger::log_event_str(" }");
}

void EnhancedNetworkSeviveAccessPointIDV::set_implicit_omit()
{
if (enhancedNetworkSeviveAccessPointIDValue().is_bound()) enhancedNetworkSeviveAccessPointIDValue().set_implicit_omit();
}

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

void EnhancedNetworkSeviveAccessPointIDV::encode_text(Text_Buf& text_buf) const
{
field_enhancedNetworkSeviveAccessPointIDValue.encode_text(text_buf);
}

void EnhancedNetworkSeviveAccessPointIDV::decode_text(Text_Buf& text_buf)
{
field_enhancedNetworkSeviveAccessPointIDValue.decode_text(text_buf);
}

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

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

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

int EnhancedNetworkSeviveAccessPointIDV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  encoded_length += field_enhancedNetworkSeviveAccessPointIDValue.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct EnhancedNetworkSeviveAccessPointIDV_template::single_value_struct {
OCTETSTRING_template field_enhancedNetworkSeviveAccessPointIDValue;
};

void EnhancedNetworkSeviveAccessPointIDV_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_enhancedNetworkSeviveAccessPointIDValue = ANY_VALUE;
}
}
}

void EnhancedNetworkSeviveAccessPointIDV_template::copy_value(const EnhancedNetworkSeviveAccessPointIDV& other_value)
{
single_value = new single_value_struct;
if (other_value.enhancedNetworkSeviveAccessPointIDValue().is_bound()) {
  single_value->field_enhancedNetworkSeviveAccessPointIDValue = other_value.enhancedNetworkSeviveAccessPointIDValue();
} else {
  single_value->field_enhancedNetworkSeviveAccessPointIDValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EnhancedNetworkSeviveAccessPointIDV_template::copy_template(const EnhancedNetworkSeviveAccessPointIDV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.enhancedNetworkSeviveAccessPointIDValue().get_selection()) {
single_value->field_enhancedNetworkSeviveAccessPointIDValue = other_value.enhancedNetworkSeviveAccessPointIDValue();
} else {
single_value->field_enhancedNetworkSeviveAccessPointIDValue.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 EnhancedNetworkSeviveAccessPointIDV_template[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 EnhancedNetworkSeviveAccessPointIDV_template(*other_value.implication_.precondition);
implication_.implied_template = new EnhancedNetworkSeviveAccessPointIDV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV.");
break;
}
set_selection(other_value);
}

EnhancedNetworkSeviveAccessPointIDV_template::EnhancedNetworkSeviveAccessPointIDV_template()
{
}

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

EnhancedNetworkSeviveAccessPointIDV_template::EnhancedNetworkSeviveAccessPointIDV_template(const EnhancedNetworkSeviveAccessPointIDV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

boolean EnhancedNetworkSeviveAccessPointIDV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_enhancedNetworkSeviveAccessPointIDValue.is_value();
}

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

EnhancedNetworkSeviveAccessPointIDV EnhancedNetworkSeviveAccessPointIDV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV.");
EnhancedNetworkSeviveAccessPointIDV ret_val;
if (single_value->field_enhancedNetworkSeviveAccessPointIDValue.is_bound()) {
ret_val.enhancedNetworkSeviveAccessPointIDValue() = single_value->field_enhancedNetworkSeviveAccessPointIDValue.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& EnhancedNetworkSeviveAccessPointIDV_template::enhancedNetworkSeviveAccessPointIDValue()
{
set_specific();
return single_value->field_enhancedNetworkSeviveAccessPointIDValue;
}

const OCTETSTRING_template& EnhancedNetworkSeviveAccessPointIDV_template::enhancedNetworkSeviveAccessPointIDValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field enhancedNetworkSeviveAccessPointIDValue of a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV.");
return single_value->field_enhancedNetworkSeviveAccessPointIDValue;
}

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

void EnhancedNetworkSeviveAccessPointIDV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ enhancedNetworkSeviveAccessPointIDValue := ");
single_value->field_enhancedNetworkSeviveAccessPointIDValue.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 EnhancedNetworkSeviveAccessPointIDV_template::log_match(const EnhancedNetworkSeviveAccessPointIDV& 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_enhancedNetworkSeviveAccessPointIDValue.match(match_value.enhancedNetworkSeviveAccessPointIDValue(), legacy)){
TTCN_Logger::log_logmatch_info(".enhancedNetworkSeviveAccessPointIDValue");
single_value->field_enhancedNetworkSeviveAccessPointIDValue.log_match(match_value.enhancedNetworkSeviveAccessPointIDValue(), 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("{ enhancedNetworkSeviveAccessPointIDValue := ");
single_value->field_enhancedNetworkSeviveAccessPointIDValue.log_match(match_value.enhancedNetworkSeviveAccessPointIDValue(), 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 EnhancedNetworkSeviveAccessPointIDV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (enhancedNetworkSeviveAccessPointIDValue().is_bound()) enhancedNetworkSeviveAccessPointIDValue().set_implicit_omit();
}

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

void EnhancedNetworkSeviveAccessPointIDV_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_enhancedNetworkSeviveAccessPointIDValue.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 EnhancedNetworkSeviveAccessPointIDV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV.");
}
}

void EnhancedNetworkSeviveAccessPointIDV_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: {
    EnhancedNetworkSeviveAccessPointIDV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) enhancedNetworkSeviveAccessPointIDValue().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "enhancedNetworkSeviveAccessPointIDValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enhancedNetworkSeviveAccessPointIDValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    EnhancedNetworkSeviveAccessPointIDV_template* precondition = new EnhancedNetworkSeviveAccessPointIDV_template;
    precondition->set_param(*param.get_elem(0));
    EnhancedNetworkSeviveAccessPointIDV_template* implied_template = new EnhancedNetworkSeviveAccessPointIDV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = EnhancedNetworkSeviveAccessPointIDV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV");
  }
  is_ifpresent = param.get_ifpresent();
}

void EnhancedNetworkSeviveAccessPointIDV_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_enhancedNetworkSeviveAccessPointIDValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedNetworkSeviveAccessPointIDV");
}

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

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

RequestTypeTV::RequestTypeTV()
{
}

RequestTypeTV::RequestTypeTV(const BITSTRING& par_requestTypeV,
    const BITSTRING& par_spare,
    const BITSTRING& par_elementIdentifier)
  :   field_requestTypeV(par_requestTypeV),
  field_spare(par_spare),
  field_elementIdentifier(par_elementIdentifier)
{
}

RequestTypeTV::RequestTypeTV(const RequestTypeTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RequestTypeTV.");
if (other_value.requestTypeV().is_bound()) field_requestTypeV = other_value.requestTypeV();
else field_requestTypeV.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void RequestTypeTV::clean_up()
{
field_requestTypeV.clean_up();
field_spare.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* RequestTypeTV::get_descriptor() const { return &RequestTypeTV_descr_; }
RequestTypeTV& RequestTypeTV::operator=(const RequestTypeTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RequestTypeTV.");
  if (other_value.requestTypeV().is_bound()) field_requestTypeV = other_value.requestTypeV();
  else field_requestTypeV.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean RequestTypeTV::operator==(const RequestTypeTV& other_value) const
{
return field_requestTypeV==other_value.field_requestTypeV
  && field_spare==other_value.field_spare
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean RequestTypeTV::is_bound() const
{
return (field_requestTypeV.is_bound())
  || (field_spare.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean RequestTypeTV::is_value() const
{
return field_requestTypeV.is_value()
  && field_spare.is_value()
  && field_elementIdentifier.is_value();
}
void RequestTypeTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ requestTypeV := ");
field_requestTypeV.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void RequestTypeTV::set_implicit_omit()
{
if (requestTypeV().is_bound()) requestTypeV().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RequestTypeTV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RequestTypeTV 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) requestTypeV().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "requestTypeV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestTypeV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RequestTypeTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RequestTypeTV");
  }
}

void RequestTypeTV::encode_text(Text_Buf& text_buf) const
{
field_requestTypeV.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void RequestTypeTV::decode_text(Text_Buf& text_buf)
{
field_requestTypeV.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

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

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

int RequestTypeTV::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, RequestTypeV_descr_.raw->forceomit);
  decoded_field_length = field_requestTypeV.RAW_decode(RequestTypeV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  bs_11) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RequestTypeTV::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, RequestTypeV_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  encoded_length += field_requestTypeV.RAW_encode(RequestTypeV_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  bs_11) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_11.RAW_encode(General__Types::BIT4_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 RequestTypeTV_template::single_value_struct {
BITSTRING_template field_requestTypeV;
BITSTRING_template field_spare;
BITSTRING_template field_elementIdentifier;
};

void RequestTypeTV_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_requestTypeV = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void RequestTypeTV_template::copy_value(const RequestTypeTV& other_value)
{
single_value = new single_value_struct;
if (other_value.requestTypeV().is_bound()) {
  single_value->field_requestTypeV = other_value.requestTypeV();
} else {
  single_value->field_requestTypeV.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RequestTypeTV_template::copy_template(const RequestTypeTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.requestTypeV().get_selection()) {
single_value->field_requestTypeV = other_value.requestTypeV();
} else {
single_value->field_requestTypeV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 RequestTypeTV_template[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 RequestTypeTV_template(*other_value.implication_.precondition);
implication_.implied_template = new RequestTypeTV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RequestTypeTV.");
break;
}
set_selection(other_value);
}

RequestTypeTV_template::RequestTypeTV_template()
{
}

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

RequestTypeTV_template::RequestTypeTV_template(const RequestTypeTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

RequestTypeTV RequestTypeTV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.RequestTypeTV.");
RequestTypeTV ret_val;
if (single_value->field_requestTypeV.is_bound()) {
ret_val.requestTypeV() = single_value->field_requestTypeV.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RequestTypeTV_template::requestTypeV()
{
set_specific();
return single_value->field_requestTypeV;
}

const BITSTRING_template& RequestTypeTV_template::requestTypeV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestTypeV of a non-specific template of type @MobileL3_GMM_SM_Types.RequestTypeTV.");
return single_value->field_requestTypeV;
}

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

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

BITSTRING_template& RequestTypeTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

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

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

void RequestTypeTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ requestTypeV := ");
single_value->field_requestTypeV.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 RequestTypeTV_template::log_match(const RequestTypeTV& 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_requestTypeV.match(match_value.requestTypeV(), legacy)){
TTCN_Logger::log_logmatch_info(".requestTypeV");
single_value->field_requestTypeV.log_match(match_value.requestTypeV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ requestTypeV := ");
single_value->field_requestTypeV.log_match(match_value.requestTypeV(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 RequestTypeTV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (requestTypeV().is_bound()) requestTypeV().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void RequestTypeTV_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_requestTypeV.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_elementIdentifier.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 RequestTypeTV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.RequestTypeTV.");
}
}

void RequestTypeTV_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: {
    RequestTypeTV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RequestTypeTV 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) requestTypeV().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "requestTypeV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestTypeV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RequestTypeTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RequestTypeTV_template* precondition = new RequestTypeTV_template;
    precondition->set_param(*param.get_elem(0));
    RequestTypeTV_template* implied_template = new RequestTypeTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RequestTypeTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RequestTypeTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RequestTypeTV_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_requestTypeV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestTypeTV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestTypeTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestTypeTV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestTypeTV");
}

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

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

NotificationIndicatorLV::NotificationIndicatorLV()
{
}

NotificationIndicatorLV::NotificationIndicatorLV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_valueField)
  :   field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

NotificationIndicatorLV::NotificationIndicatorLV(const NotificationIndicatorLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NotificationIndicatorLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void NotificationIndicatorLV::clean_up()
{
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* NotificationIndicatorLV::get_descriptor() const { return &NotificationIndicatorLV_descr_; }
NotificationIndicatorLV& NotificationIndicatorLV::operator=(const NotificationIndicatorLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NotificationIndicatorLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

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

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

void NotificationIndicatorLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

void NotificationIndicatorLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void NotificationIndicatorLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

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

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

int NotificationIndicatorLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, NotificationIndicatorLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NotificationIndicatorLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(NotificationIndicatorLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), 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());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NotificationIndicatorLV::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, NotificationIndicatorLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT1_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &NotificationIndicatorLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_valueField.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct NotificationIndicatorLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valueField;
};

void NotificationIndicatorLV_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_lengthIndicator = ANY_VALUE;
single_value->field_valueField = ANY_VALUE;
}
}
}

void NotificationIndicatorLV_template::copy_value(const NotificationIndicatorLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NotificationIndicatorLV_template::copy_template(const NotificationIndicatorLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NotificationIndicatorLV_template[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 NotificationIndicatorLV_template(*other_value.implication_.precondition);
implication_.implied_template = new NotificationIndicatorLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NotificationIndicatorLV.");
break;
}
set_selection(other_value);
}

NotificationIndicatorLV_template::NotificationIndicatorLV_template()
{
}

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

NotificationIndicatorLV_template::NotificationIndicatorLV_template(const NotificationIndicatorLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

NotificationIndicatorLV NotificationIndicatorLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.NotificationIndicatorLV.");
NotificationIndicatorLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

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

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

INTEGER_template& NotificationIndicatorLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& NotificationIndicatorLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.NotificationIndicatorLV.");
return single_value->field_lengthIndicator;
}

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

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

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

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

void NotificationIndicatorLV_template::log_match(const NotificationIndicatorLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void NotificationIndicatorLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

void NotificationIndicatorLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NotificationIndicatorLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.NotificationIndicatorLV.");
}
}

void NotificationIndicatorLV_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: {
    NotificationIndicatorLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.NotificationIndicatorLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) valueField().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NotificationIndicatorLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NotificationIndicatorLV_template* precondition = new NotificationIndicatorLV_template;
    precondition->set_param(*param.get_elem(0));
    NotificationIndicatorLV_template* implied_template = new NotificationIndicatorLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NotificationIndicatorLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NotificationIndicatorLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NotificationIndicatorLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NotificationIndicatorLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NotificationIndicatorLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NotificationIndicatorLV");
}

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

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

ConnectivityTypeTV::ConnectivityTypeTV()
{
}

ConnectivityTypeTV::ConnectivityTypeTV(const BITSTRING& par_connectivityTypeValue,
    const BITSTRING& par_elementIdentifier)
  :   field_connectivityTypeValue(par_connectivityTypeValue),
  field_elementIdentifier(par_elementIdentifier)
{
}

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

void ConnectivityTypeTV::clean_up()
{
field_connectivityTypeValue.clean_up();
field_elementIdentifier.clean_up();
}

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

boolean ConnectivityTypeTV::operator==(const ConnectivityTypeTV& other_value) const
{
return field_connectivityTypeValue==other_value.field_connectivityTypeValue
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean ConnectivityTypeTV::is_bound() const
{
return (field_connectivityTypeValue.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean ConnectivityTypeTV::is_value() const
{
return field_connectivityTypeValue.is_value()
  && field_elementIdentifier.is_value();
}
void ConnectivityTypeTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ connectivityTypeValue := ");
field_connectivityTypeValue.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void ConnectivityTypeTV::set_implicit_omit()
{
if (connectivityTypeValue().is_bound()) connectivityTypeValue().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void ConnectivityTypeTV::encode_text(Text_Buf& text_buf) const
{
field_connectivityTypeValue.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void ConnectivityTypeTV::decode_text(Text_Buf& text_buf)
{
field_connectivityTypeValue.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

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

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

int ConnectivityTypeTV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_connectivityTypeValue.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  bs_12) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ConnectivityTypeTV::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::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_connectivityTypeValue.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  bs_12) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_12.RAW_encode(General__Types::BIT4_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 ConnectivityTypeTV_template::single_value_struct {
BITSTRING_template field_connectivityTypeValue;
BITSTRING_template field_elementIdentifier;
};

void ConnectivityTypeTV_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_connectivityTypeValue = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void ConnectivityTypeTV_template::copy_value(const ConnectivityTypeTV& other_value)
{
single_value = new single_value_struct;
if (other_value.connectivityTypeValue().is_bound()) {
  single_value->field_connectivityTypeValue = other_value.connectivityTypeValue();
} else {
  single_value->field_connectivityTypeValue.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ConnectivityTypeTV_template::copy_template(const ConnectivityTypeTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.connectivityTypeValue().get_selection()) {
single_value->field_connectivityTypeValue = other_value.connectivityTypeValue();
} else {
single_value->field_connectivityTypeValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 ConnectivityTypeTV_template[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 ConnectivityTypeTV_template(*other_value.implication_.precondition);
implication_.implied_template = new ConnectivityTypeTV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ConnectivityTypeTV.");
break;
}
set_selection(other_value);
}

ConnectivityTypeTV_template::ConnectivityTypeTV_template()
{
}

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

ConnectivityTypeTV_template::ConnectivityTypeTV_template(const ConnectivityTypeTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ConnectivityTypeTV_template::match(const ConnectivityTypeTV& 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.connectivityTypeValue().is_bound()) return FALSE;
if(!single_value->field_connectivityTypeValue.match(other_value.connectivityTypeValue(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ConnectivityTypeTV.");
}
return FALSE;
}

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

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

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

ConnectivityTypeTV ConnectivityTypeTV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.ConnectivityTypeTV.");
ConnectivityTypeTV ret_val;
if (single_value->field_connectivityTypeValue.is_bound()) {
ret_val.connectivityTypeValue() = single_value->field_connectivityTypeValue.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& ConnectivityTypeTV_template::connectivityTypeValue()
{
set_specific();
return single_value->field_connectivityTypeValue;
}

const BITSTRING_template& ConnectivityTypeTV_template::connectivityTypeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field connectivityTypeValue of a non-specific template of type @MobileL3_GMM_SM_Types.ConnectivityTypeTV.");
return single_value->field_connectivityTypeValue;
}

BITSTRING_template& ConnectivityTypeTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

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

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

void ConnectivityTypeTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ connectivityTypeValue := ");
single_value->field_connectivityTypeValue.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 ConnectivityTypeTV_template::log_match(const ConnectivityTypeTV& 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_connectivityTypeValue.match(match_value.connectivityTypeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".connectivityTypeValue");
single_value->field_connectivityTypeValue.log_match(match_value.connectivityTypeValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ connectivityTypeValue := ");
single_value->field_connectivityTypeValue.log_match(match_value.connectivityTypeValue(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 ConnectivityTypeTV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (connectivityTypeValue().is_bound()) connectivityTypeValue().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void ConnectivityTypeTV_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_connectivityTypeValue.decode_text(text_buf);
single_value->field_elementIdentifier.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 ConnectivityTypeTV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.ConnectivityTypeTV.");
}
}

void ConnectivityTypeTV_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: {
    ConnectivityTypeTV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.ConnectivityTypeTV 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) connectivityTypeValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "connectivityTypeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectivityTypeValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.ConnectivityTypeTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ConnectivityTypeTV_template* precondition = new ConnectivityTypeTV_template;
    precondition->set_param(*param.get_elem(0));
    ConnectivityTypeTV_template* implied_template = new ConnectivityTypeTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ConnectivityTypeTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ConnectivityTypeTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ConnectivityTypeTV_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_connectivityTypeValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ConnectivityTypeTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ConnectivityTypeTV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.ConnectivityTypeTV");
}

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

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

WLANOffloadAcceptabilityTV::WLANOffloadAcceptabilityTV()
{
}

WLANOffloadAcceptabilityTV::WLANOffloadAcceptabilityTV(const BITSTRING& par_eUTRANOffloadAcceptabilityValue,
    const BITSTRING& par_uTRANOffloadAcceptabilityValue,
    const BITSTRING& par_spare,
    const BITSTRING& par_elementIdentifier)
  :   field_eUTRANOffloadAcceptabilityValue(par_eUTRANOffloadAcceptabilityValue),
  field_uTRANOffloadAcceptabilityValue(par_uTRANOffloadAcceptabilityValue),
  field_spare(par_spare),
  field_elementIdentifier(par_elementIdentifier)
{
}

WLANOffloadAcceptabilityTV::WLANOffloadAcceptabilityTV(const WLANOffloadAcceptabilityTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV.");
if (other_value.eUTRANOffloadAcceptabilityValue().is_bound()) field_eUTRANOffloadAcceptabilityValue = other_value.eUTRANOffloadAcceptabilityValue();
else field_eUTRANOffloadAcceptabilityValue.clean_up();
if (other_value.uTRANOffloadAcceptabilityValue().is_bound()) field_uTRANOffloadAcceptabilityValue = other_value.uTRANOffloadAcceptabilityValue();
else field_uTRANOffloadAcceptabilityValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void WLANOffloadAcceptabilityTV::clean_up()
{
field_eUTRANOffloadAcceptabilityValue.clean_up();
field_uTRANOffloadAcceptabilityValue.clean_up();
field_spare.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* WLANOffloadAcceptabilityTV::get_descriptor() const { return &WLANOffloadAcceptabilityTV_descr_; }
WLANOffloadAcceptabilityTV& WLANOffloadAcceptabilityTV::operator=(const WLANOffloadAcceptabilityTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV.");
  if (other_value.eUTRANOffloadAcceptabilityValue().is_bound()) field_eUTRANOffloadAcceptabilityValue = other_value.eUTRANOffloadAcceptabilityValue();
  else field_eUTRANOffloadAcceptabilityValue.clean_up();
  if (other_value.uTRANOffloadAcceptabilityValue().is_bound()) field_uTRANOffloadAcceptabilityValue = other_value.uTRANOffloadAcceptabilityValue();
  else field_uTRANOffloadAcceptabilityValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean WLANOffloadAcceptabilityTV::operator==(const WLANOffloadAcceptabilityTV& other_value) const
{
return field_eUTRANOffloadAcceptabilityValue==other_value.field_eUTRANOffloadAcceptabilityValue
  && field_uTRANOffloadAcceptabilityValue==other_value.field_uTRANOffloadAcceptabilityValue
  && field_spare==other_value.field_spare
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean WLANOffloadAcceptabilityTV::is_bound() const
{
return (field_eUTRANOffloadAcceptabilityValue.is_bound())
  || (field_uTRANOffloadAcceptabilityValue.is_bound())
  || (field_spare.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean WLANOffloadAcceptabilityTV::is_value() const
{
return field_eUTRANOffloadAcceptabilityValue.is_value()
  && field_uTRANOffloadAcceptabilityValue.is_value()
  && field_spare.is_value()
  && field_elementIdentifier.is_value();
}
void WLANOffloadAcceptabilityTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ eUTRANOffloadAcceptabilityValue := ");
field_eUTRANOffloadAcceptabilityValue.log();
TTCN_Logger::log_event_str(", uTRANOffloadAcceptabilityValue := ");
field_uTRANOffloadAcceptabilityValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void WLANOffloadAcceptabilityTV::set_implicit_omit()
{
if (eUTRANOffloadAcceptabilityValue().is_bound()) eUTRANOffloadAcceptabilityValue().set_implicit_omit();
if (uTRANOffloadAcceptabilityValue().is_bound()) uTRANOffloadAcceptabilityValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void WLANOffloadAcceptabilityTV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV 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) eUTRANOffloadAcceptabilityValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uTRANOffloadAcceptabilityValue().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "eUTRANOffloadAcceptabilityValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANOffloadAcceptabilityValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uTRANOffloadAcceptabilityValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRANOffloadAcceptabilityValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV");
  }
}

void WLANOffloadAcceptabilityTV::encode_text(Text_Buf& text_buf) const
{
field_eUTRANOffloadAcceptabilityValue.encode_text(text_buf);
field_uTRANOffloadAcceptabilityValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void WLANOffloadAcceptabilityTV::decode_text(Text_Buf& text_buf)
{
field_eUTRANOffloadAcceptabilityValue.decode_text(text_buf);
field_uTRANOffloadAcceptabilityValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

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

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

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

int WLANOffloadAcceptabilityTV::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  encoded_length += field_eUTRANOffloadAcceptabilityValue.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_uTRANOffloadAcceptabilityValue.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  if (field_elementIdentifier !=  bs_21) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={3};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.RAW_encode(General__Types::BIT4_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 WLANOffloadAcceptabilityTV_template::single_value_struct {
BITSTRING_template field_eUTRANOffloadAcceptabilityValue;
BITSTRING_template field_uTRANOffloadAcceptabilityValue;
BITSTRING_template field_spare;
BITSTRING_template field_elementIdentifier;
};

void WLANOffloadAcceptabilityTV_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_eUTRANOffloadAcceptabilityValue = ANY_VALUE;
single_value->field_uTRANOffloadAcceptabilityValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void WLANOffloadAcceptabilityTV_template::copy_value(const WLANOffloadAcceptabilityTV& other_value)
{
single_value = new single_value_struct;
if (other_value.eUTRANOffloadAcceptabilityValue().is_bound()) {
  single_value->field_eUTRANOffloadAcceptabilityValue = other_value.eUTRANOffloadAcceptabilityValue();
} else {
  single_value->field_eUTRANOffloadAcceptabilityValue.clean_up();
}
if (other_value.uTRANOffloadAcceptabilityValue().is_bound()) {
  single_value->field_uTRANOffloadAcceptabilityValue = other_value.uTRANOffloadAcceptabilityValue();
} else {
  single_value->field_uTRANOffloadAcceptabilityValue.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void WLANOffloadAcceptabilityTV_template::copy_template(const WLANOffloadAcceptabilityTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.eUTRANOffloadAcceptabilityValue().get_selection()) {
single_value->field_eUTRANOffloadAcceptabilityValue = other_value.eUTRANOffloadAcceptabilityValue();
} else {
single_value->field_eUTRANOffloadAcceptabilityValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uTRANOffloadAcceptabilityValue().get_selection()) {
single_value->field_uTRANOffloadAcceptabilityValue = other_value.uTRANOffloadAcceptabilityValue();
} else {
single_value->field_uTRANOffloadAcceptabilityValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 WLANOffloadAcceptabilityTV_template[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 WLANOffloadAcceptabilityTV_template(*other_value.implication_.precondition);
implication_.implied_template = new WLANOffloadAcceptabilityTV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV.");
break;
}
set_selection(other_value);
}

WLANOffloadAcceptabilityTV_template::WLANOffloadAcceptabilityTV_template()
{
}

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

WLANOffloadAcceptabilityTV_template::WLANOffloadAcceptabilityTV_template(const WLANOffloadAcceptabilityTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean WLANOffloadAcceptabilityTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_eUTRANOffloadAcceptabilityValue.is_bound()
 || single_value->field_uTRANOffloadAcceptabilityValue.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

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

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

WLANOffloadAcceptabilityTV WLANOffloadAcceptabilityTV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV.");
WLANOffloadAcceptabilityTV ret_val;
if (single_value->field_eUTRANOffloadAcceptabilityValue.is_bound()) {
ret_val.eUTRANOffloadAcceptabilityValue() = single_value->field_eUTRANOffloadAcceptabilityValue.valueof();
}
if (single_value->field_uTRANOffloadAcceptabilityValue.is_bound()) {
ret_val.uTRANOffloadAcceptabilityValue() = single_value->field_uTRANOffloadAcceptabilityValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& WLANOffloadAcceptabilityTV_template::eUTRANOffloadAcceptabilityValue()
{
set_specific();
return single_value->field_eUTRANOffloadAcceptabilityValue;
}

const BITSTRING_template& WLANOffloadAcceptabilityTV_template::eUTRANOffloadAcceptabilityValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRANOffloadAcceptabilityValue of a non-specific template of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV.");
return single_value->field_eUTRANOffloadAcceptabilityValue;
}

BITSTRING_template& WLANOffloadAcceptabilityTV_template::uTRANOffloadAcceptabilityValue()
{
set_specific();
return single_value->field_uTRANOffloadAcceptabilityValue;
}

const BITSTRING_template& WLANOffloadAcceptabilityTV_template::uTRANOffloadAcceptabilityValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRANOffloadAcceptabilityValue of a non-specific template of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV.");
return single_value->field_uTRANOffloadAcceptabilityValue;
}

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

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

BITSTRING_template& WLANOffloadAcceptabilityTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

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

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

void WLANOffloadAcceptabilityTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ eUTRANOffloadAcceptabilityValue := ");
single_value->field_eUTRANOffloadAcceptabilityValue.log();
TTCN_Logger::log_event_str(", uTRANOffloadAcceptabilityValue := ");
single_value->field_uTRANOffloadAcceptabilityValue.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 WLANOffloadAcceptabilityTV_template::log_match(const WLANOffloadAcceptabilityTV& 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_eUTRANOffloadAcceptabilityValue.match(match_value.eUTRANOffloadAcceptabilityValue(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRANOffloadAcceptabilityValue");
single_value->field_eUTRANOffloadAcceptabilityValue.log_match(match_value.eUTRANOffloadAcceptabilityValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uTRANOffloadAcceptabilityValue.match(match_value.uTRANOffloadAcceptabilityValue(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRANOffloadAcceptabilityValue");
single_value->field_uTRANOffloadAcceptabilityValue.log_match(match_value.uTRANOffloadAcceptabilityValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ eUTRANOffloadAcceptabilityValue := ");
single_value->field_eUTRANOffloadAcceptabilityValue.log_match(match_value.eUTRANOffloadAcceptabilityValue(), legacy);
TTCN_Logger::log_event_str(", uTRANOffloadAcceptabilityValue := ");
single_value->field_uTRANOffloadAcceptabilityValue.log_match(match_value.uTRANOffloadAcceptabilityValue(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 WLANOffloadAcceptabilityTV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (eUTRANOffloadAcceptabilityValue().is_bound()) eUTRANOffloadAcceptabilityValue().set_implicit_omit();
if (uTRANOffloadAcceptabilityValue().is_bound()) uTRANOffloadAcceptabilityValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void WLANOffloadAcceptabilityTV_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_eUTRANOffloadAcceptabilityValue.decode_text(text_buf);
single_value->field_uTRANOffloadAcceptabilityValue.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_elementIdentifier.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 WLANOffloadAcceptabilityTV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV.");
}
}

void WLANOffloadAcceptabilityTV_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: {
    WLANOffloadAcceptabilityTV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV 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) eUTRANOffloadAcceptabilityValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uTRANOffloadAcceptabilityValue().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "eUTRANOffloadAcceptabilityValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANOffloadAcceptabilityValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uTRANOffloadAcceptabilityValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRANOffloadAcceptabilityValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    WLANOffloadAcceptabilityTV_template* precondition = new WLANOffloadAcceptabilityTV_template;
    precondition->set_param(*param.get_elem(0));
    WLANOffloadAcceptabilityTV_template* implied_template = new WLANOffloadAcceptabilityTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = WLANOffloadAcceptabilityTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void WLANOffloadAcceptabilityTV_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_eUTRANOffloadAcceptabilityValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV");
single_value->field_uTRANOffloadAcceptabilityValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.WLANOffloadAcceptabilityTV");
}

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

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


const NBIFOM__Parameter NBIFOM__ParameterList::UNBOUND_ELEM;
NBIFOM__ParameterList::NBIFOM__ParameterList()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void NBIFOM__ParameterList_template::copy_template(const NBIFOM__ParameterList_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (NBIFOM__Parameter_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new NBIFOM__Parameter_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new NBIFOM__Parameter_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NBIFOM__ParameterList_template[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 NBIFOM__ParameterList_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__ParameterList_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterList.");
break;
}
set_selection(other_value);
}

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

NBIFOM__ParameterList_template::NBIFOM__ParameterList_template()
{
}

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

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

NBIFOM__ParameterList_template::NBIFOM__ParameterList_template(const NBIFOM__ParameterList& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void NBIFOM__ParameterList_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

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

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

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

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

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

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

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

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

boolean NBIFOM__ParameterList_template::match(const NBIFOM__ParameterList& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterList.");
}
return FALSE;
}

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

NBIFOM__ParameterList NBIFOM__ParameterList_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterList.");
NBIFOM__ParameterList ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

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

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

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

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

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

void NBIFOM__ParameterList_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void NBIFOM__ParameterList_template::log_match(const NBIFOM__ParameterList& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void NBIFOM__ParameterList_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterList.");
single_value.value_elements = (NBIFOM__Parameter_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new NBIFOM__Parameter_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NBIFOM__ParameterList_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterList.");
}
}

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

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

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

void NBIFOM__ParameterList_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    NBIFOM__ParameterList_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NBIFOM__ParameterList_template* precondition = new NBIFOM__ParameterList_template;
    precondition->set_param(*param.get_elem(0));
    NBIFOM__ParameterList_template* implied_template = new NBIFOM__ParameterList_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NBIFOM__ParameterList_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@MobileL3_GMM_SM_Types.NBIFOM_ParameterList");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void NBIFOM__ParameterList_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterList");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterList");
}

boolean NBIFOM__ParameterList_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
void NBIFOM__ParameterContents::copy_value(const NBIFOM__ParameterContents& other_value)
{
switch (other_value.union_selection) {
case ALT_nBIFOM__Mode:
field_nBIFOM__Mode = new OCTETSTRING(*other_value.field_nBIFOM__Mode);
break;
case ALT_nBIFOM__DefaultAccess:
field_nBIFOM__DefaultAccess = new OCTETSTRING(*other_value.field_nBIFOM__DefaultAccess);
break;
case ALT_nBIFOM__Status:
field_nBIFOM__Status = new OCTETSTRING(*other_value.field_nBIFOM__Status);
break;
case ALT_nBIFOM__RoutingRules:
field_nBIFOM__RoutingRules = new NBIFOM__RoutingRules(*other_value.field_nBIFOM__RoutingRules);
break;
case ALT_nBIFOM__IPFlowMapping:
field_nBIFOM__IPFlowMapping = new NBIFOM__RoutingRules(*other_value.field_nBIFOM__IPFlowMapping);
break;
case ALT_nBIFOM__RANRulesHandling:
field_nBIFOM__RANRulesHandling = new OCTETSTRING(*other_value.field_nBIFOM__RANRulesHandling);
break;
case ALT_nBIFOM__RANRulesStatus:
field_nBIFOM__RANRulesStatus = new OCTETSTRING(*other_value.field_nBIFOM__RANRulesStatus);
break;
case ALT_nBIFOM__AccessUsabilityIndication:
field_nBIFOM__AccessUsabilityIndication = new NBIFOM__AccessUsabilityIndication(*other_value.field_nBIFOM__AccessUsabilityIndication);
break;
case ALT_unknownParameter:
field_unknownParameter = new OCTETSTRING(*other_value.field_unknownParameter);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean NBIFOM__ParameterContents::operator==(const NBIFOM__ParameterContents& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_nBIFOM__Mode:
return *field_nBIFOM__Mode == *other_value.field_nBIFOM__Mode;
case ALT_nBIFOM__DefaultAccess:
return *field_nBIFOM__DefaultAccess == *other_value.field_nBIFOM__DefaultAccess;
case ALT_nBIFOM__Status:
return *field_nBIFOM__Status == *other_value.field_nBIFOM__Status;
case ALT_nBIFOM__RoutingRules:
return *field_nBIFOM__RoutingRules == *other_value.field_nBIFOM__RoutingRules;
case ALT_nBIFOM__IPFlowMapping:
return *field_nBIFOM__IPFlowMapping == *other_value.field_nBIFOM__IPFlowMapping;
case ALT_nBIFOM__RANRulesHandling:
return *field_nBIFOM__RANRulesHandling == *other_value.field_nBIFOM__RANRulesHandling;
case ALT_nBIFOM__RANRulesStatus:
return *field_nBIFOM__RANRulesStatus == *other_value.field_nBIFOM__RANRulesStatus;
case ALT_nBIFOM__AccessUsabilityIndication:
return *field_nBIFOM__AccessUsabilityIndication == *other_value.field_nBIFOM__AccessUsabilityIndication;
case ALT_unknownParameter:
return *field_unknownParameter == *other_value.field_unknownParameter;
default:
return FALSE;
}
}

OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__Mode()
{
if (union_selection != ALT_nBIFOM__Mode) {
clean_up();
field_nBIFOM__Mode = new OCTETSTRING;
union_selection = ALT_nBIFOM__Mode;
}
return *field_nBIFOM__Mode;
}

const OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__Mode() const
{
if (union_selection != ALT_nBIFOM__Mode) TTCN_error("Using non-selected field nBIFOM_Mode in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__Mode;
}

OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__DefaultAccess()
{
if (union_selection != ALT_nBIFOM__DefaultAccess) {
clean_up();
field_nBIFOM__DefaultAccess = new OCTETSTRING;
union_selection = ALT_nBIFOM__DefaultAccess;
}
return *field_nBIFOM__DefaultAccess;
}

const OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__DefaultAccess() const
{
if (union_selection != ALT_nBIFOM__DefaultAccess) TTCN_error("Using non-selected field nBIFOM_DefaultAccess in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__DefaultAccess;
}

OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__Status()
{
if (union_selection != ALT_nBIFOM__Status) {
clean_up();
field_nBIFOM__Status = new OCTETSTRING;
union_selection = ALT_nBIFOM__Status;
}
return *field_nBIFOM__Status;
}

const OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__Status() const
{
if (union_selection != ALT_nBIFOM__Status) TTCN_error("Using non-selected field nBIFOM_Status in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__Status;
}

NBIFOM__RoutingRules& NBIFOM__ParameterContents::nBIFOM__RoutingRules()
{
if (union_selection != ALT_nBIFOM__RoutingRules) {
clean_up();
field_nBIFOM__RoutingRules = new NBIFOM__RoutingRules;
union_selection = ALT_nBIFOM__RoutingRules;
}
return *field_nBIFOM__RoutingRules;
}

const NBIFOM__RoutingRules& NBIFOM__ParameterContents::nBIFOM__RoutingRules() const
{
if (union_selection != ALT_nBIFOM__RoutingRules) TTCN_error("Using non-selected field nBIFOM_RoutingRules in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__RoutingRules;
}

NBIFOM__RoutingRules& NBIFOM__ParameterContents::nBIFOM__IPFlowMapping()
{
if (union_selection != ALT_nBIFOM__IPFlowMapping) {
clean_up();
field_nBIFOM__IPFlowMapping = new NBIFOM__RoutingRules;
union_selection = ALT_nBIFOM__IPFlowMapping;
}
return *field_nBIFOM__IPFlowMapping;
}

const NBIFOM__RoutingRules& NBIFOM__ParameterContents::nBIFOM__IPFlowMapping() const
{
if (union_selection != ALT_nBIFOM__IPFlowMapping) TTCN_error("Using non-selected field nBIFOM_IPFlowMapping in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__IPFlowMapping;
}

OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__RANRulesHandling()
{
if (union_selection != ALT_nBIFOM__RANRulesHandling) {
clean_up();
field_nBIFOM__RANRulesHandling = new OCTETSTRING;
union_selection = ALT_nBIFOM__RANRulesHandling;
}
return *field_nBIFOM__RANRulesHandling;
}

const OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__RANRulesHandling() const
{
if (union_selection != ALT_nBIFOM__RANRulesHandling) TTCN_error("Using non-selected field nBIFOM_RANRulesHandling in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__RANRulesHandling;
}

OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__RANRulesStatus()
{
if (union_selection != ALT_nBIFOM__RANRulesStatus) {
clean_up();
field_nBIFOM__RANRulesStatus = new OCTETSTRING;
union_selection = ALT_nBIFOM__RANRulesStatus;
}
return *field_nBIFOM__RANRulesStatus;
}

const OCTETSTRING& NBIFOM__ParameterContents::nBIFOM__RANRulesStatus() const
{
if (union_selection != ALT_nBIFOM__RANRulesStatus) TTCN_error("Using non-selected field nBIFOM_RANRulesStatus in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__RANRulesStatus;
}

NBIFOM__AccessUsabilityIndication& NBIFOM__ParameterContents::nBIFOM__AccessUsabilityIndication()
{
if (union_selection != ALT_nBIFOM__AccessUsabilityIndication) {
clean_up();
field_nBIFOM__AccessUsabilityIndication = new NBIFOM__AccessUsabilityIndication;
union_selection = ALT_nBIFOM__AccessUsabilityIndication;
}
return *field_nBIFOM__AccessUsabilityIndication;
}

const NBIFOM__AccessUsabilityIndication& NBIFOM__ParameterContents::nBIFOM__AccessUsabilityIndication() const
{
if (union_selection != ALT_nBIFOM__AccessUsabilityIndication) TTCN_error("Using non-selected field nBIFOM_AccessUsabilityIndication in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_nBIFOM__AccessUsabilityIndication;
}

OCTETSTRING& NBIFOM__ParameterContents::unknownParameter()
{
if (union_selection != ALT_unknownParameter) {
clean_up();
field_unknownParameter = new OCTETSTRING;
union_selection = ALT_unknownParameter;
}
return *field_unknownParameter;
}

const OCTETSTRING& NBIFOM__ParameterContents::unknownParameter() const
{
if (union_selection != ALT_unknownParameter) TTCN_error("Using non-selected field unknownParameter in a value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *field_unknownParameter;
}

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

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

boolean NBIFOM__ParameterContents::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_nBIFOM__Mode: return field_nBIFOM__Mode->is_value();
case ALT_nBIFOM__DefaultAccess: return field_nBIFOM__DefaultAccess->is_value();
case ALT_nBIFOM__Status: return field_nBIFOM__Status->is_value();
case ALT_nBIFOM__RoutingRules: return field_nBIFOM__RoutingRules->is_value();
case ALT_nBIFOM__IPFlowMapping: return field_nBIFOM__IPFlowMapping->is_value();
case ALT_nBIFOM__RANRulesHandling: return field_nBIFOM__RANRulesHandling->is_value();
case ALT_nBIFOM__RANRulesStatus: return field_nBIFOM__RANRulesStatus->is_value();
case ALT_nBIFOM__AccessUsabilityIndication: return field_nBIFOM__AccessUsabilityIndication->is_value();
case ALT_unknownParameter: return field_unknownParameter->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void NBIFOM__ParameterContents::clean_up()
{
switch (union_selection) {
case ALT_nBIFOM__Mode:
  delete field_nBIFOM__Mode;
  break;
case ALT_nBIFOM__DefaultAccess:
  delete field_nBIFOM__DefaultAccess;
  break;
case ALT_nBIFOM__Status:
  delete field_nBIFOM__Status;
  break;
case ALT_nBIFOM__RoutingRules:
  delete field_nBIFOM__RoutingRules;
  break;
case ALT_nBIFOM__IPFlowMapping:
  delete field_nBIFOM__IPFlowMapping;
  break;
case ALT_nBIFOM__RANRulesHandling:
  delete field_nBIFOM__RANRulesHandling;
  break;
case ALT_nBIFOM__RANRulesStatus:
  delete field_nBIFOM__RANRulesStatus;
  break;
case ALT_nBIFOM__AccessUsabilityIndication:
  delete field_nBIFOM__AccessUsabilityIndication;
  break;
case ALT_unknownParameter:
  delete field_unknownParameter;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void NBIFOM__ParameterContents::log() const
{
switch (union_selection) {
case ALT_nBIFOM__Mode:
TTCN_Logger::log_event_str("{ nBIFOM_Mode := ");
field_nBIFOM__Mode->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_nBIFOM__DefaultAccess:
TTCN_Logger::log_event_str("{ nBIFOM_DefaultAccess := ");
field_nBIFOM__DefaultAccess->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_nBIFOM__Status:
TTCN_Logger::log_event_str("{ nBIFOM_Status := ");
field_nBIFOM__Status->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_nBIFOM__RoutingRules:
TTCN_Logger::log_event_str("{ nBIFOM_RoutingRules := ");
field_nBIFOM__RoutingRules->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_nBIFOM__IPFlowMapping:
TTCN_Logger::log_event_str("{ nBIFOM_IPFlowMapping := ");
field_nBIFOM__IPFlowMapping->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_nBIFOM__RANRulesHandling:
TTCN_Logger::log_event_str("{ nBIFOM_RANRulesHandling := ");
field_nBIFOM__RANRulesHandling->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_nBIFOM__RANRulesStatus:
TTCN_Logger::log_event_str("{ nBIFOM_RANRulesStatus := ");
field_nBIFOM__RANRulesStatus->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_nBIFOM__AccessUsabilityIndication:
TTCN_Logger::log_event_str("{ nBIFOM_AccessUsabilityIndication := ");
field_nBIFOM__AccessUsabilityIndication->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_unknownParameter:
TTCN_Logger::log_event_str("{ unknownParameter := ");
field_unknownParameter->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void NBIFOM__ParameterContents::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "nBIFOM_Mode")) {
    nBIFOM__Mode().set_param(*mp_last);
    if (!nBIFOM__Mode().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "nBIFOM_DefaultAccess")) {
    nBIFOM__DefaultAccess().set_param(*mp_last);
    if (!nBIFOM__DefaultAccess().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "nBIFOM_Status")) {
    nBIFOM__Status().set_param(*mp_last);
    if (!nBIFOM__Status().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "nBIFOM_RoutingRules")) {
    nBIFOM__RoutingRules().set_param(*mp_last);
    if (!nBIFOM__RoutingRules().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "nBIFOM_IPFlowMapping")) {
    nBIFOM__IPFlowMapping().set_param(*mp_last);
    if (!nBIFOM__IPFlowMapping().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "nBIFOM_RANRulesHandling")) {
    nBIFOM__RANRulesHandling().set_param(*mp_last);
    if (!nBIFOM__RANRulesHandling().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "nBIFOM_RANRulesStatus")) {
    nBIFOM__RANRulesStatus().set_param(*mp_last);
    if (!nBIFOM__RANRulesStatus().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "nBIFOM_AccessUsabilityIndication")) {
    nBIFOM__AccessUsabilityIndication().set_param(*mp_last);
    if (!nBIFOM__AccessUsabilityIndication().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "unknownParameter")) {
    unknownParameter().set_param(*mp_last);
    if (!unknownParameter().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.", last_name);
}

void NBIFOM__ParameterContents::set_implicit_omit()
{
switch (union_selection) {
case ALT_nBIFOM__Mode:
field_nBIFOM__Mode->set_implicit_omit(); break;
case ALT_nBIFOM__DefaultAccess:
field_nBIFOM__DefaultAccess->set_implicit_omit(); break;
case ALT_nBIFOM__Status:
field_nBIFOM__Status->set_implicit_omit(); break;
case ALT_nBIFOM__RoutingRules:
field_nBIFOM__RoutingRules->set_implicit_omit(); break;
case ALT_nBIFOM__IPFlowMapping:
field_nBIFOM__IPFlowMapping->set_implicit_omit(); break;
case ALT_nBIFOM__RANRulesHandling:
field_nBIFOM__RANRulesHandling->set_implicit_omit(); break;
case ALT_nBIFOM__RANRulesStatus:
field_nBIFOM__RANRulesStatus->set_implicit_omit(); break;
case ALT_nBIFOM__AccessUsabilityIndication:
field_nBIFOM__AccessUsabilityIndication->set_implicit_omit(); break;
case ALT_unknownParameter:
field_unknownParameter->set_implicit_omit(); break;
default: break;
}
}

void NBIFOM__ParameterContents::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_nBIFOM__Mode:
field_nBIFOM__Mode->encode_text(text_buf);
break;
case ALT_nBIFOM__DefaultAccess:
field_nBIFOM__DefaultAccess->encode_text(text_buf);
break;
case ALT_nBIFOM__Status:
field_nBIFOM__Status->encode_text(text_buf);
break;
case ALT_nBIFOM__RoutingRules:
field_nBIFOM__RoutingRules->encode_text(text_buf);
break;
case ALT_nBIFOM__IPFlowMapping:
field_nBIFOM__IPFlowMapping->encode_text(text_buf);
break;
case ALT_nBIFOM__RANRulesHandling:
field_nBIFOM__RANRulesHandling->encode_text(text_buf);
break;
case ALT_nBIFOM__RANRulesStatus:
field_nBIFOM__RANRulesStatus->encode_text(text_buf);
break;
case ALT_nBIFOM__AccessUsabilityIndication:
field_nBIFOM__AccessUsabilityIndication->encode_text(text_buf);
break;
case ALT_unknownParameter:
field_unknownParameter->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
}

void NBIFOM__ParameterContents::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_nBIFOM__Mode:
nBIFOM__Mode().decode_text(text_buf);
break;
case ALT_nBIFOM__DefaultAccess:
nBIFOM__DefaultAccess().decode_text(text_buf);
break;
case ALT_nBIFOM__Status:
nBIFOM__Status().decode_text(text_buf);
break;
case ALT_nBIFOM__RoutingRules:
nBIFOM__RoutingRules().decode_text(text_buf);
break;
case ALT_nBIFOM__IPFlowMapping:
nBIFOM__IPFlowMapping().decode_text(text_buf);
break;
case ALT_nBIFOM__RANRulesHandling:
nBIFOM__RANRulesHandling().decode_text(text_buf);
break;
case ALT_nBIFOM__RANRulesStatus:
nBIFOM__RANRulesStatus().decode_text(text_buf);
break;
case ALT_nBIFOM__AccessUsabilityIndication:
nBIFOM__AccessUsabilityIndication().decode_text(text_buf);
break;
case ALT_unknownParameter:
unknownParameter().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
}

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

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

int NBIFOM__ParameterContents::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__Mode().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__DefaultAccess().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__Status().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, NBIFOM__RoutingRules_descr_.raw->forceomit);
      decoded_length = nBIFOM__RoutingRules().RAW_decode(NBIFOM__RoutingRules_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, NBIFOM__RoutingRules_descr_.raw->forceomit);
      decoded_length = nBIFOM__IPFlowMapping().RAW_decode(NBIFOM__RoutingRules_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__RANRulesHandling().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__RANRulesStatus().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, NBIFOM__AccessUsabilityIndication_descr_.raw->forceomit);
      decoded_length = nBIFOM__AccessUsabilityIndication().RAW_decode(NBIFOM__AccessUsabilityIndication_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = unknownParameter().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__Mode().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__DefaultAccess().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__Status().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, NBIFOM__RoutingRules_descr_.raw->forceomit);
      decoded_length = nBIFOM__RoutingRules().RAW_decode(NBIFOM__RoutingRules_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_4_force_omit(4, force_omit, NBIFOM__RoutingRules_descr_.raw->forceomit);
      decoded_length = nBIFOM__IPFlowMapping().RAW_decode(NBIFOM__RoutingRules_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_4_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__RANRulesHandling().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_5_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = nBIFOM__RANRulesStatus().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_6_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_7_force_omit(7, force_omit, NBIFOM__AccessUsabilityIndication_descr_.raw->forceomit);
      decoded_length = nBIFOM__AccessUsabilityIndication().RAW_decode(NBIFOM__AccessUsabilityIndication_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_7_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_8_force_omit(8, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = unknownParameter().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_8_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int NBIFOM__ParameterContents::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  memset(myleaf.body.node.nodes, 0, 9 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_nBIFOM__Mode:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, General__Types::OCT1_descr_.raw);
    encoded_length = field_nBIFOM__Mode->RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &General__Types::OCT1_descr_;
    break;
  case ALT_nBIFOM__DefaultAccess:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, General__Types::OCT1_descr_.raw);
    encoded_length = field_nBIFOM__DefaultAccess->RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &General__Types::OCT1_descr_;
    break;
  case ALT_nBIFOM__Status:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, General__Types::OCT1_descr_.raw);
    encoded_length = field_nBIFOM__Status->RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &General__Types::OCT1_descr_;
    break;
  case ALT_nBIFOM__RoutingRules:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, NBIFOM__RoutingRules_descr_.raw);
    encoded_length = field_nBIFOM__RoutingRules->RAW_encode(NBIFOM__RoutingRules_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &NBIFOM__RoutingRules_descr_;
    break;
  case ALT_nBIFOM__IPFlowMapping:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, NBIFOM__RoutingRules_descr_.raw);
    encoded_length = field_nBIFOM__IPFlowMapping->RAW_encode(NBIFOM__RoutingRules_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &NBIFOM__RoutingRules_descr_;
    break;
  case ALT_nBIFOM__RANRulesHandling:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, General__Types::OCT1_descr_.raw);
    encoded_length = field_nBIFOM__RANRulesHandling->RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &General__Types::OCT1_descr_;
    break;
  case ALT_nBIFOM__RANRulesStatus:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, General__Types::OCT1_descr_.raw);
    encoded_length = field_nBIFOM__RANRulesStatus->RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &General__Types::OCT1_descr_;
    break;
  case ALT_nBIFOM__AccessUsabilityIndication:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, NBIFOM__AccessUsabilityIndication_descr_.raw);
    encoded_length = field_nBIFOM__AccessUsabilityIndication->RAW_encode(NBIFOM__AccessUsabilityIndication_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &NBIFOM__AccessUsabilityIndication_descr_;
    break;
  case ALT_unknownParameter:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, OCTETSTRING_descr_.raw);
    encoded_length = field_unknownParameter->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &OCTETSTRING_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void NBIFOM__ParameterContents_template::copy_value(const NBIFOM__ParameterContents& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
single_value.field_nBIFOM__Mode = new OCTETSTRING_template(other_value.nBIFOM__Mode());
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
single_value.field_nBIFOM__DefaultAccess = new OCTETSTRING_template(other_value.nBIFOM__DefaultAccess());
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
single_value.field_nBIFOM__Status = new OCTETSTRING_template(other_value.nBIFOM__Status());
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
single_value.field_nBIFOM__RoutingRules = new NBIFOM__RoutingRules_template(other_value.nBIFOM__RoutingRules());
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
single_value.field_nBIFOM__IPFlowMapping = new NBIFOM__RoutingRules_template(other_value.nBIFOM__IPFlowMapping());
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
single_value.field_nBIFOM__RANRulesHandling = new OCTETSTRING_template(other_value.nBIFOM__RANRulesHandling());
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
single_value.field_nBIFOM__RANRulesStatus = new OCTETSTRING_template(other_value.nBIFOM__RANRulesStatus());
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
single_value.field_nBIFOM__AccessUsabilityIndication = new NBIFOM__AccessUsabilityIndication_template(other_value.nBIFOM__AccessUsabilityIndication());
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
single_value.field_unknownParameter = new OCTETSTRING_template(other_value.unknownParameter());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
set_selection(SPECIFIC_VALUE);
}

void NBIFOM__ParameterContents_template::copy_template(const NBIFOM__ParameterContents_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
single_value.field_nBIFOM__Mode = new OCTETSTRING_template(*other_value.single_value.field_nBIFOM__Mode);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
single_value.field_nBIFOM__DefaultAccess = new OCTETSTRING_template(*other_value.single_value.field_nBIFOM__DefaultAccess);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
single_value.field_nBIFOM__Status = new OCTETSTRING_template(*other_value.single_value.field_nBIFOM__Status);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
single_value.field_nBIFOM__RoutingRules = new NBIFOM__RoutingRules_template(*other_value.single_value.field_nBIFOM__RoutingRules);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
single_value.field_nBIFOM__IPFlowMapping = new NBIFOM__RoutingRules_template(*other_value.single_value.field_nBIFOM__IPFlowMapping);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
single_value.field_nBIFOM__RANRulesHandling = new OCTETSTRING_template(*other_value.single_value.field_nBIFOM__RANRulesHandling);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
single_value.field_nBIFOM__RANRulesStatus = new OCTETSTRING_template(*other_value.single_value.field_nBIFOM__RANRulesStatus);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
single_value.field_nBIFOM__AccessUsabilityIndication = new NBIFOM__AccessUsabilityIndication_template(*other_value.single_value.field_nBIFOM__AccessUsabilityIndication);
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
single_value.field_unknownParameter = new OCTETSTRING_template(*other_value.single_value.field_unknownParameter);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
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 NBIFOM__ParameterContents_template[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 NBIFOM__ParameterContents_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__ParameterContents_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
set_selection(other_value);
}

NBIFOM__ParameterContents_template::NBIFOM__ParameterContents_template()
{
}

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

NBIFOM__ParameterContents_template::NBIFOM__ParameterContents_template(const NBIFOM__ParameterContents& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void NBIFOM__ParameterContents_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
delete single_value.field_nBIFOM__Mode;
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
delete single_value.field_nBIFOM__DefaultAccess;
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
delete single_value.field_nBIFOM__Status;
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
delete single_value.field_nBIFOM__RoutingRules;
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
delete single_value.field_nBIFOM__IPFlowMapping;
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
delete single_value.field_nBIFOM__RANRulesHandling;
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
delete single_value.field_nBIFOM__RANRulesStatus;
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
delete single_value.field_nBIFOM__AccessUsabilityIndication;
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
delete single_value.field_unknownParameter;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

boolean NBIFOM__ParameterContents_template::match(const NBIFOM__ParameterContents& 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:
{
NBIFOM__ParameterContents::union_selection_type value_selection = other_value.get_selection();
if (value_selection == NBIFOM__ParameterContents::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
return single_value.field_nBIFOM__Mode->match(other_value.nBIFOM__Mode(), legacy);
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
return single_value.field_nBIFOM__DefaultAccess->match(other_value.nBIFOM__DefaultAccess(), legacy);
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
return single_value.field_nBIFOM__Status->match(other_value.nBIFOM__Status(), legacy);
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
return single_value.field_nBIFOM__RoutingRules->match(other_value.nBIFOM__RoutingRules(), legacy);
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
return single_value.field_nBIFOM__IPFlowMapping->match(other_value.nBIFOM__IPFlowMapping(), legacy);
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
return single_value.field_nBIFOM__RANRulesHandling->match(other_value.nBIFOM__RANRulesHandling(), legacy);
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
return single_value.field_nBIFOM__RANRulesStatus->match(other_value.nBIFOM__RANRulesStatus(), legacy);
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
return single_value.field_nBIFOM__AccessUsabilityIndication->match(other_value.nBIFOM__AccessUsabilityIndication(), legacy);
case NBIFOM__ParameterContents::ALT_unknownParameter:
return single_value.field_unknownParameter->match(other_value.unknownParameter(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
return FALSE;
}

boolean NBIFOM__ParameterContents_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
return single_value.field_nBIFOM__Mode->is_value();
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
return single_value.field_nBIFOM__DefaultAccess->is_value();
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
return single_value.field_nBIFOM__Status->is_value();
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
return single_value.field_nBIFOM__RoutingRules->is_value();
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
return single_value.field_nBIFOM__IPFlowMapping->is_value();
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
return single_value.field_nBIFOM__RANRulesHandling->is_value();
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
return single_value.field_nBIFOM__RANRulesStatus->is_value();
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
return single_value.field_nBIFOM__AccessUsabilityIndication->is_value();
case NBIFOM__ParameterContents::ALT_unknownParameter:
return single_value.field_unknownParameter->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
}

NBIFOM__ParameterContents NBIFOM__ParameterContents_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
NBIFOM__ParameterContents ret_val;
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
ret_val.nBIFOM__Mode() = single_value.field_nBIFOM__Mode->valueof();
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
ret_val.nBIFOM__DefaultAccess() = single_value.field_nBIFOM__DefaultAccess->valueof();
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
ret_val.nBIFOM__Status() = single_value.field_nBIFOM__Status->valueof();
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
ret_val.nBIFOM__RoutingRules() = single_value.field_nBIFOM__RoutingRules->valueof();
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
ret_val.nBIFOM__IPFlowMapping() = single_value.field_nBIFOM__IPFlowMapping->valueof();
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
ret_val.nBIFOM__RANRulesHandling() = single_value.field_nBIFOM__RANRulesHandling->valueof();
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
ret_val.nBIFOM__RANRulesStatus() = single_value.field_nBIFOM__RANRulesStatus->valueof();
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
ret_val.nBIFOM__AccessUsabilityIndication() = single_value.field_nBIFOM__AccessUsabilityIndication->valueof();
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
ret_val.unknownParameter() = single_value.field_unknownParameter->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
return ret_val;
}

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

OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__Mode()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__Mode) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__Mode = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_nBIFOM__Mode = new OCTETSTRING_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__Mode;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__Mode;
}

const OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__Mode() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_Mode in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__Mode) TTCN_error("Accessing non-selected field nBIFOM_Mode in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__Mode;
}

OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__DefaultAccess()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__DefaultAccess = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_nBIFOM__DefaultAccess = new OCTETSTRING_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__DefaultAccess;
}

const OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__DefaultAccess() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_DefaultAccess in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess) TTCN_error("Accessing non-selected field nBIFOM_DefaultAccess in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__DefaultAccess;
}

OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__Status()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__Status) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__Status = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_nBIFOM__Status = new OCTETSTRING_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__Status;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__Status;
}

const OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__Status() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_Status in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__Status) TTCN_error("Accessing non-selected field nBIFOM_Status in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__Status;
}

NBIFOM__RoutingRules_template& NBIFOM__ParameterContents_template::nBIFOM__RoutingRules()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__RoutingRules = new NBIFOM__RoutingRules_template(ANY_VALUE);
else single_value.field_nBIFOM__RoutingRules = new NBIFOM__RoutingRules_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__RoutingRules;
}

const NBIFOM__RoutingRules_template& NBIFOM__ParameterContents_template::nBIFOM__RoutingRules() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_RoutingRules in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules) TTCN_error("Accessing non-selected field nBIFOM_RoutingRules in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__RoutingRules;
}

NBIFOM__RoutingRules_template& NBIFOM__ParameterContents_template::nBIFOM__IPFlowMapping()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__IPFlowMapping = new NBIFOM__RoutingRules_template(ANY_VALUE);
else single_value.field_nBIFOM__IPFlowMapping = new NBIFOM__RoutingRules_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__IPFlowMapping;
}

const NBIFOM__RoutingRules_template& NBIFOM__ParameterContents_template::nBIFOM__IPFlowMapping() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_IPFlowMapping in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping) TTCN_error("Accessing non-selected field nBIFOM_IPFlowMapping in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__IPFlowMapping;
}

OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__RANRulesHandling()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__RANRulesHandling = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_nBIFOM__RANRulesHandling = new OCTETSTRING_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__RANRulesHandling;
}

const OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__RANRulesHandling() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_RANRulesHandling in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling) TTCN_error("Accessing non-selected field nBIFOM_RANRulesHandling in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__RANRulesHandling;
}

OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__RANRulesStatus()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__RANRulesStatus = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_nBIFOM__RANRulesStatus = new OCTETSTRING_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__RANRulesStatus;
}

const OCTETSTRING_template& NBIFOM__ParameterContents_template::nBIFOM__RANRulesStatus() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_RANRulesStatus in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus) TTCN_error("Accessing non-selected field nBIFOM_RANRulesStatus in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__RANRulesStatus;
}

NBIFOM__AccessUsabilityIndication_template& NBIFOM__ParameterContents_template::nBIFOM__AccessUsabilityIndication()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_nBIFOM__AccessUsabilityIndication = new NBIFOM__AccessUsabilityIndication_template(ANY_VALUE);
else single_value.field_nBIFOM__AccessUsabilityIndication = new NBIFOM__AccessUsabilityIndication_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_nBIFOM__AccessUsabilityIndication;
}

const NBIFOM__AccessUsabilityIndication_template& NBIFOM__ParameterContents_template::nBIFOM__AccessUsabilityIndication() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nBIFOM_AccessUsabilityIndication in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication) TTCN_error("Accessing non-selected field nBIFOM_AccessUsabilityIndication in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_nBIFOM__AccessUsabilityIndication;
}

OCTETSTRING_template& NBIFOM__ParameterContents_template::unknownParameter()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != NBIFOM__ParameterContents::ALT_unknownParameter) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_unknownParameter = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_unknownParameter = new OCTETSTRING_template;
single_value.union_selection = NBIFOM__ParameterContents::ALT_unknownParameter;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_unknownParameter;
}

const OCTETSTRING_template& NBIFOM__ParameterContents_template::unknownParameter() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field unknownParameter in a non-specific template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
if (single_value.union_selection != NBIFOM__ParameterContents::ALT_unknownParameter) TTCN_error("Accessing non-selected field unknownParameter in a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
return *single_value.field_unknownParameter;
}

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

void NBIFOM__ParameterContents_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
TTCN_Logger::log_event_str("{ nBIFOM_Mode := ");
single_value.field_nBIFOM__Mode->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
TTCN_Logger::log_event_str("{ nBIFOM_DefaultAccess := ");
single_value.field_nBIFOM__DefaultAccess->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
TTCN_Logger::log_event_str("{ nBIFOM_Status := ");
single_value.field_nBIFOM__Status->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
TTCN_Logger::log_event_str("{ nBIFOM_RoutingRules := ");
single_value.field_nBIFOM__RoutingRules->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
TTCN_Logger::log_event_str("{ nBIFOM_IPFlowMapping := ");
single_value.field_nBIFOM__IPFlowMapping->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
TTCN_Logger::log_event_str("{ nBIFOM_RANRulesHandling := ");
single_value.field_nBIFOM__RANRulesHandling->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
TTCN_Logger::log_event_str("{ nBIFOM_RANRulesStatus := ");
single_value.field_nBIFOM__RANRulesStatus->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
TTCN_Logger::log_event_str("{ nBIFOM_AccessUsabilityIndication := ");
single_value.field_nBIFOM__AccessUsabilityIndication->log();
TTCN_Logger::log_event_str(" }");
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
TTCN_Logger::log_event_str("{ unknownParameter := ");
single_value.field_unknownParameter->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void NBIFOM__ParameterContents_template::log_match(const NBIFOM__ParameterContents& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_Mode");
single_value.field_nBIFOM__Mode->log_match(match_value.nBIFOM__Mode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_Mode := ");
single_value.field_nBIFOM__Mode->log_match(match_value.nBIFOM__Mode(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_DefaultAccess");
single_value.field_nBIFOM__DefaultAccess->log_match(match_value.nBIFOM__DefaultAccess(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_DefaultAccess := ");
single_value.field_nBIFOM__DefaultAccess->log_match(match_value.nBIFOM__DefaultAccess(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_Status");
single_value.field_nBIFOM__Status->log_match(match_value.nBIFOM__Status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_Status := ");
single_value.field_nBIFOM__Status->log_match(match_value.nBIFOM__Status(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_RoutingRules");
single_value.field_nBIFOM__RoutingRules->log_match(match_value.nBIFOM__RoutingRules(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_RoutingRules := ");
single_value.field_nBIFOM__RoutingRules->log_match(match_value.nBIFOM__RoutingRules(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_IPFlowMapping");
single_value.field_nBIFOM__IPFlowMapping->log_match(match_value.nBIFOM__IPFlowMapping(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_IPFlowMapping := ");
single_value.field_nBIFOM__IPFlowMapping->log_match(match_value.nBIFOM__IPFlowMapping(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_RANRulesHandling");
single_value.field_nBIFOM__RANRulesHandling->log_match(match_value.nBIFOM__RANRulesHandling(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_RANRulesHandling := ");
single_value.field_nBIFOM__RANRulesHandling->log_match(match_value.nBIFOM__RANRulesHandling(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_RANRulesStatus");
single_value.field_nBIFOM__RANRulesStatus->log_match(match_value.nBIFOM__RANRulesStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_RANRulesStatus := ");
single_value.field_nBIFOM__RANRulesStatus->log_match(match_value.nBIFOM__RANRulesStatus(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".nBIFOM_AccessUsabilityIndication");
single_value.field_nBIFOM__AccessUsabilityIndication->log_match(match_value.nBIFOM__AccessUsabilityIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ nBIFOM_AccessUsabilityIndication := ");
single_value.field_nBIFOM__AccessUsabilityIndication->log_match(match_value.nBIFOM__AccessUsabilityIndication(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".unknownParameter");
single_value.field_unknownParameter->log_match(match_value.unknownParameter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ unknownParameter := ");
single_value.field_unknownParameter->log_match(match_value.unknownParameter(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void NBIFOM__ParameterContents_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
single_value.field_nBIFOM__Mode->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
single_value.field_nBIFOM__DefaultAccess->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
single_value.field_nBIFOM__Status->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
single_value.field_nBIFOM__RoutingRules->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
single_value.field_nBIFOM__IPFlowMapping->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
single_value.field_nBIFOM__RANRulesHandling->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
single_value.field_nBIFOM__RANRulesStatus->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
single_value.field_nBIFOM__AccessUsabilityIndication->set_implicit_omit(); break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
single_value.field_unknownParameter->set_implicit_omit(); break;
default: break;
}
}

void NBIFOM__ParameterContents_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
single_value.field_nBIFOM__Mode->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
single_value.field_nBIFOM__DefaultAccess->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
single_value.field_nBIFOM__Status->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
single_value.field_nBIFOM__RoutingRules->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
single_value.field_nBIFOM__IPFlowMapping->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
single_value.field_nBIFOM__RANRulesHandling->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
single_value.field_nBIFOM__RANRulesStatus->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
single_value.field_nBIFOM__AccessUsabilityIndication->encode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
single_value.field_unknownParameter->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
}

void NBIFOM__ParameterContents_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = NBIFOM__ParameterContents::UNBOUND_VALUE;
NBIFOM__ParameterContents::union_selection_type new_selection = (NBIFOM__ParameterContents::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
single_value.field_nBIFOM__Mode = new OCTETSTRING_template;
single_value.field_nBIFOM__Mode->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
single_value.field_nBIFOM__DefaultAccess = new OCTETSTRING_template;
single_value.field_nBIFOM__DefaultAccess->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
single_value.field_nBIFOM__Status = new OCTETSTRING_template;
single_value.field_nBIFOM__Status->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
single_value.field_nBIFOM__RoutingRules = new NBIFOM__RoutingRules_template;
single_value.field_nBIFOM__RoutingRules->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
single_value.field_nBIFOM__IPFlowMapping = new NBIFOM__RoutingRules_template;
single_value.field_nBIFOM__IPFlowMapping->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
single_value.field_nBIFOM__RANRulesHandling = new OCTETSTRING_template;
single_value.field_nBIFOM__RANRulesHandling->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
single_value.field_nBIFOM__RANRulesStatus = new OCTETSTRING_template;
single_value.field_nBIFOM__RANRulesStatus->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
single_value.field_nBIFOM__AccessUsabilityIndication = new NBIFOM__AccessUsabilityIndication_template;
single_value.field_nBIFOM__AccessUsabilityIndication->decode_text(text_buf);
break;
case NBIFOM__ParameterContents::ALT_unknownParameter:
single_value.field_unknownParameter = new OCTETSTRING_template;
single_value.field_unknownParameter->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NBIFOM__ParameterContents_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
}

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

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

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

void NBIFOM__ParameterContents_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
single_value.field_nBIFOM__Mode->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
single_value.field_nBIFOM__DefaultAccess->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
single_value.field_nBIFOM__Status->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
single_value.field_nBIFOM__RoutingRules->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
single_value.field_nBIFOM__IPFlowMapping->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
single_value.field_nBIFOM__RANRulesHandling->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
single_value.field_nBIFOM__RANRulesStatus->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
single_value.field_nBIFOM__AccessUsabilityIndication->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
case NBIFOM__ParameterContents::ALT_unknownParameter:
single_value.field_unknownParameter->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_GMM_SM_Types.NBIFOM_ParameterContents.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ParameterContents");
}


const NBIFOM__RoutingRule NBIFOM__RoutingRules::UNBOUND_ELEM;
NBIFOM__RoutingRules::NBIFOM__RoutingRules()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void NBIFOM__RoutingRules_template::copy_template(const NBIFOM__RoutingRules_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (NBIFOM__RoutingRule_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new NBIFOM__RoutingRule_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new NBIFOM__RoutingRule_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NBIFOM__RoutingRules_template[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 NBIFOM__RoutingRules_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__RoutingRules_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRules.");
break;
}
set_selection(other_value);
}

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

NBIFOM__RoutingRules_template::NBIFOM__RoutingRules_template()
{
}

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

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

NBIFOM__RoutingRules_template::NBIFOM__RoutingRules_template(const NBIFOM__RoutingRules& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void NBIFOM__RoutingRules_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

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

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

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

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

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

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

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

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

boolean NBIFOM__RoutingRules_template::match(const NBIFOM__RoutingRules& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRules.");
}
return FALSE;
}

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

NBIFOM__RoutingRules NBIFOM__RoutingRules_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRules.");
NBIFOM__RoutingRules ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

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

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

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

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

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

void NBIFOM__RoutingRules_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void NBIFOM__RoutingRules_template::log_match(const NBIFOM__RoutingRules& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void NBIFOM__RoutingRules_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRules.");
single_value.value_elements = (NBIFOM__RoutingRule_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new NBIFOM__RoutingRule_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NBIFOM__RoutingRules_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRules.");
}
}

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

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

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

void NBIFOM__RoutingRules_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    NBIFOM__RoutingRules_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NBIFOM__RoutingRules_template* precondition = new NBIFOM__RoutingRules_template;
    precondition->set_param(*param.get_elem(0));
    NBIFOM__RoutingRules_template* implied_template = new NBIFOM__RoutingRules_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NBIFOM__RoutingRules_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRules");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void NBIFOM__RoutingRules_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRules");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRules");
}

boolean NBIFOM__RoutingRules_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
RoutingFilter::RoutingFilter()
{
}

RoutingFilter::RoutingFilter(const BITSTRING& par_flagA,
    const BITSTRING& par_flagB,
    const BITSTRING& par_flagC,
    const BITSTRING& par_flagD,
    const BITSTRING& par_flagE,
    const BITSTRING& par_flagF,
    const BITSTRING& par_flagG,
    const BITSTRING& par_flagH,
    const BITSTRING& par_flagI,
    const BITSTRING& par_flagJ,
    const BITSTRING& par_flagK,
    const BITSTRING& par_flagL,
    const BITSTRING& par_flagM,
    const BITSTRING& par_flagN,
    const BITSTRING& par_flagsZ,
    const OPTIONAL< OCTETSTRING >& par_sourceIPv4Address,
    const OPTIONAL< OCTETSTRING >& par_destinationIPv4Address,
    const OPTIONAL< OCTETSTRING >& par_sourceIPv6Address,
    const OPTIONAL< OCTETSTRING >& par_destinationIPv6Address,
    const OPTIONAL< OCTETSTRING >& par_sourceAddressPrefixLength,
    const OPTIONAL< OCTETSTRING >& par_destinationAddressPrefixLength,
    const OPTIONAL< OCTETSTRING >& par_iPSecSecurityParameterIndex,
    const OPTIONAL< OCTETSTRING >& par_protocolTypeNextHeader,
    const OPTIONAL< OCTETSTRING >& par_startSourcePortRange,
    const OPTIONAL< OCTETSTRING >& par_endSourcePortRange,
    const OPTIONAL< OCTETSTRING >& par_startDestinationPortRange,
    const OPTIONAL< OCTETSTRING >& par_endDestinationPortRange,
    const OPTIONAL< OCTETSTRING >& par_typeOfService,
    const OPTIONAL< OCTETSTRING >& par_flowLabel)
  :   field_flagA(par_flagA),
  field_flagB(par_flagB),
  field_flagC(par_flagC),
  field_flagD(par_flagD),
  field_flagE(par_flagE),
  field_flagF(par_flagF),
  field_flagG(par_flagG),
  field_flagH(par_flagH),
  field_flagI(par_flagI),
  field_flagJ(par_flagJ),
  field_flagK(par_flagK),
  field_flagL(par_flagL),
  field_flagM(par_flagM),
  field_flagN(par_flagN),
  field_flagsZ(par_flagsZ),
  field_sourceIPv4Address(par_sourceIPv4Address),
  field_destinationIPv4Address(par_destinationIPv4Address),
  field_sourceIPv6Address(par_sourceIPv6Address),
  field_destinationIPv6Address(par_destinationIPv6Address),
  field_sourceAddressPrefixLength(par_sourceAddressPrefixLength),
  field_destinationAddressPrefixLength(par_destinationAddressPrefixLength),
  field_iPSecSecurityParameterIndex(par_iPSecSecurityParameterIndex),
  field_protocolTypeNextHeader(par_protocolTypeNextHeader),
  field_startSourcePortRange(par_startSourcePortRange),
  field_endSourcePortRange(par_endSourcePortRange),
  field_startDestinationPortRange(par_startDestinationPortRange),
  field_endDestinationPortRange(par_endDestinationPortRange),
  field_typeOfService(par_typeOfService),
  field_flowLabel(par_flowLabel)
{
}

RoutingFilter::RoutingFilter(const RoutingFilter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RoutingFilter.");
if (other_value.flagA().is_bound()) field_flagA = other_value.flagA();
else field_flagA.clean_up();
if (other_value.flagB().is_bound()) field_flagB = other_value.flagB();
else field_flagB.clean_up();
if (other_value.flagC().is_bound()) field_flagC = other_value.flagC();
else field_flagC.clean_up();
if (other_value.flagD().is_bound()) field_flagD = other_value.flagD();
else field_flagD.clean_up();
if (other_value.flagE().is_bound()) field_flagE = other_value.flagE();
else field_flagE.clean_up();
if (other_value.flagF().is_bound()) field_flagF = other_value.flagF();
else field_flagF.clean_up();
if (other_value.flagG().is_bound()) field_flagG = other_value.flagG();
else field_flagG.clean_up();
if (other_value.flagH().is_bound()) field_flagH = other_value.flagH();
else field_flagH.clean_up();
if (other_value.flagI().is_bound()) field_flagI = other_value.flagI();
else field_flagI.clean_up();
if (other_value.flagJ().is_bound()) field_flagJ = other_value.flagJ();
else field_flagJ.clean_up();
if (other_value.flagK().is_bound()) field_flagK = other_value.flagK();
else field_flagK.clean_up();
if (other_value.flagL().is_bound()) field_flagL = other_value.flagL();
else field_flagL.clean_up();
if (other_value.flagM().is_bound()) field_flagM = other_value.flagM();
else field_flagM.clean_up();
if (other_value.flagN().is_bound()) field_flagN = other_value.flagN();
else field_flagN.clean_up();
if (other_value.flagsZ().is_bound()) field_flagsZ = other_value.flagsZ();
else field_flagsZ.clean_up();
if (other_value.sourceIPv4Address().is_bound()) field_sourceIPv4Address = other_value.sourceIPv4Address();
else field_sourceIPv4Address.clean_up();
if (other_value.destinationIPv4Address().is_bound()) field_destinationIPv4Address = other_value.destinationIPv4Address();
else field_destinationIPv4Address.clean_up();
if (other_value.sourceIPv6Address().is_bound()) field_sourceIPv6Address = other_value.sourceIPv6Address();
else field_sourceIPv6Address.clean_up();
if (other_value.destinationIPv6Address().is_bound()) field_destinationIPv6Address = other_value.destinationIPv6Address();
else field_destinationIPv6Address.clean_up();
if (other_value.sourceAddressPrefixLength().is_bound()) field_sourceAddressPrefixLength = other_value.sourceAddressPrefixLength();
else field_sourceAddressPrefixLength.clean_up();
if (other_value.destinationAddressPrefixLength().is_bound()) field_destinationAddressPrefixLength = other_value.destinationAddressPrefixLength();
else field_destinationAddressPrefixLength.clean_up();
if (other_value.iPSecSecurityParameterIndex().is_bound()) field_iPSecSecurityParameterIndex = other_value.iPSecSecurityParameterIndex();
else field_iPSecSecurityParameterIndex.clean_up();
if (other_value.protocolTypeNextHeader().is_bound()) field_protocolTypeNextHeader = other_value.protocolTypeNextHeader();
else field_protocolTypeNextHeader.clean_up();
if (other_value.startSourcePortRange().is_bound()) field_startSourcePortRange = other_value.startSourcePortRange();
else field_startSourcePortRange.clean_up();
if (other_value.endSourcePortRange().is_bound()) field_endSourcePortRange = other_value.endSourcePortRange();
else field_endSourcePortRange.clean_up();
if (other_value.startDestinationPortRange().is_bound()) field_startDestinationPortRange = other_value.startDestinationPortRange();
else field_startDestinationPortRange.clean_up();
if (other_value.endDestinationPortRange().is_bound()) field_endDestinationPortRange = other_value.endDestinationPortRange();
else field_endDestinationPortRange.clean_up();
if (other_value.typeOfService().is_bound()) field_typeOfService = other_value.typeOfService();
else field_typeOfService.clean_up();
if (other_value.flowLabel().is_bound()) field_flowLabel = other_value.flowLabel();
else field_flowLabel.clean_up();
}

void RoutingFilter::clean_up()
{
field_flagA.clean_up();
field_flagB.clean_up();
field_flagC.clean_up();
field_flagD.clean_up();
field_flagE.clean_up();
field_flagF.clean_up();
field_flagG.clean_up();
field_flagH.clean_up();
field_flagI.clean_up();
field_flagJ.clean_up();
field_flagK.clean_up();
field_flagL.clean_up();
field_flagM.clean_up();
field_flagN.clean_up();
field_flagsZ.clean_up();
field_sourceIPv4Address.clean_up();
field_destinationIPv4Address.clean_up();
field_sourceIPv6Address.clean_up();
field_destinationIPv6Address.clean_up();
field_sourceAddressPrefixLength.clean_up();
field_destinationAddressPrefixLength.clean_up();
field_iPSecSecurityParameterIndex.clean_up();
field_protocolTypeNextHeader.clean_up();
field_startSourcePortRange.clean_up();
field_endSourcePortRange.clean_up();
field_startDestinationPortRange.clean_up();
field_endDestinationPortRange.clean_up();
field_typeOfService.clean_up();
field_flowLabel.clean_up();
}

const TTCN_Typedescriptor_t* RoutingFilter::get_descriptor() const { return &RoutingFilter_descr_; }
RoutingFilter& RoutingFilter::operator=(const RoutingFilter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RoutingFilter.");
  if (other_value.flagA().is_bound()) field_flagA = other_value.flagA();
  else field_flagA.clean_up();
  if (other_value.flagB().is_bound()) field_flagB = other_value.flagB();
  else field_flagB.clean_up();
  if (other_value.flagC().is_bound()) field_flagC = other_value.flagC();
  else field_flagC.clean_up();
  if (other_value.flagD().is_bound()) field_flagD = other_value.flagD();
  else field_flagD.clean_up();
  if (other_value.flagE().is_bound()) field_flagE = other_value.flagE();
  else field_flagE.clean_up();
  if (other_value.flagF().is_bound()) field_flagF = other_value.flagF();
  else field_flagF.clean_up();
  if (other_value.flagG().is_bound()) field_flagG = other_value.flagG();
  else field_flagG.clean_up();
  if (other_value.flagH().is_bound()) field_flagH = other_value.flagH();
  else field_flagH.clean_up();
  if (other_value.flagI().is_bound()) field_flagI = other_value.flagI();
  else field_flagI.clean_up();
  if (other_value.flagJ().is_bound()) field_flagJ = other_value.flagJ();
  else field_flagJ.clean_up();
  if (other_value.flagK().is_bound()) field_flagK = other_value.flagK();
  else field_flagK.clean_up();
  if (other_value.flagL().is_bound()) field_flagL = other_value.flagL();
  else field_flagL.clean_up();
  if (other_value.flagM().is_bound()) field_flagM = other_value.flagM();
  else field_flagM.clean_up();
  if (other_value.flagN().is_bound()) field_flagN = other_value.flagN();
  else field_flagN.clean_up();
  if (other_value.flagsZ().is_bound()) field_flagsZ = other_value.flagsZ();
  else field_flagsZ.clean_up();
  if (other_value.sourceIPv4Address().is_bound()) field_sourceIPv4Address = other_value.sourceIPv4Address();
  else field_sourceIPv4Address.clean_up();
  if (other_value.destinationIPv4Address().is_bound()) field_destinationIPv4Address = other_value.destinationIPv4Address();
  else field_destinationIPv4Address.clean_up();
  if (other_value.sourceIPv6Address().is_bound()) field_sourceIPv6Address = other_value.sourceIPv6Address();
  else field_sourceIPv6Address.clean_up();
  if (other_value.destinationIPv6Address().is_bound()) field_destinationIPv6Address = other_value.destinationIPv6Address();
  else field_destinationIPv6Address.clean_up();
  if (other_value.sourceAddressPrefixLength().is_bound()) field_sourceAddressPrefixLength = other_value.sourceAddressPrefixLength();
  else field_sourceAddressPrefixLength.clean_up();
  if (other_value.destinationAddressPrefixLength().is_bound()) field_destinationAddressPrefixLength = other_value.destinationAddressPrefixLength();
  else field_destinationAddressPrefixLength.clean_up();
  if (other_value.iPSecSecurityParameterIndex().is_bound()) field_iPSecSecurityParameterIndex = other_value.iPSecSecurityParameterIndex();
  else field_iPSecSecurityParameterIndex.clean_up();
  if (other_value.protocolTypeNextHeader().is_bound()) field_protocolTypeNextHeader = other_value.protocolTypeNextHeader();
  else field_protocolTypeNextHeader.clean_up();
  if (other_value.startSourcePortRange().is_bound()) field_startSourcePortRange = other_value.startSourcePortRange();
  else field_startSourcePortRange.clean_up();
  if (other_value.endSourcePortRange().is_bound()) field_endSourcePortRange = other_value.endSourcePortRange();
  else field_endSourcePortRange.clean_up();
  if (other_value.startDestinationPortRange().is_bound()) field_startDestinationPortRange = other_value.startDestinationPortRange();
  else field_startDestinationPortRange.clean_up();
  if (other_value.endDestinationPortRange().is_bound()) field_endDestinationPortRange = other_value.endDestinationPortRange();
  else field_endDestinationPortRange.clean_up();
  if (other_value.typeOfService().is_bound()) field_typeOfService = other_value.typeOfService();
  else field_typeOfService.clean_up();
  if (other_value.flowLabel().is_bound()) field_flowLabel = other_value.flowLabel();
  else field_flowLabel.clean_up();
}
return *this;
}

boolean RoutingFilter::operator==(const RoutingFilter& other_value) const
{
return field_flagA==other_value.field_flagA
  && field_flagB==other_value.field_flagB
  && field_flagC==other_value.field_flagC
  && field_flagD==other_value.field_flagD
  && field_flagE==other_value.field_flagE
  && field_flagF==other_value.field_flagF
  && field_flagG==other_value.field_flagG
  && field_flagH==other_value.field_flagH
  && field_flagI==other_value.field_flagI
  && field_flagJ==other_value.field_flagJ
  && field_flagK==other_value.field_flagK
  && field_flagL==other_value.field_flagL
  && field_flagM==other_value.field_flagM
  && field_flagN==other_value.field_flagN
  && field_flagsZ==other_value.field_flagsZ
  && field_sourceIPv4Address==other_value.field_sourceIPv4Address
  && field_destinationIPv4Address==other_value.field_destinationIPv4Address
  && field_sourceIPv6Address==other_value.field_sourceIPv6Address
  && field_destinationIPv6Address==other_value.field_destinationIPv6Address
  && field_sourceAddressPrefixLength==other_value.field_sourceAddressPrefixLength
  && field_destinationAddressPrefixLength==other_value.field_destinationAddressPrefixLength
  && field_iPSecSecurityParameterIndex==other_value.field_iPSecSecurityParameterIndex
  && field_protocolTypeNextHeader==other_value.field_protocolTypeNextHeader
  && field_startSourcePortRange==other_value.field_startSourcePortRange
  && field_endSourcePortRange==other_value.field_endSourcePortRange
  && field_startDestinationPortRange==other_value.field_startDestinationPortRange
  && field_endDestinationPortRange==other_value.field_endDestinationPortRange
  && field_typeOfService==other_value.field_typeOfService
  && field_flowLabel==other_value.field_flowLabel;
}

boolean RoutingFilter::is_bound() const
{
return (field_flagA.is_bound())
  || (field_flagB.is_bound())
  || (field_flagC.is_bound())
  || (field_flagD.is_bound())
  || (field_flagE.is_bound())
  || (field_flagF.is_bound())
  || (field_flagG.is_bound())
  || (field_flagH.is_bound())
  || (field_flagI.is_bound())
  || (field_flagJ.is_bound())
  || (field_flagK.is_bound())
  || (field_flagL.is_bound())
  || (field_flagM.is_bound())
  || (field_flagN.is_bound())
  || (field_flagsZ.is_bound())
  || (OPTIONAL_OMIT == field_sourceIPv4Address.get_selection() || field_sourceIPv4Address.is_bound())
  || (OPTIONAL_OMIT == field_destinationIPv4Address.get_selection() || field_destinationIPv4Address.is_bound())
  || (OPTIONAL_OMIT == field_sourceIPv6Address.get_selection() || field_sourceIPv6Address.is_bound())
  || (OPTIONAL_OMIT == field_destinationIPv6Address.get_selection() || field_destinationIPv6Address.is_bound())
  || (OPTIONAL_OMIT == field_sourceAddressPrefixLength.get_selection() || field_sourceAddressPrefixLength.is_bound())
  || (OPTIONAL_OMIT == field_destinationAddressPrefixLength.get_selection() || field_destinationAddressPrefixLength.is_bound())
  || (OPTIONAL_OMIT == field_iPSecSecurityParameterIndex.get_selection() || field_iPSecSecurityParameterIndex.is_bound())
  || (OPTIONAL_OMIT == field_protocolTypeNextHeader.get_selection() || field_protocolTypeNextHeader.is_bound())
  || (OPTIONAL_OMIT == field_startSourcePortRange.get_selection() || field_startSourcePortRange.is_bound())
  || (OPTIONAL_OMIT == field_endSourcePortRange.get_selection() || field_endSourcePortRange.is_bound())
  || (OPTIONAL_OMIT == field_startDestinationPortRange.get_selection() || field_startDestinationPortRange.is_bound())
  || (OPTIONAL_OMIT == field_endDestinationPortRange.get_selection() || field_endDestinationPortRange.is_bound())
  || (OPTIONAL_OMIT == field_typeOfService.get_selection() || field_typeOfService.is_bound())
  || (OPTIONAL_OMIT == field_flowLabel.get_selection() || field_flowLabel.is_bound());
}
boolean RoutingFilter::is_value() const
{
return field_flagA.is_value()
  && field_flagB.is_value()
  && field_flagC.is_value()
  && field_flagD.is_value()
  && field_flagE.is_value()
  && field_flagF.is_value()
  && field_flagG.is_value()
  && field_flagH.is_value()
  && field_flagI.is_value()
  && field_flagJ.is_value()
  && field_flagK.is_value()
  && field_flagL.is_value()
  && field_flagM.is_value()
  && field_flagN.is_value()
  && field_flagsZ.is_value()
  && (OPTIONAL_OMIT == field_sourceIPv4Address.get_selection() || field_sourceIPv4Address.is_value())
  && (OPTIONAL_OMIT == field_destinationIPv4Address.get_selection() || field_destinationIPv4Address.is_value())
  && (OPTIONAL_OMIT == field_sourceIPv6Address.get_selection() || field_sourceIPv6Address.is_value())
  && (OPTIONAL_OMIT == field_destinationIPv6Address.get_selection() || field_destinationIPv6Address.is_value())
  && (OPTIONAL_OMIT == field_sourceAddressPrefixLength.get_selection() || field_sourceAddressPrefixLength.is_value())
  && (OPTIONAL_OMIT == field_destinationAddressPrefixLength.get_selection() || field_destinationAddressPrefixLength.is_value())
  && (OPTIONAL_OMIT == field_iPSecSecurityParameterIndex.get_selection() || field_iPSecSecurityParameterIndex.is_value())
  && (OPTIONAL_OMIT == field_protocolTypeNextHeader.get_selection() || field_protocolTypeNextHeader.is_value())
  && (OPTIONAL_OMIT == field_startSourcePortRange.get_selection() || field_startSourcePortRange.is_value())
  && (OPTIONAL_OMIT == field_endSourcePortRange.get_selection() || field_endSourcePortRange.is_value())
  && (OPTIONAL_OMIT == field_startDestinationPortRange.get_selection() || field_startDestinationPortRange.is_value())
  && (OPTIONAL_OMIT == field_endDestinationPortRange.get_selection() || field_endDestinationPortRange.is_value())
  && (OPTIONAL_OMIT == field_typeOfService.get_selection() || field_typeOfService.is_value())
  && (OPTIONAL_OMIT == field_flowLabel.get_selection() || field_flowLabel.is_value());
}
int RoutingFilter::size_of() const
{
  int ret_val = 15;
  if (field_sourceIPv4Address.ispresent()) ret_val++;
  if (field_destinationIPv4Address.ispresent()) ret_val++;
  if (field_sourceIPv6Address.ispresent()) ret_val++;
  if (field_destinationIPv6Address.ispresent()) ret_val++;
  if (field_sourceAddressPrefixLength.ispresent()) ret_val++;
  if (field_destinationAddressPrefixLength.ispresent()) ret_val++;
  if (field_iPSecSecurityParameterIndex.ispresent()) ret_val++;
  if (field_protocolTypeNextHeader.ispresent()) ret_val++;
  if (field_startSourcePortRange.ispresent()) ret_val++;
  if (field_endSourcePortRange.ispresent()) ret_val++;
  if (field_startDestinationPortRange.ispresent()) ret_val++;
  if (field_endDestinationPortRange.ispresent()) ret_val++;
  if (field_typeOfService.ispresent()) ret_val++;
  if (field_flowLabel.ispresent()) ret_val++;
  return ret_val;
}

void RoutingFilter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ flagA := ");
field_flagA.log();
TTCN_Logger::log_event_str(", flagB := ");
field_flagB.log();
TTCN_Logger::log_event_str(", flagC := ");
field_flagC.log();
TTCN_Logger::log_event_str(", flagD := ");
field_flagD.log();
TTCN_Logger::log_event_str(", flagE := ");
field_flagE.log();
TTCN_Logger::log_event_str(", flagF := ");
field_flagF.log();
TTCN_Logger::log_event_str(", flagG := ");
field_flagG.log();
TTCN_Logger::log_event_str(", flagH := ");
field_flagH.log();
TTCN_Logger::log_event_str(", flagI := ");
field_flagI.log();
TTCN_Logger::log_event_str(", flagJ := ");
field_flagJ.log();
TTCN_Logger::log_event_str(", flagK := ");
field_flagK.log();
TTCN_Logger::log_event_str(", flagL := ");
field_flagL.log();
TTCN_Logger::log_event_str(", flagM := ");
field_flagM.log();
TTCN_Logger::log_event_str(", flagN := ");
field_flagN.log();
TTCN_Logger::log_event_str(", flagsZ := ");
field_flagsZ.log();
TTCN_Logger::log_event_str(", sourceIPv4Address := ");
field_sourceIPv4Address.log();
TTCN_Logger::log_event_str(", destinationIPv4Address := ");
field_destinationIPv4Address.log();
TTCN_Logger::log_event_str(", sourceIPv6Address := ");
field_sourceIPv6Address.log();
TTCN_Logger::log_event_str(", destinationIPv6Address := ");
field_destinationIPv6Address.log();
TTCN_Logger::log_event_str(", sourceAddressPrefixLength := ");
field_sourceAddressPrefixLength.log();
TTCN_Logger::log_event_str(", destinationAddressPrefixLength := ");
field_destinationAddressPrefixLength.log();
TTCN_Logger::log_event_str(", iPSecSecurityParameterIndex := ");
field_iPSecSecurityParameterIndex.log();
TTCN_Logger::log_event_str(", protocolTypeNextHeader := ");
field_protocolTypeNextHeader.log();
TTCN_Logger::log_event_str(", startSourcePortRange := ");
field_startSourcePortRange.log();
TTCN_Logger::log_event_str(", endSourcePortRange := ");
field_endSourcePortRange.log();
TTCN_Logger::log_event_str(", startDestinationPortRange := ");
field_startDestinationPortRange.log();
TTCN_Logger::log_event_str(", endDestinationPortRange := ");
field_endDestinationPortRange.log();
TTCN_Logger::log_event_str(", typeOfService := ");
field_typeOfService.log();
TTCN_Logger::log_event_str(", flowLabel := ");
field_flowLabel.log();
TTCN_Logger::log_event_str(" }");
}

void RoutingFilter::set_implicit_omit()
{
if (flagA().is_bound()) flagA().set_implicit_omit();
if (flagB().is_bound()) flagB().set_implicit_omit();
if (flagC().is_bound()) flagC().set_implicit_omit();
if (flagD().is_bound()) flagD().set_implicit_omit();
if (flagE().is_bound()) flagE().set_implicit_omit();
if (flagF().is_bound()) flagF().set_implicit_omit();
if (flagG().is_bound()) flagG().set_implicit_omit();
if (flagH().is_bound()) flagH().set_implicit_omit();
if (flagI().is_bound()) flagI().set_implicit_omit();
if (flagJ().is_bound()) flagJ().set_implicit_omit();
if (flagK().is_bound()) flagK().set_implicit_omit();
if (flagL().is_bound()) flagL().set_implicit_omit();
if (flagM().is_bound()) flagM().set_implicit_omit();
if (flagN().is_bound()) flagN().set_implicit_omit();
if (flagsZ().is_bound()) flagsZ().set_implicit_omit();
if (!sourceIPv4Address().is_bound()) sourceIPv4Address() = OMIT_VALUE;
else sourceIPv4Address().set_implicit_omit();
if (!destinationIPv4Address().is_bound()) destinationIPv4Address() = OMIT_VALUE;
else destinationIPv4Address().set_implicit_omit();
if (!sourceIPv6Address().is_bound()) sourceIPv6Address() = OMIT_VALUE;
else sourceIPv6Address().set_implicit_omit();
if (!destinationIPv6Address().is_bound()) destinationIPv6Address() = OMIT_VALUE;
else destinationIPv6Address().set_implicit_omit();
if (!sourceAddressPrefixLength().is_bound()) sourceAddressPrefixLength() = OMIT_VALUE;
else sourceAddressPrefixLength().set_implicit_omit();
if (!destinationAddressPrefixLength().is_bound()) destinationAddressPrefixLength() = OMIT_VALUE;
else destinationAddressPrefixLength().set_implicit_omit();
if (!iPSecSecurityParameterIndex().is_bound()) iPSecSecurityParameterIndex() = OMIT_VALUE;
else iPSecSecurityParameterIndex().set_implicit_omit();
if (!protocolTypeNextHeader().is_bound()) protocolTypeNextHeader() = OMIT_VALUE;
else protocolTypeNextHeader().set_implicit_omit();
if (!startSourcePortRange().is_bound()) startSourcePortRange() = OMIT_VALUE;
else startSourcePortRange().set_implicit_omit();
if (!endSourcePortRange().is_bound()) endSourcePortRange() = OMIT_VALUE;
else endSourcePortRange().set_implicit_omit();
if (!startDestinationPortRange().is_bound()) startDestinationPortRange() = OMIT_VALUE;
else startDestinationPortRange().set_implicit_omit();
if (!endDestinationPortRange().is_bound()) endDestinationPortRange() = OMIT_VALUE;
else endDestinationPortRange().set_implicit_omit();
if (!typeOfService().is_bound()) typeOfService() = OMIT_VALUE;
else typeOfService().set_implicit_omit();
if (!flowLabel().is_bound()) flowLabel() = OMIT_VALUE;
else flowLabel().set_implicit_omit();
}

void RoutingFilter::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 (29<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RoutingFilter has 29 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) flagA().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) flagB().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) flagC().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flagD().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) flagE().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) flagF().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) flagG().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) flagH().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) flagI().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) flagJ().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) flagK().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) flagL().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) flagM().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) flagN().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) flagsZ().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) sourceIPv4Address().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) destinationIPv4Address().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) sourceIPv6Address().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) destinationIPv6Address().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) sourceAddressPrefixLength().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) destinationAddressPrefixLength().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) iPSecSecurityParameterIndex().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) protocolTypeNextHeader().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) startSourcePortRange().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) endSourcePortRange().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) startDestinationPortRange().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) endDestinationPortRange().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) typeOfService().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) flowLabel().set_param(*param.get_elem(28));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagB")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagB().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagE")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagE().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagF().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagG")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagG().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagH")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagH().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagJ")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagJ().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagK")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagK().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagsZ")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagsZ().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceIPv4Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceIPv4Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destinationIPv4Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destinationIPv4Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceIPv6Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceIPv6Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destinationIPv6Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destinationIPv6Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceAddressPrefixLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceAddressPrefixLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destinationAddressPrefixLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destinationAddressPrefixLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iPSecSecurityParameterIndex")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iPSecSecurityParameterIndex().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolTypeNextHeader")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolTypeNextHeader().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startSourcePortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startSourcePortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "endSourcePortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          endSourcePortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startDestinationPortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startDestinationPortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "endDestinationPortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          endDestinationPortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "typeOfService")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfService().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flowLabel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flowLabel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RoutingFilter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RoutingFilter");
  }
}

void RoutingFilter::encode_text(Text_Buf& text_buf) const
{
field_flagA.encode_text(text_buf);
field_flagB.encode_text(text_buf);
field_flagC.encode_text(text_buf);
field_flagD.encode_text(text_buf);
field_flagE.encode_text(text_buf);
field_flagF.encode_text(text_buf);
field_flagG.encode_text(text_buf);
field_flagH.encode_text(text_buf);
field_flagI.encode_text(text_buf);
field_flagJ.encode_text(text_buf);
field_flagK.encode_text(text_buf);
field_flagL.encode_text(text_buf);
field_flagM.encode_text(text_buf);
field_flagN.encode_text(text_buf);
field_flagsZ.encode_text(text_buf);
field_sourceIPv4Address.encode_text(text_buf);
field_destinationIPv4Address.encode_text(text_buf);
field_sourceIPv6Address.encode_text(text_buf);
field_destinationIPv6Address.encode_text(text_buf);
field_sourceAddressPrefixLength.encode_text(text_buf);
field_destinationAddressPrefixLength.encode_text(text_buf);
field_iPSecSecurityParameterIndex.encode_text(text_buf);
field_protocolTypeNextHeader.encode_text(text_buf);
field_startSourcePortRange.encode_text(text_buf);
field_endSourcePortRange.encode_text(text_buf);
field_startDestinationPortRange.encode_text(text_buf);
field_endDestinationPortRange.encode_text(text_buf);
field_typeOfService.encode_text(text_buf);
field_flowLabel.encode_text(text_buf);
}

void RoutingFilter::decode_text(Text_Buf& text_buf)
{
field_flagA.decode_text(text_buf);
field_flagB.decode_text(text_buf);
field_flagC.decode_text(text_buf);
field_flagD.decode_text(text_buf);
field_flagE.decode_text(text_buf);
field_flagF.decode_text(text_buf);
field_flagG.decode_text(text_buf);
field_flagH.decode_text(text_buf);
field_flagI.decode_text(text_buf);
field_flagJ.decode_text(text_buf);
field_flagK.decode_text(text_buf);
field_flagL.decode_text(text_buf);
field_flagM.decode_text(text_buf);
field_flagN.decode_text(text_buf);
field_flagsZ.decode_text(text_buf);
field_sourceIPv4Address.decode_text(text_buf);
field_destinationIPv4Address.decode_text(text_buf);
field_sourceIPv6Address.decode_text(text_buf);
field_destinationIPv6Address.decode_text(text_buf);
field_sourceAddressPrefixLength.decode_text(text_buf);
field_destinationAddressPrefixLength.decode_text(text_buf);
field_iPSecSecurityParameterIndex.decode_text(text_buf);
field_protocolTypeNextHeader.decode_text(text_buf);
field_startSourcePortRange.decode_text(text_buf);
field_endSourcePortRange.decode_text(text_buf);
field_startDestinationPortRange.decode_text(text_buf);
field_endDestinationPortRange.decode_text(text_buf);
field_typeOfService.decode_text(text_buf);
field_flowLabel.decode_text(text_buf);
}

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

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

int RoutingFilter::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagA.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagB.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagC.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagD.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagE.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagF.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagG.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagH.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagI.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_9_force_omit(9, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagJ.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_10_force_omit(10, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagK.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_11_force_omit(11, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagL.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_12_force_omit(12, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagM.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_13_force_omit(13, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_flagN.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_14_force_omit(14, force_omit, RoutingFilter_flagsZ_descr_.raw->forceomit);
  decoded_field_length = field_flagsZ.RAW_decode(RoutingFilter_flagsZ_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_flagA ==  bs_2){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_sourceIPv4Address = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, RoutingFilter_sourceIPv4Address_descr_.raw->forceomit);
  decoded_field_length = field_sourceIPv4Address().RAW_decode(RoutingFilter_sourceIPv4Address_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_sourceIPv4Address = 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_sourceIPv4Address=OMIT_VALUE;
  if (limit > 0 && field_flagB ==  bs_2){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_destinationIPv4Address = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, RoutingFilter_destinationIPv4Address_descr_.raw->forceomit);
  decoded_field_length = field_destinationIPv4Address().RAW_decode(RoutingFilter_destinationIPv4Address_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_destinationIPv4Address = 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_destinationIPv4Address=OMIT_VALUE;
  if (limit > 0 && field_flagC ==  bs_2){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_sourceIPv6Address = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, RoutingFilter_sourceIPv6Address_descr_.raw->forceomit);
  decoded_field_length = field_sourceIPv6Address().RAW_decode(RoutingFilter_sourceIPv6Address_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_sourceIPv6Address = 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_sourceIPv6Address=OMIT_VALUE;
  if (limit > 0 && field_flagD ==  bs_2){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_destinationIPv6Address = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, RoutingFilter_destinationIPv6Address_descr_.raw->forceomit);
  decoded_field_length = field_destinationIPv6Address().RAW_decode(RoutingFilter_destinationIPv6Address_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_destinationIPv6Address = 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_destinationIPv6Address=OMIT_VALUE;
  if (limit > 0 && field_flagE ==  bs_2){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_sourceAddressPrefixLength = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, RoutingFilter_sourceAddressPrefixLength_descr_.raw->forceomit);
  decoded_field_length = field_sourceAddressPrefixLength().RAW_decode(RoutingFilter_sourceAddressPrefixLength_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_sourceAddressPrefixLength = 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_sourceAddressPrefixLength=OMIT_VALUE;
  if (limit > 0 && field_flagF ==  bs_2){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_destinationAddressPrefixLength = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, RoutingFilter_destinationAddressPrefixLength_descr_.raw->forceomit);
  decoded_field_length = field_destinationAddressPrefixLength().RAW_decode(RoutingFilter_destinationAddressPrefixLength_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_destinationAddressPrefixLength = 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_destinationAddressPrefixLength=OMIT_VALUE;
  if (limit > 0 && field_flagG ==  bs_2){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_iPSecSecurityParameterIndex = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, RoutingFilter_iPSecSecurityParameterIndex_descr_.raw->forceomit);
  decoded_field_length = field_iPSecSecurityParameterIndex().RAW_decode(RoutingFilter_iPSecSecurityParameterIndex_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_iPSecSecurityParameterIndex = 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_iPSecSecurityParameterIndex=OMIT_VALUE;
  if (limit > 0 && field_flagH ==  bs_2){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_protocolTypeNextHeader = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, RoutingFilter_protocolTypeNextHeader_descr_.raw->forceomit);
  decoded_field_length = field_protocolTypeNextHeader().RAW_decode(RoutingFilter_protocolTypeNextHeader_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_protocolTypeNextHeader = 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_protocolTypeNextHeader=OMIT_VALUE;
  if (limit > 0 && field_flagI ==  bs_2){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_startSourcePortRange = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, RoutingFilter_startSourcePortRange_descr_.raw->forceomit);
  decoded_field_length = field_startSourcePortRange().RAW_decode(RoutingFilter_startSourcePortRange_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_startSourcePortRange = 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_startSourcePortRange=OMIT_VALUE;
  if (limit > 0 && field_flagJ ==  bs_2){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_endSourcePortRange = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, RoutingFilter_endSourcePortRange_descr_.raw->forceomit);
  decoded_field_length = field_endSourcePortRange().RAW_decode(RoutingFilter_endSourcePortRange_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_endSourcePortRange = 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_endSourcePortRange=OMIT_VALUE;
  if (limit > 0 && field_flagK ==  bs_2){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_startDestinationPortRange = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, RoutingFilter_startDestinationPortRange_descr_.raw->forceomit);
  decoded_field_length = field_startDestinationPortRange().RAW_decode(RoutingFilter_startDestinationPortRange_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_startDestinationPortRange = 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_startDestinationPortRange=OMIT_VALUE;
  if (limit > 0 && field_flagL ==  bs_2){
  if (force_omit != NULL && (*force_omit)(26)) {
    field_endDestinationPortRange = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, force_omit, RoutingFilter_endDestinationPortRange_descr_.raw->forceomit);
  decoded_field_length = field_endDestinationPortRange().RAW_decode(RoutingFilter_endDestinationPortRange_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_26_force_omit);
  if (decoded_field_length < 1) {
  field_endDestinationPortRange = 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_endDestinationPortRange=OMIT_VALUE;
  if (limit > 0 && field_flagM ==  bs_2){
  if (force_omit != NULL && (*force_omit)(27)) {
    field_typeOfService = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, force_omit, RoutingFilter_typeOfService_descr_.raw->forceomit);
  decoded_field_length = field_typeOfService().RAW_decode(RoutingFilter_typeOfService_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_27_force_omit);
  if (decoded_field_length < 1) {
  field_typeOfService = 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_typeOfService=OMIT_VALUE;
  if (limit > 0 && field_flagN ==  bs_2){
  if (force_omit != NULL && (*force_omit)(28)) {
    field_flowLabel = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_28_force_omit(28, force_omit, RoutingFilter_flowLabel_descr_.raw->forceomit);
  decoded_field_length = field_flowLabel().RAW_decode(RoutingFilter_flowLabel_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_28_force_omit);
  if (decoded_field_length < 1) {
  field_flowLabel = 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_flowLabel=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RoutingFilter::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 = 29;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(29);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, RoutingFilter_flagsZ_descr_.raw);
  if (field_sourceIPv4Address.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, RoutingFilter_sourceIPv4Address_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_destinationIPv4Address.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, RoutingFilter_destinationIPv4Address_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_sourceIPv6Address.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, RoutingFilter_sourceIPv6Address_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_destinationIPv6Address.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, RoutingFilter_destinationIPv6Address_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_sourceAddressPrefixLength.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, RoutingFilter_sourceAddressPrefixLength_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_destinationAddressPrefixLength.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, RoutingFilter_destinationAddressPrefixLength_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_iPSecSecurityParameterIndex.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, RoutingFilter_iPSecSecurityParameterIndex_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_protocolTypeNextHeader.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, RoutingFilter_protocolTypeNextHeader_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_startSourcePortRange.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, RoutingFilter_startSourcePortRange_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_endSourcePortRange.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, RoutingFilter_endSourcePortRange_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_startDestinationPortRange.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, RoutingFilter_startDestinationPortRange_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_endDestinationPortRange.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, RoutingFilter_endDestinationPortRange_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_typeOfService.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, RoutingFilter_typeOfService_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  if (field_flowLabel.ispresent()) {
  myleaf.body.node.nodes[28] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 28, RoutingFilter_flowLabel_descr_.raw);
  }
  else myleaf.body.node.nodes[28] = NULL;
  encoded_length += field_flagA.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_flagB.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_flagC.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_flagD.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_flagE.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_flagF.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_flagG.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_flagH.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_flagI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_flagJ.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_flagK.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[10]);
  encoded_length += field_flagL.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[11]);
  encoded_length += field_flagM.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[12]);
  encoded_length += field_flagN.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[13]);
  encoded_length += field_flagsZ.RAW_encode(RoutingFilter_flagsZ_descr_, *myleaf.body.node.nodes[14]);
  if (field_sourceIPv4Address.ispresent()) {
  encoded_length += field_sourceIPv4Address().RAW_encode(RoutingFilter_sourceIPv4Address_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_destinationIPv4Address.ispresent()) {
  encoded_length += field_destinationIPv4Address().RAW_encode(RoutingFilter_destinationIPv4Address_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_sourceIPv6Address.ispresent()) {
  encoded_length += field_sourceIPv6Address().RAW_encode(RoutingFilter_sourceIPv6Address_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_destinationIPv6Address.ispresent()) {
  encoded_length += field_destinationIPv6Address().RAW_encode(RoutingFilter_destinationIPv6Address_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_sourceAddressPrefixLength.ispresent()) {
  encoded_length += field_sourceAddressPrefixLength().RAW_encode(RoutingFilter_sourceAddressPrefixLength_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_destinationAddressPrefixLength.ispresent()) {
  encoded_length += field_destinationAddressPrefixLength().RAW_encode(RoutingFilter_destinationAddressPrefixLength_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_iPSecSecurityParameterIndex.ispresent()) {
  encoded_length += field_iPSecSecurityParameterIndex().RAW_encode(RoutingFilter_iPSecSecurityParameterIndex_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_protocolTypeNextHeader.ispresent()) {
  encoded_length += field_protocolTypeNextHeader().RAW_encode(RoutingFilter_protocolTypeNextHeader_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_startSourcePortRange.ispresent()) {
  encoded_length += field_startSourcePortRange().RAW_encode(RoutingFilter_startSourcePortRange_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_endSourcePortRange.ispresent()) {
  encoded_length += field_endSourcePortRange().RAW_encode(RoutingFilter_endSourcePortRange_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_startDestinationPortRange.ispresent()) {
  encoded_length += field_startDestinationPortRange().RAW_encode(RoutingFilter_startDestinationPortRange_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_endDestinationPortRange.ispresent()) {
  encoded_length += field_endDestinationPortRange().RAW_encode(RoutingFilter_endDestinationPortRange_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_typeOfService.ispresent()) {
  encoded_length += field_typeOfService().RAW_encode(RoutingFilter_typeOfService_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_flowLabel.ispresent()) {
  encoded_length += field_flowLabel().RAW_encode(RoutingFilter_flowLabel_descr_, *myleaf.body.node.nodes[28]);
  }
  if (field_sourceIPv4Address.ispresent() && (field_flagA !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_destinationIPv4Address.ispresent() && (field_flagB !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_sourceIPv6Address.ispresent() && (field_flagC !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_destinationIPv6Address.ispresent() && (field_flagD !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={3};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_sourceAddressPrefixLength.ispresent() && (field_flagE !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={4};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_destinationAddressPrefixLength.ispresent() && (field_flagF !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={5};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_iPSecSecurityParameterIndex.ispresent() && (field_flagG !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={6};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_protocolTypeNextHeader.ispresent() && (field_flagH !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={7};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_startSourcePortRange.ispresent() && (field_flagI !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={8};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_endSourcePortRange.ispresent() && (field_flagJ !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={9};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_startDestinationPortRange.ispresent() && (field_flagK !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={10};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_endDestinationPortRange.ispresent() && (field_flagL !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={11};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_typeOfService.ispresent() && (field_flagM !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={12};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_flowLabel.ispresent() && (field_flagN !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={13};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct RoutingFilter_template::single_value_struct {
BITSTRING_template field_flagA;
BITSTRING_template field_flagB;
BITSTRING_template field_flagC;
BITSTRING_template field_flagD;
BITSTRING_template field_flagE;
BITSTRING_template field_flagF;
BITSTRING_template field_flagG;
BITSTRING_template field_flagH;
BITSTRING_template field_flagI;
BITSTRING_template field_flagJ;
BITSTRING_template field_flagK;
BITSTRING_template field_flagL;
BITSTRING_template field_flagM;
BITSTRING_template field_flagN;
BITSTRING_template field_flagsZ;
OCTETSTRING_template field_sourceIPv4Address;
OCTETSTRING_template field_destinationIPv4Address;
OCTETSTRING_template field_sourceIPv6Address;
OCTETSTRING_template field_destinationIPv6Address;
OCTETSTRING_template field_sourceAddressPrefixLength;
OCTETSTRING_template field_destinationAddressPrefixLength;
OCTETSTRING_template field_iPSecSecurityParameterIndex;
OCTETSTRING_template field_protocolTypeNextHeader;
OCTETSTRING_template field_startSourcePortRange;
OCTETSTRING_template field_endSourcePortRange;
OCTETSTRING_template field_startDestinationPortRange;
OCTETSTRING_template field_endDestinationPortRange;
OCTETSTRING_template field_typeOfService;
OCTETSTRING_template field_flowLabel;
};

void RoutingFilter_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_flagA = ANY_VALUE;
single_value->field_flagB = ANY_VALUE;
single_value->field_flagC = ANY_VALUE;
single_value->field_flagD = ANY_VALUE;
single_value->field_flagE = ANY_VALUE;
single_value->field_flagF = ANY_VALUE;
single_value->field_flagG = ANY_VALUE;
single_value->field_flagH = ANY_VALUE;
single_value->field_flagI = ANY_VALUE;
single_value->field_flagJ = ANY_VALUE;
single_value->field_flagK = ANY_VALUE;
single_value->field_flagL = ANY_VALUE;
single_value->field_flagM = ANY_VALUE;
single_value->field_flagN = ANY_VALUE;
single_value->field_flagsZ = ANY_VALUE;
single_value->field_sourceIPv4Address = ANY_OR_OMIT;
single_value->field_destinationIPv4Address = ANY_OR_OMIT;
single_value->field_sourceIPv6Address = ANY_OR_OMIT;
single_value->field_destinationIPv6Address = ANY_OR_OMIT;
single_value->field_sourceAddressPrefixLength = ANY_OR_OMIT;
single_value->field_destinationAddressPrefixLength = ANY_OR_OMIT;
single_value->field_iPSecSecurityParameterIndex = ANY_OR_OMIT;
single_value->field_protocolTypeNextHeader = ANY_OR_OMIT;
single_value->field_startSourcePortRange = ANY_OR_OMIT;
single_value->field_endSourcePortRange = ANY_OR_OMIT;
single_value->field_startDestinationPortRange = ANY_OR_OMIT;
single_value->field_endDestinationPortRange = ANY_OR_OMIT;
single_value->field_typeOfService = ANY_OR_OMIT;
single_value->field_flowLabel = ANY_OR_OMIT;
}
}
}

void RoutingFilter_template::copy_value(const RoutingFilter& other_value)
{
single_value = new single_value_struct;
if (other_value.flagA().is_bound()) {
  single_value->field_flagA = other_value.flagA();
} else {
  single_value->field_flagA.clean_up();
}
if (other_value.flagB().is_bound()) {
  single_value->field_flagB = other_value.flagB();
} else {
  single_value->field_flagB.clean_up();
}
if (other_value.flagC().is_bound()) {
  single_value->field_flagC = other_value.flagC();
} else {
  single_value->field_flagC.clean_up();
}
if (other_value.flagD().is_bound()) {
  single_value->field_flagD = other_value.flagD();
} else {
  single_value->field_flagD.clean_up();
}
if (other_value.flagE().is_bound()) {
  single_value->field_flagE = other_value.flagE();
} else {
  single_value->field_flagE.clean_up();
}
if (other_value.flagF().is_bound()) {
  single_value->field_flagF = other_value.flagF();
} else {
  single_value->field_flagF.clean_up();
}
if (other_value.flagG().is_bound()) {
  single_value->field_flagG = other_value.flagG();
} else {
  single_value->field_flagG.clean_up();
}
if (other_value.flagH().is_bound()) {
  single_value->field_flagH = other_value.flagH();
} else {
  single_value->field_flagH.clean_up();
}
if (other_value.flagI().is_bound()) {
  single_value->field_flagI = other_value.flagI();
} else {
  single_value->field_flagI.clean_up();
}
if (other_value.flagJ().is_bound()) {
  single_value->field_flagJ = other_value.flagJ();
} else {
  single_value->field_flagJ.clean_up();
}
if (other_value.flagK().is_bound()) {
  single_value->field_flagK = other_value.flagK();
} else {
  single_value->field_flagK.clean_up();
}
if (other_value.flagL().is_bound()) {
  single_value->field_flagL = other_value.flagL();
} else {
  single_value->field_flagL.clean_up();
}
if (other_value.flagM().is_bound()) {
  single_value->field_flagM = other_value.flagM();
} else {
  single_value->field_flagM.clean_up();
}
if (other_value.flagN().is_bound()) {
  single_value->field_flagN = other_value.flagN();
} else {
  single_value->field_flagN.clean_up();
}
if (other_value.flagsZ().is_bound()) {
  single_value->field_flagsZ = other_value.flagsZ();
} else {
  single_value->field_flagsZ.clean_up();
}
if (other_value.sourceIPv4Address().is_bound()) {
  if (other_value.sourceIPv4Address().ispresent()) single_value->field_sourceIPv4Address = other_value.sourceIPv4Address()();
  else single_value->field_sourceIPv4Address = OMIT_VALUE;
} else {
  single_value->field_sourceIPv4Address.clean_up();
}
if (other_value.destinationIPv4Address().is_bound()) {
  if (other_value.destinationIPv4Address().ispresent()) single_value->field_destinationIPv4Address = other_value.destinationIPv4Address()();
  else single_value->field_destinationIPv4Address = OMIT_VALUE;
} else {
  single_value->field_destinationIPv4Address.clean_up();
}
if (other_value.sourceIPv6Address().is_bound()) {
  if (other_value.sourceIPv6Address().ispresent()) single_value->field_sourceIPv6Address = other_value.sourceIPv6Address()();
  else single_value->field_sourceIPv6Address = OMIT_VALUE;
} else {
  single_value->field_sourceIPv6Address.clean_up();
}
if (other_value.destinationIPv6Address().is_bound()) {
  if (other_value.destinationIPv6Address().ispresent()) single_value->field_destinationIPv6Address = other_value.destinationIPv6Address()();
  else single_value->field_destinationIPv6Address = OMIT_VALUE;
} else {
  single_value->field_destinationIPv6Address.clean_up();
}
if (other_value.sourceAddressPrefixLength().is_bound()) {
  if (other_value.sourceAddressPrefixLength().ispresent()) single_value->field_sourceAddressPrefixLength = other_value.sourceAddressPrefixLength()();
  else single_value->field_sourceAddressPrefixLength = OMIT_VALUE;
} else {
  single_value->field_sourceAddressPrefixLength.clean_up();
}
if (other_value.destinationAddressPrefixLength().is_bound()) {
  if (other_value.destinationAddressPrefixLength().ispresent()) single_value->field_destinationAddressPrefixLength = other_value.destinationAddressPrefixLength()();
  else single_value->field_destinationAddressPrefixLength = OMIT_VALUE;
} else {
  single_value->field_destinationAddressPrefixLength.clean_up();
}
if (other_value.iPSecSecurityParameterIndex().is_bound()) {
  if (other_value.iPSecSecurityParameterIndex().ispresent()) single_value->field_iPSecSecurityParameterIndex = other_value.iPSecSecurityParameterIndex()();
  else single_value->field_iPSecSecurityParameterIndex = OMIT_VALUE;
} else {
  single_value->field_iPSecSecurityParameterIndex.clean_up();
}
if (other_value.protocolTypeNextHeader().is_bound()) {
  if (other_value.protocolTypeNextHeader().ispresent()) single_value->field_protocolTypeNextHeader = other_value.protocolTypeNextHeader()();
  else single_value->field_protocolTypeNextHeader = OMIT_VALUE;
} else {
  single_value->field_protocolTypeNextHeader.clean_up();
}
if (other_value.startSourcePortRange().is_bound()) {
  if (other_value.startSourcePortRange().ispresent()) single_value->field_startSourcePortRange = other_value.startSourcePortRange()();
  else single_value->field_startSourcePortRange = OMIT_VALUE;
} else {
  single_value->field_startSourcePortRange.clean_up();
}
if (other_value.endSourcePortRange().is_bound()) {
  if (other_value.endSourcePortRange().ispresent()) single_value->field_endSourcePortRange = other_value.endSourcePortRange()();
  else single_value->field_endSourcePortRange = OMIT_VALUE;
} else {
  single_value->field_endSourcePortRange.clean_up();
}
if (other_value.startDestinationPortRange().is_bound()) {
  if (other_value.startDestinationPortRange().ispresent()) single_value->field_startDestinationPortRange = other_value.startDestinationPortRange()();
  else single_value->field_startDestinationPortRange = OMIT_VALUE;
} else {
  single_value->field_startDestinationPortRange.clean_up();
}
if (other_value.endDestinationPortRange().is_bound()) {
  if (other_value.endDestinationPortRange().ispresent()) single_value->field_endDestinationPortRange = other_value.endDestinationPortRange()();
  else single_value->field_endDestinationPortRange = OMIT_VALUE;
} else {
  single_value->field_endDestinationPortRange.clean_up();
}
if (other_value.typeOfService().is_bound()) {
  if (other_value.typeOfService().ispresent()) single_value->field_typeOfService = other_value.typeOfService()();
  else single_value->field_typeOfService = OMIT_VALUE;
} else {
  single_value->field_typeOfService.clean_up();
}
if (other_value.flowLabel().is_bound()) {
  if (other_value.flowLabel().ispresent()) single_value->field_flowLabel = other_value.flowLabel()();
  else single_value->field_flowLabel = OMIT_VALUE;
} else {
  single_value->field_flowLabel.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RoutingFilter_template::copy_template(const RoutingFilter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.flagA().get_selection()) {
single_value->field_flagA = other_value.flagA();
} else {
single_value->field_flagA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagB().get_selection()) {
single_value->field_flagB = other_value.flagB();
} else {
single_value->field_flagB.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagC().get_selection()) {
single_value->field_flagC = other_value.flagC();
} else {
single_value->field_flagC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagD().get_selection()) {
single_value->field_flagD = other_value.flagD();
} else {
single_value->field_flagD.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagE().get_selection()) {
single_value->field_flagE = other_value.flagE();
} else {
single_value->field_flagE.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagF().get_selection()) {
single_value->field_flagF = other_value.flagF();
} else {
single_value->field_flagF.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagG().get_selection()) {
single_value->field_flagG = other_value.flagG();
} else {
single_value->field_flagG.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagH().get_selection()) {
single_value->field_flagH = other_value.flagH();
} else {
single_value->field_flagH.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagI().get_selection()) {
single_value->field_flagI = other_value.flagI();
} else {
single_value->field_flagI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagJ().get_selection()) {
single_value->field_flagJ = other_value.flagJ();
} else {
single_value->field_flagJ.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagK().get_selection()) {
single_value->field_flagK = other_value.flagK();
} else {
single_value->field_flagK.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagL().get_selection()) {
single_value->field_flagL = other_value.flagL();
} else {
single_value->field_flagL.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagM().get_selection()) {
single_value->field_flagM = other_value.flagM();
} else {
single_value->field_flagM.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagN().get_selection()) {
single_value->field_flagN = other_value.flagN();
} else {
single_value->field_flagN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flagsZ().get_selection()) {
single_value->field_flagsZ = other_value.flagsZ();
} else {
single_value->field_flagsZ.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceIPv4Address().get_selection()) {
single_value->field_sourceIPv4Address = other_value.sourceIPv4Address();
} else {
single_value->field_sourceIPv4Address.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destinationIPv4Address().get_selection()) {
single_value->field_destinationIPv4Address = other_value.destinationIPv4Address();
} else {
single_value->field_destinationIPv4Address.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceIPv6Address().get_selection()) {
single_value->field_sourceIPv6Address = other_value.sourceIPv6Address();
} else {
single_value->field_sourceIPv6Address.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destinationIPv6Address().get_selection()) {
single_value->field_destinationIPv6Address = other_value.destinationIPv6Address();
} else {
single_value->field_destinationIPv6Address.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceAddressPrefixLength().get_selection()) {
single_value->field_sourceAddressPrefixLength = other_value.sourceAddressPrefixLength();
} else {
single_value->field_sourceAddressPrefixLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destinationAddressPrefixLength().get_selection()) {
single_value->field_destinationAddressPrefixLength = other_value.destinationAddressPrefixLength();
} else {
single_value->field_destinationAddressPrefixLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iPSecSecurityParameterIndex().get_selection()) {
single_value->field_iPSecSecurityParameterIndex = other_value.iPSecSecurityParameterIndex();
} else {
single_value->field_iPSecSecurityParameterIndex.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protocolTypeNextHeader().get_selection()) {
single_value->field_protocolTypeNextHeader = other_value.protocolTypeNextHeader();
} else {
single_value->field_protocolTypeNextHeader.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.startSourcePortRange().get_selection()) {
single_value->field_startSourcePortRange = other_value.startSourcePortRange();
} else {
single_value->field_startSourcePortRange.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.endSourcePortRange().get_selection()) {
single_value->field_endSourcePortRange = other_value.endSourcePortRange();
} else {
single_value->field_endSourcePortRange.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.startDestinationPortRange().get_selection()) {
single_value->field_startDestinationPortRange = other_value.startDestinationPortRange();
} else {
single_value->field_startDestinationPortRange.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.endDestinationPortRange().get_selection()) {
single_value->field_endDestinationPortRange = other_value.endDestinationPortRange();
} else {
single_value->field_endDestinationPortRange.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.typeOfService().get_selection()) {
single_value->field_typeOfService = other_value.typeOfService();
} else {
single_value->field_typeOfService.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flowLabel().get_selection()) {
single_value->field_flowLabel = other_value.flowLabel();
} else {
single_value->field_flowLabel.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 RoutingFilter_template[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 RoutingFilter_template(*other_value.implication_.precondition);
implication_.implied_template = new RoutingFilter_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
break;
}
set_selection(other_value);
}

RoutingFilter_template::RoutingFilter_template()
{
}

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

RoutingFilter_template::RoutingFilter_template(const RoutingFilter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RoutingFilter_template::match(const RoutingFilter& 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.flagA().is_bound()) return FALSE;
if(!single_value->field_flagA.match(other_value.flagA(), legacy))return FALSE;
if(!other_value.flagB().is_bound()) return FALSE;
if(!single_value->field_flagB.match(other_value.flagB(), legacy))return FALSE;
if(!other_value.flagC().is_bound()) return FALSE;
if(!single_value->field_flagC.match(other_value.flagC(), legacy))return FALSE;
if(!other_value.flagD().is_bound()) return FALSE;
if(!single_value->field_flagD.match(other_value.flagD(), legacy))return FALSE;
if(!other_value.flagE().is_bound()) return FALSE;
if(!single_value->field_flagE.match(other_value.flagE(), legacy))return FALSE;
if(!other_value.flagF().is_bound()) return FALSE;
if(!single_value->field_flagF.match(other_value.flagF(), legacy))return FALSE;
if(!other_value.flagG().is_bound()) return FALSE;
if(!single_value->field_flagG.match(other_value.flagG(), legacy))return FALSE;
if(!other_value.flagH().is_bound()) return FALSE;
if(!single_value->field_flagH.match(other_value.flagH(), legacy))return FALSE;
if(!other_value.flagI().is_bound()) return FALSE;
if(!single_value->field_flagI.match(other_value.flagI(), legacy))return FALSE;
if(!other_value.flagJ().is_bound()) return FALSE;
if(!single_value->field_flagJ.match(other_value.flagJ(), legacy))return FALSE;
if(!other_value.flagK().is_bound()) return FALSE;
if(!single_value->field_flagK.match(other_value.flagK(), legacy))return FALSE;
if(!other_value.flagL().is_bound()) return FALSE;
if(!single_value->field_flagL.match(other_value.flagL(), legacy))return FALSE;
if(!other_value.flagM().is_bound()) return FALSE;
if(!single_value->field_flagM.match(other_value.flagM(), legacy))return FALSE;
if(!other_value.flagN().is_bound()) return FALSE;
if(!single_value->field_flagN.match(other_value.flagN(), legacy))return FALSE;
if(!other_value.flagsZ().is_bound()) return FALSE;
if(!single_value->field_flagsZ.match(other_value.flagsZ(), legacy))return FALSE;
if(!other_value.sourceIPv4Address().is_bound()) return FALSE;
if((other_value.sourceIPv4Address().ispresent() ? !single_value->field_sourceIPv4Address.match((const OCTETSTRING&)other_value.sourceIPv4Address(), legacy) : !single_value->field_sourceIPv4Address.match_omit(legacy)))return FALSE;
if(!other_value.destinationIPv4Address().is_bound()) return FALSE;
if((other_value.destinationIPv4Address().ispresent() ? !single_value->field_destinationIPv4Address.match((const OCTETSTRING&)other_value.destinationIPv4Address(), legacy) : !single_value->field_destinationIPv4Address.match_omit(legacy)))return FALSE;
if(!other_value.sourceIPv6Address().is_bound()) return FALSE;
if((other_value.sourceIPv6Address().ispresent() ? !single_value->field_sourceIPv6Address.match((const OCTETSTRING&)other_value.sourceIPv6Address(), legacy) : !single_value->field_sourceIPv6Address.match_omit(legacy)))return FALSE;
if(!other_value.destinationIPv6Address().is_bound()) return FALSE;
if((other_value.destinationIPv6Address().ispresent() ? !single_value->field_destinationIPv6Address.match((const OCTETSTRING&)other_value.destinationIPv6Address(), legacy) : !single_value->field_destinationIPv6Address.match_omit(legacy)))return FALSE;
if(!other_value.sourceAddressPrefixLength().is_bound()) return FALSE;
if((other_value.sourceAddressPrefixLength().ispresent() ? !single_value->field_sourceAddressPrefixLength.match((const OCTETSTRING&)other_value.sourceAddressPrefixLength(), legacy) : !single_value->field_sourceAddressPrefixLength.match_omit(legacy)))return FALSE;
if(!other_value.destinationAddressPrefixLength().is_bound()) return FALSE;
if((other_value.destinationAddressPrefixLength().ispresent() ? !single_value->field_destinationAddressPrefixLength.match((const OCTETSTRING&)other_value.destinationAddressPrefixLength(), legacy) : !single_value->field_destinationAddressPrefixLength.match_omit(legacy)))return FALSE;
if(!other_value.iPSecSecurityParameterIndex().is_bound()) return FALSE;
if((other_value.iPSecSecurityParameterIndex().ispresent() ? !single_value->field_iPSecSecurityParameterIndex.match((const OCTETSTRING&)other_value.iPSecSecurityParameterIndex(), legacy) : !single_value->field_iPSecSecurityParameterIndex.match_omit(legacy)))return FALSE;
if(!other_value.protocolTypeNextHeader().is_bound()) return FALSE;
if((other_value.protocolTypeNextHeader().ispresent() ? !single_value->field_protocolTypeNextHeader.match((const OCTETSTRING&)other_value.protocolTypeNextHeader(), legacy) : !single_value->field_protocolTypeNextHeader.match_omit(legacy)))return FALSE;
if(!other_value.startSourcePortRange().is_bound()) return FALSE;
if((other_value.startSourcePortRange().ispresent() ? !single_value->field_startSourcePortRange.match((const OCTETSTRING&)other_value.startSourcePortRange(), legacy) : !single_value->field_startSourcePortRange.match_omit(legacy)))return FALSE;
if(!other_value.endSourcePortRange().is_bound()) return FALSE;
if((other_value.endSourcePortRange().ispresent() ? !single_value->field_endSourcePortRange.match((const OCTETSTRING&)other_value.endSourcePortRange(), legacy) : !single_value->field_endSourcePortRange.match_omit(legacy)))return FALSE;
if(!other_value.startDestinationPortRange().is_bound()) return FALSE;
if((other_value.startDestinationPortRange().ispresent() ? !single_value->field_startDestinationPortRange.match((const OCTETSTRING&)other_value.startDestinationPortRange(), legacy) : !single_value->field_startDestinationPortRange.match_omit(legacy)))return FALSE;
if(!other_value.endDestinationPortRange().is_bound()) return FALSE;
if((other_value.endDestinationPortRange().ispresent() ? !single_value->field_endDestinationPortRange.match((const OCTETSTRING&)other_value.endDestinationPortRange(), legacy) : !single_value->field_endDestinationPortRange.match_omit(legacy)))return FALSE;
if(!other_value.typeOfService().is_bound()) return FALSE;
if((other_value.typeOfService().ispresent() ? !single_value->field_typeOfService.match((const OCTETSTRING&)other_value.typeOfService(), legacy) : !single_value->field_typeOfService.match_omit(legacy)))return FALSE;
if(!other_value.flowLabel().is_bound()) return FALSE;
if((other_value.flowLabel().ispresent() ? !single_value->field_flowLabel.match((const OCTETSTRING&)other_value.flowLabel(), legacy) : !single_value->field_flowLabel.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
}
return FALSE;
}

boolean RoutingFilter_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_flagA.is_bound()
 || single_value->field_flagB.is_bound()
 || single_value->field_flagC.is_bound()
 || single_value->field_flagD.is_bound()
 || single_value->field_flagE.is_bound()
 || single_value->field_flagF.is_bound()
 || single_value->field_flagG.is_bound()
 || single_value->field_flagH.is_bound()
 || single_value->field_flagI.is_bound()
 || single_value->field_flagJ.is_bound()
 || single_value->field_flagK.is_bound()
 || single_value->field_flagL.is_bound()
 || single_value->field_flagM.is_bound()
 || single_value->field_flagN.is_bound()
 || single_value->field_flagsZ.is_bound()
 || (single_value->field_sourceIPv4Address.is_omit() || single_value->field_sourceIPv4Address.is_bound())
 || (single_value->field_destinationIPv4Address.is_omit() || single_value->field_destinationIPv4Address.is_bound())
 || (single_value->field_sourceIPv6Address.is_omit() || single_value->field_sourceIPv6Address.is_bound())
 || (single_value->field_destinationIPv6Address.is_omit() || single_value->field_destinationIPv6Address.is_bound())
 || (single_value->field_sourceAddressPrefixLength.is_omit() || single_value->field_sourceAddressPrefixLength.is_bound())
 || (single_value->field_destinationAddressPrefixLength.is_omit() || single_value->field_destinationAddressPrefixLength.is_bound())
 || (single_value->field_iPSecSecurityParameterIndex.is_omit() || single_value->field_iPSecSecurityParameterIndex.is_bound())
 || (single_value->field_protocolTypeNextHeader.is_omit() || single_value->field_protocolTypeNextHeader.is_bound())
 || (single_value->field_startSourcePortRange.is_omit() || single_value->field_startSourcePortRange.is_bound())
 || (single_value->field_endSourcePortRange.is_omit() || single_value->field_endSourcePortRange.is_bound())
 || (single_value->field_startDestinationPortRange.is_omit() || single_value->field_startDestinationPortRange.is_bound())
 || (single_value->field_endDestinationPortRange.is_omit() || single_value->field_endDestinationPortRange.is_bound())
 || (single_value->field_typeOfService.is_omit() || single_value->field_typeOfService.is_bound())
 || (single_value->field_flowLabel.is_omit() || single_value->field_flowLabel.is_bound());
}

boolean RoutingFilter_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_flagA.is_value()
 && single_value->field_flagB.is_value()
 && single_value->field_flagC.is_value()
 && single_value->field_flagD.is_value()
 && single_value->field_flagE.is_value()
 && single_value->field_flagF.is_value()
 && single_value->field_flagG.is_value()
 && single_value->field_flagH.is_value()
 && single_value->field_flagI.is_value()
 && single_value->field_flagJ.is_value()
 && single_value->field_flagK.is_value()
 && single_value->field_flagL.is_value()
 && single_value->field_flagM.is_value()
 && single_value->field_flagN.is_value()
 && single_value->field_flagsZ.is_value()
 && (single_value->field_sourceIPv4Address.is_omit() || single_value->field_sourceIPv4Address.is_value())
 && (single_value->field_destinationIPv4Address.is_omit() || single_value->field_destinationIPv4Address.is_value())
 && (single_value->field_sourceIPv6Address.is_omit() || single_value->field_sourceIPv6Address.is_value())
 && (single_value->field_destinationIPv6Address.is_omit() || single_value->field_destinationIPv6Address.is_value())
 && (single_value->field_sourceAddressPrefixLength.is_omit() || single_value->field_sourceAddressPrefixLength.is_value())
 && (single_value->field_destinationAddressPrefixLength.is_omit() || single_value->field_destinationAddressPrefixLength.is_value())
 && (single_value->field_iPSecSecurityParameterIndex.is_omit() || single_value->field_iPSecSecurityParameterIndex.is_value())
 && (single_value->field_protocolTypeNextHeader.is_omit() || single_value->field_protocolTypeNextHeader.is_value())
 && (single_value->field_startSourcePortRange.is_omit() || single_value->field_startSourcePortRange.is_value())
 && (single_value->field_endSourcePortRange.is_omit() || single_value->field_endSourcePortRange.is_value())
 && (single_value->field_startDestinationPortRange.is_omit() || single_value->field_startDestinationPortRange.is_value())
 && (single_value->field_endDestinationPortRange.is_omit() || single_value->field_endDestinationPortRange.is_value())
 && (single_value->field_typeOfService.is_omit() || single_value->field_typeOfService.is_value())
 && (single_value->field_flowLabel.is_omit() || single_value->field_flowLabel.is_value());
}

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

RoutingFilter RoutingFilter_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
RoutingFilter ret_val;
if (single_value->field_flagA.is_bound()) {
ret_val.flagA() = single_value->field_flagA.valueof();
}
if (single_value->field_flagB.is_bound()) {
ret_val.flagB() = single_value->field_flagB.valueof();
}
if (single_value->field_flagC.is_bound()) {
ret_val.flagC() = single_value->field_flagC.valueof();
}
if (single_value->field_flagD.is_bound()) {
ret_val.flagD() = single_value->field_flagD.valueof();
}
if (single_value->field_flagE.is_bound()) {
ret_val.flagE() = single_value->field_flagE.valueof();
}
if (single_value->field_flagF.is_bound()) {
ret_val.flagF() = single_value->field_flagF.valueof();
}
if (single_value->field_flagG.is_bound()) {
ret_val.flagG() = single_value->field_flagG.valueof();
}
if (single_value->field_flagH.is_bound()) {
ret_val.flagH() = single_value->field_flagH.valueof();
}
if (single_value->field_flagI.is_bound()) {
ret_val.flagI() = single_value->field_flagI.valueof();
}
if (single_value->field_flagJ.is_bound()) {
ret_val.flagJ() = single_value->field_flagJ.valueof();
}
if (single_value->field_flagK.is_bound()) {
ret_val.flagK() = single_value->field_flagK.valueof();
}
if (single_value->field_flagL.is_bound()) {
ret_val.flagL() = single_value->field_flagL.valueof();
}
if (single_value->field_flagM.is_bound()) {
ret_val.flagM() = single_value->field_flagM.valueof();
}
if (single_value->field_flagN.is_bound()) {
ret_val.flagN() = single_value->field_flagN.valueof();
}
if (single_value->field_flagsZ.is_bound()) {
ret_val.flagsZ() = single_value->field_flagsZ.valueof();
}
if (single_value->field_sourceIPv4Address.is_omit()) ret_val.sourceIPv4Address() = OMIT_VALUE;
else if (single_value->field_sourceIPv4Address.is_bound()) {
ret_val.sourceIPv4Address() = single_value->field_sourceIPv4Address.valueof();
}
if (single_value->field_destinationIPv4Address.is_omit()) ret_val.destinationIPv4Address() = OMIT_VALUE;
else if (single_value->field_destinationIPv4Address.is_bound()) {
ret_val.destinationIPv4Address() = single_value->field_destinationIPv4Address.valueof();
}
if (single_value->field_sourceIPv6Address.is_omit()) ret_val.sourceIPv6Address() = OMIT_VALUE;
else if (single_value->field_sourceIPv6Address.is_bound()) {
ret_val.sourceIPv6Address() = single_value->field_sourceIPv6Address.valueof();
}
if (single_value->field_destinationIPv6Address.is_omit()) ret_val.destinationIPv6Address() = OMIT_VALUE;
else if (single_value->field_destinationIPv6Address.is_bound()) {
ret_val.destinationIPv6Address() = single_value->field_destinationIPv6Address.valueof();
}
if (single_value->field_sourceAddressPrefixLength.is_omit()) ret_val.sourceAddressPrefixLength() = OMIT_VALUE;
else if (single_value->field_sourceAddressPrefixLength.is_bound()) {
ret_val.sourceAddressPrefixLength() = single_value->field_sourceAddressPrefixLength.valueof();
}
if (single_value->field_destinationAddressPrefixLength.is_omit()) ret_val.destinationAddressPrefixLength() = OMIT_VALUE;
else if (single_value->field_destinationAddressPrefixLength.is_bound()) {
ret_val.destinationAddressPrefixLength() = single_value->field_destinationAddressPrefixLength.valueof();
}
if (single_value->field_iPSecSecurityParameterIndex.is_omit()) ret_val.iPSecSecurityParameterIndex() = OMIT_VALUE;
else if (single_value->field_iPSecSecurityParameterIndex.is_bound()) {
ret_val.iPSecSecurityParameterIndex() = single_value->field_iPSecSecurityParameterIndex.valueof();
}
if (single_value->field_protocolTypeNextHeader.is_omit()) ret_val.protocolTypeNextHeader() = OMIT_VALUE;
else if (single_value->field_protocolTypeNextHeader.is_bound()) {
ret_val.protocolTypeNextHeader() = single_value->field_protocolTypeNextHeader.valueof();
}
if (single_value->field_startSourcePortRange.is_omit()) ret_val.startSourcePortRange() = OMIT_VALUE;
else if (single_value->field_startSourcePortRange.is_bound()) {
ret_val.startSourcePortRange() = single_value->field_startSourcePortRange.valueof();
}
if (single_value->field_endSourcePortRange.is_omit()) ret_val.endSourcePortRange() = OMIT_VALUE;
else if (single_value->field_endSourcePortRange.is_bound()) {
ret_val.endSourcePortRange() = single_value->field_endSourcePortRange.valueof();
}
if (single_value->field_startDestinationPortRange.is_omit()) ret_val.startDestinationPortRange() = OMIT_VALUE;
else if (single_value->field_startDestinationPortRange.is_bound()) {
ret_val.startDestinationPortRange() = single_value->field_startDestinationPortRange.valueof();
}
if (single_value->field_endDestinationPortRange.is_omit()) ret_val.endDestinationPortRange() = OMIT_VALUE;
else if (single_value->field_endDestinationPortRange.is_bound()) {
ret_val.endDestinationPortRange() = single_value->field_endDestinationPortRange.valueof();
}
if (single_value->field_typeOfService.is_omit()) ret_val.typeOfService() = OMIT_VALUE;
else if (single_value->field_typeOfService.is_bound()) {
ret_val.typeOfService() = single_value->field_typeOfService.valueof();
}
if (single_value->field_flowLabel.is_omit()) ret_val.flowLabel() = OMIT_VALUE;
else if (single_value->field_flowLabel.is_bound()) {
ret_val.flowLabel() = single_value->field_flowLabel.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RoutingFilter_template::flagA()
{
set_specific();
return single_value->field_flagA;
}

const BITSTRING_template& RoutingFilter_template::flagA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagA of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagA;
}

BITSTRING_template& RoutingFilter_template::flagB()
{
set_specific();
return single_value->field_flagB;
}

const BITSTRING_template& RoutingFilter_template::flagB() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagB of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagB;
}

BITSTRING_template& RoutingFilter_template::flagC()
{
set_specific();
return single_value->field_flagC;
}

const BITSTRING_template& RoutingFilter_template::flagC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagC of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagC;
}

BITSTRING_template& RoutingFilter_template::flagD()
{
set_specific();
return single_value->field_flagD;
}

const BITSTRING_template& RoutingFilter_template::flagD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagD of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagD;
}

BITSTRING_template& RoutingFilter_template::flagE()
{
set_specific();
return single_value->field_flagE;
}

const BITSTRING_template& RoutingFilter_template::flagE() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagE of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagE;
}

BITSTRING_template& RoutingFilter_template::flagF()
{
set_specific();
return single_value->field_flagF;
}

const BITSTRING_template& RoutingFilter_template::flagF() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagF of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagF;
}

BITSTRING_template& RoutingFilter_template::flagG()
{
set_specific();
return single_value->field_flagG;
}

const BITSTRING_template& RoutingFilter_template::flagG() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagG of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagG;
}

BITSTRING_template& RoutingFilter_template::flagH()
{
set_specific();
return single_value->field_flagH;
}

const BITSTRING_template& RoutingFilter_template::flagH() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagH of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagH;
}

BITSTRING_template& RoutingFilter_template::flagI()
{
set_specific();
return single_value->field_flagI;
}

const BITSTRING_template& RoutingFilter_template::flagI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagI of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagI;
}

BITSTRING_template& RoutingFilter_template::flagJ()
{
set_specific();
return single_value->field_flagJ;
}

const BITSTRING_template& RoutingFilter_template::flagJ() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagJ of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagJ;
}

BITSTRING_template& RoutingFilter_template::flagK()
{
set_specific();
return single_value->field_flagK;
}

const BITSTRING_template& RoutingFilter_template::flagK() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagK of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagK;
}

BITSTRING_template& RoutingFilter_template::flagL()
{
set_specific();
return single_value->field_flagL;
}

const BITSTRING_template& RoutingFilter_template::flagL() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagL of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagL;
}

BITSTRING_template& RoutingFilter_template::flagM()
{
set_specific();
return single_value->field_flagM;
}

const BITSTRING_template& RoutingFilter_template::flagM() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagM of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagM;
}

BITSTRING_template& RoutingFilter_template::flagN()
{
set_specific();
return single_value->field_flagN;
}

const BITSTRING_template& RoutingFilter_template::flagN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagN of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagN;
}

BITSTRING_template& RoutingFilter_template::flagsZ()
{
set_specific();
return single_value->field_flagsZ;
}

const BITSTRING_template& RoutingFilter_template::flagsZ() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flagsZ of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flagsZ;
}

OCTETSTRING_template& RoutingFilter_template::sourceIPv4Address()
{
set_specific();
return single_value->field_sourceIPv4Address;
}

const OCTETSTRING_template& RoutingFilter_template::sourceIPv4Address() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceIPv4Address of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_sourceIPv4Address;
}

OCTETSTRING_template& RoutingFilter_template::destinationIPv4Address()
{
set_specific();
return single_value->field_destinationIPv4Address;
}

const OCTETSTRING_template& RoutingFilter_template::destinationIPv4Address() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destinationIPv4Address of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_destinationIPv4Address;
}

OCTETSTRING_template& RoutingFilter_template::sourceIPv6Address()
{
set_specific();
return single_value->field_sourceIPv6Address;
}

const OCTETSTRING_template& RoutingFilter_template::sourceIPv6Address() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceIPv6Address of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_sourceIPv6Address;
}

OCTETSTRING_template& RoutingFilter_template::destinationIPv6Address()
{
set_specific();
return single_value->field_destinationIPv6Address;
}

const OCTETSTRING_template& RoutingFilter_template::destinationIPv6Address() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destinationIPv6Address of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_destinationIPv6Address;
}

OCTETSTRING_template& RoutingFilter_template::sourceAddressPrefixLength()
{
set_specific();
return single_value->field_sourceAddressPrefixLength;
}

const OCTETSTRING_template& RoutingFilter_template::sourceAddressPrefixLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceAddressPrefixLength of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_sourceAddressPrefixLength;
}

OCTETSTRING_template& RoutingFilter_template::destinationAddressPrefixLength()
{
set_specific();
return single_value->field_destinationAddressPrefixLength;
}

const OCTETSTRING_template& RoutingFilter_template::destinationAddressPrefixLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destinationAddressPrefixLength of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_destinationAddressPrefixLength;
}

OCTETSTRING_template& RoutingFilter_template::iPSecSecurityParameterIndex()
{
set_specific();
return single_value->field_iPSecSecurityParameterIndex;
}

const OCTETSTRING_template& RoutingFilter_template::iPSecSecurityParameterIndex() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iPSecSecurityParameterIndex of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_iPSecSecurityParameterIndex;
}

OCTETSTRING_template& RoutingFilter_template::protocolTypeNextHeader()
{
set_specific();
return single_value->field_protocolTypeNextHeader;
}

const OCTETSTRING_template& RoutingFilter_template::protocolTypeNextHeader() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolTypeNextHeader of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_protocolTypeNextHeader;
}

OCTETSTRING_template& RoutingFilter_template::startSourcePortRange()
{
set_specific();
return single_value->field_startSourcePortRange;
}

const OCTETSTRING_template& RoutingFilter_template::startSourcePortRange() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field startSourcePortRange of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_startSourcePortRange;
}

OCTETSTRING_template& RoutingFilter_template::endSourcePortRange()
{
set_specific();
return single_value->field_endSourcePortRange;
}

const OCTETSTRING_template& RoutingFilter_template::endSourcePortRange() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field endSourcePortRange of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_endSourcePortRange;
}

OCTETSTRING_template& RoutingFilter_template::startDestinationPortRange()
{
set_specific();
return single_value->field_startDestinationPortRange;
}

const OCTETSTRING_template& RoutingFilter_template::startDestinationPortRange() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field startDestinationPortRange of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_startDestinationPortRange;
}

OCTETSTRING_template& RoutingFilter_template::endDestinationPortRange()
{
set_specific();
return single_value->field_endDestinationPortRange;
}

const OCTETSTRING_template& RoutingFilter_template::endDestinationPortRange() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field endDestinationPortRange of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_endDestinationPortRange;
}

OCTETSTRING_template& RoutingFilter_template::typeOfService()
{
set_specific();
return single_value->field_typeOfService;
}

const OCTETSTRING_template& RoutingFilter_template::typeOfService() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field typeOfService of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_typeOfService;
}

OCTETSTRING_template& RoutingFilter_template::flowLabel()
{
set_specific();
return single_value->field_flowLabel;
}

const OCTETSTRING_template& RoutingFilter_template::flowLabel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flowLabel of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
return single_value->field_flowLabel;
}

int RoutingFilter_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 15;
      if (single_value->field_sourceIPv4Address.is_present()) ret_val++;
      if (single_value->field_destinationIPv4Address.is_present()) ret_val++;
      if (single_value->field_sourceIPv6Address.is_present()) ret_val++;
      if (single_value->field_destinationIPv6Address.is_present()) ret_val++;
      if (single_value->field_sourceAddressPrefixLength.is_present()) ret_val++;
      if (single_value->field_destinationAddressPrefixLength.is_present()) ret_val++;
      if (single_value->field_iPSecSecurityParameterIndex.is_present()) ret_val++;
      if (single_value->field_protocolTypeNextHeader.is_present()) ret_val++;
      if (single_value->field_startSourcePortRange.is_present()) ret_val++;
      if (single_value->field_endSourcePortRange.is_present()) ret_val++;
      if (single_value->field_startDestinationPortRange.is_present()) ret_val++;
      if (single_value->field_endDestinationPortRange.is_present()) ret_val++;
      if (single_value->field_typeOfService.is_present()) ret_val++;
      if (single_value->field_flowLabel.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingFilter containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
  }
  return 0;
}

void RoutingFilter_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ flagA := ");
single_value->field_flagA.log();
TTCN_Logger::log_event_str(", flagB := ");
single_value->field_flagB.log();
TTCN_Logger::log_event_str(", flagC := ");
single_value->field_flagC.log();
TTCN_Logger::log_event_str(", flagD := ");
single_value->field_flagD.log();
TTCN_Logger::log_event_str(", flagE := ");
single_value->field_flagE.log();
TTCN_Logger::log_event_str(", flagF := ");
single_value->field_flagF.log();
TTCN_Logger::log_event_str(", flagG := ");
single_value->field_flagG.log();
TTCN_Logger::log_event_str(", flagH := ");
single_value->field_flagH.log();
TTCN_Logger::log_event_str(", flagI := ");
single_value->field_flagI.log();
TTCN_Logger::log_event_str(", flagJ := ");
single_value->field_flagJ.log();
TTCN_Logger::log_event_str(", flagK := ");
single_value->field_flagK.log();
TTCN_Logger::log_event_str(", flagL := ");
single_value->field_flagL.log();
TTCN_Logger::log_event_str(", flagM := ");
single_value->field_flagM.log();
TTCN_Logger::log_event_str(", flagN := ");
single_value->field_flagN.log();
TTCN_Logger::log_event_str(", flagsZ := ");
single_value->field_flagsZ.log();
TTCN_Logger::log_event_str(", sourceIPv4Address := ");
single_value->field_sourceIPv4Address.log();
TTCN_Logger::log_event_str(", destinationIPv4Address := ");
single_value->field_destinationIPv4Address.log();
TTCN_Logger::log_event_str(", sourceIPv6Address := ");
single_value->field_sourceIPv6Address.log();
TTCN_Logger::log_event_str(", destinationIPv6Address := ");
single_value->field_destinationIPv6Address.log();
TTCN_Logger::log_event_str(", sourceAddressPrefixLength := ");
single_value->field_sourceAddressPrefixLength.log();
TTCN_Logger::log_event_str(", destinationAddressPrefixLength := ");
single_value->field_destinationAddressPrefixLength.log();
TTCN_Logger::log_event_str(", iPSecSecurityParameterIndex := ");
single_value->field_iPSecSecurityParameterIndex.log();
TTCN_Logger::log_event_str(", protocolTypeNextHeader := ");
single_value->field_protocolTypeNextHeader.log();
TTCN_Logger::log_event_str(", startSourcePortRange := ");
single_value->field_startSourcePortRange.log();
TTCN_Logger::log_event_str(", endSourcePortRange := ");
single_value->field_endSourcePortRange.log();
TTCN_Logger::log_event_str(", startDestinationPortRange := ");
single_value->field_startDestinationPortRange.log();
TTCN_Logger::log_event_str(", endDestinationPortRange := ");
single_value->field_endDestinationPortRange.log();
TTCN_Logger::log_event_str(", typeOfService := ");
single_value->field_typeOfService.log();
TTCN_Logger::log_event_str(", flowLabel := ");
single_value->field_flowLabel.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 RoutingFilter_template::log_match(const RoutingFilter& 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_flagA.match(match_value.flagA(), legacy)){
TTCN_Logger::log_logmatch_info(".flagA");
single_value->field_flagA.log_match(match_value.flagA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagB.match(match_value.flagB(), legacy)){
TTCN_Logger::log_logmatch_info(".flagB");
single_value->field_flagB.log_match(match_value.flagB(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagC.match(match_value.flagC(), legacy)){
TTCN_Logger::log_logmatch_info(".flagC");
single_value->field_flagC.log_match(match_value.flagC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagD.match(match_value.flagD(), legacy)){
TTCN_Logger::log_logmatch_info(".flagD");
single_value->field_flagD.log_match(match_value.flagD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagE.match(match_value.flagE(), legacy)){
TTCN_Logger::log_logmatch_info(".flagE");
single_value->field_flagE.log_match(match_value.flagE(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagF.match(match_value.flagF(), legacy)){
TTCN_Logger::log_logmatch_info(".flagF");
single_value->field_flagF.log_match(match_value.flagF(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagG.match(match_value.flagG(), legacy)){
TTCN_Logger::log_logmatch_info(".flagG");
single_value->field_flagG.log_match(match_value.flagG(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagH.match(match_value.flagH(), legacy)){
TTCN_Logger::log_logmatch_info(".flagH");
single_value->field_flagH.log_match(match_value.flagH(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagI.match(match_value.flagI(), legacy)){
TTCN_Logger::log_logmatch_info(".flagI");
single_value->field_flagI.log_match(match_value.flagI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagJ.match(match_value.flagJ(), legacy)){
TTCN_Logger::log_logmatch_info(".flagJ");
single_value->field_flagJ.log_match(match_value.flagJ(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagK.match(match_value.flagK(), legacy)){
TTCN_Logger::log_logmatch_info(".flagK");
single_value->field_flagK.log_match(match_value.flagK(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagL.match(match_value.flagL(), legacy)){
TTCN_Logger::log_logmatch_info(".flagL");
single_value->field_flagL.log_match(match_value.flagL(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagM.match(match_value.flagM(), legacy)){
TTCN_Logger::log_logmatch_info(".flagM");
single_value->field_flagM.log_match(match_value.flagM(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagN.match(match_value.flagN(), legacy)){
TTCN_Logger::log_logmatch_info(".flagN");
single_value->field_flagN.log_match(match_value.flagN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_flagsZ.match(match_value.flagsZ(), legacy)){
TTCN_Logger::log_logmatch_info(".flagsZ");
single_value->field_flagsZ.log_match(match_value.flagsZ(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.sourceIPv4Address().ispresent()){
if(!single_value->field_sourceIPv4Address.match(match_value.sourceIPv4Address(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceIPv4Address");
single_value->field_sourceIPv4Address.log_match(match_value.sourceIPv4Address(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sourceIPv4Address.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sourceIPv4Address := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sourceIPv4Address.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.destinationIPv4Address().ispresent()){
if(!single_value->field_destinationIPv4Address.match(match_value.destinationIPv4Address(), legacy)){
TTCN_Logger::log_logmatch_info(".destinationIPv4Address");
single_value->field_destinationIPv4Address.log_match(match_value.destinationIPv4Address(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_destinationIPv4Address.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".destinationIPv4Address := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_destinationIPv4Address.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sourceIPv6Address().ispresent()){
if(!single_value->field_sourceIPv6Address.match(match_value.sourceIPv6Address(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceIPv6Address");
single_value->field_sourceIPv6Address.log_match(match_value.sourceIPv6Address(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sourceIPv6Address.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sourceIPv6Address := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sourceIPv6Address.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.destinationIPv6Address().ispresent()){
if(!single_value->field_destinationIPv6Address.match(match_value.destinationIPv6Address(), legacy)){
TTCN_Logger::log_logmatch_info(".destinationIPv6Address");
single_value->field_destinationIPv6Address.log_match(match_value.destinationIPv6Address(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_destinationIPv6Address.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".destinationIPv6Address := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_destinationIPv6Address.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sourceAddressPrefixLength().ispresent()){
if(!single_value->field_sourceAddressPrefixLength.match(match_value.sourceAddressPrefixLength(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceAddressPrefixLength");
single_value->field_sourceAddressPrefixLength.log_match(match_value.sourceAddressPrefixLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sourceAddressPrefixLength.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sourceAddressPrefixLength := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sourceAddressPrefixLength.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.destinationAddressPrefixLength().ispresent()){
if(!single_value->field_destinationAddressPrefixLength.match(match_value.destinationAddressPrefixLength(), legacy)){
TTCN_Logger::log_logmatch_info(".destinationAddressPrefixLength");
single_value->field_destinationAddressPrefixLength.log_match(match_value.destinationAddressPrefixLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_destinationAddressPrefixLength.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".destinationAddressPrefixLength := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_destinationAddressPrefixLength.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iPSecSecurityParameterIndex().ispresent()){
if(!single_value->field_iPSecSecurityParameterIndex.match(match_value.iPSecSecurityParameterIndex(), legacy)){
TTCN_Logger::log_logmatch_info(".iPSecSecurityParameterIndex");
single_value->field_iPSecSecurityParameterIndex.log_match(match_value.iPSecSecurityParameterIndex(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iPSecSecurityParameterIndex.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iPSecSecurityParameterIndex := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iPSecSecurityParameterIndex.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.protocolTypeNextHeader().ispresent()){
if(!single_value->field_protocolTypeNextHeader.match(match_value.protocolTypeNextHeader(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolTypeNextHeader");
single_value->field_protocolTypeNextHeader.log_match(match_value.protocolTypeNextHeader(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_protocolTypeNextHeader.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".protocolTypeNextHeader := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_protocolTypeNextHeader.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.startSourcePortRange().ispresent()){
if(!single_value->field_startSourcePortRange.match(match_value.startSourcePortRange(), legacy)){
TTCN_Logger::log_logmatch_info(".startSourcePortRange");
single_value->field_startSourcePortRange.log_match(match_value.startSourcePortRange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_startSourcePortRange.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".startSourcePortRange := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_startSourcePortRange.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.endSourcePortRange().ispresent()){
if(!single_value->field_endSourcePortRange.match(match_value.endSourcePortRange(), legacy)){
TTCN_Logger::log_logmatch_info(".endSourcePortRange");
single_value->field_endSourcePortRange.log_match(match_value.endSourcePortRange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_endSourcePortRange.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".endSourcePortRange := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_endSourcePortRange.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.startDestinationPortRange().ispresent()){
if(!single_value->field_startDestinationPortRange.match(match_value.startDestinationPortRange(), legacy)){
TTCN_Logger::log_logmatch_info(".startDestinationPortRange");
single_value->field_startDestinationPortRange.log_match(match_value.startDestinationPortRange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_startDestinationPortRange.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".startDestinationPortRange := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_startDestinationPortRange.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.endDestinationPortRange().ispresent()){
if(!single_value->field_endDestinationPortRange.match(match_value.endDestinationPortRange(), legacy)){
TTCN_Logger::log_logmatch_info(".endDestinationPortRange");
single_value->field_endDestinationPortRange.log_match(match_value.endDestinationPortRange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_endDestinationPortRange.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".endDestinationPortRange := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_endDestinationPortRange.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.typeOfService().ispresent()){
if(!single_value->field_typeOfService.match(match_value.typeOfService(), legacy)){
TTCN_Logger::log_logmatch_info(".typeOfService");
single_value->field_typeOfService.log_match(match_value.typeOfService(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_typeOfService.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".typeOfService := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_typeOfService.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.flowLabel().ispresent()){
if(!single_value->field_flowLabel.match(match_value.flowLabel(), legacy)){
TTCN_Logger::log_logmatch_info(".flowLabel");
single_value->field_flowLabel.log_match(match_value.flowLabel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_flowLabel.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".flowLabel := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_flowLabel.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("{ flagA := ");
single_value->field_flagA.log_match(match_value.flagA(), legacy);
TTCN_Logger::log_event_str(", flagB := ");
single_value->field_flagB.log_match(match_value.flagB(), legacy);
TTCN_Logger::log_event_str(", flagC := ");
single_value->field_flagC.log_match(match_value.flagC(), legacy);
TTCN_Logger::log_event_str(", flagD := ");
single_value->field_flagD.log_match(match_value.flagD(), legacy);
TTCN_Logger::log_event_str(", flagE := ");
single_value->field_flagE.log_match(match_value.flagE(), legacy);
TTCN_Logger::log_event_str(", flagF := ");
single_value->field_flagF.log_match(match_value.flagF(), legacy);
TTCN_Logger::log_event_str(", flagG := ");
single_value->field_flagG.log_match(match_value.flagG(), legacy);
TTCN_Logger::log_event_str(", flagH := ");
single_value->field_flagH.log_match(match_value.flagH(), legacy);
TTCN_Logger::log_event_str(", flagI := ");
single_value->field_flagI.log_match(match_value.flagI(), legacy);
TTCN_Logger::log_event_str(", flagJ := ");
single_value->field_flagJ.log_match(match_value.flagJ(), legacy);
TTCN_Logger::log_event_str(", flagK := ");
single_value->field_flagK.log_match(match_value.flagK(), legacy);
TTCN_Logger::log_event_str(", flagL := ");
single_value->field_flagL.log_match(match_value.flagL(), legacy);
TTCN_Logger::log_event_str(", flagM := ");
single_value->field_flagM.log_match(match_value.flagM(), legacy);
TTCN_Logger::log_event_str(", flagN := ");
single_value->field_flagN.log_match(match_value.flagN(), legacy);
TTCN_Logger::log_event_str(", flagsZ := ");
single_value->field_flagsZ.log_match(match_value.flagsZ(), legacy);
TTCN_Logger::log_event_str(", sourceIPv4Address := ");
if (match_value.sourceIPv4Address().ispresent()) {
single_value->field_sourceIPv4Address.log_match(match_value.sourceIPv4Address(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sourceIPv4Address.log();
if (single_value->field_sourceIPv4Address.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", destinationIPv4Address := ");
if (match_value.destinationIPv4Address().ispresent()) {
single_value->field_destinationIPv4Address.log_match(match_value.destinationIPv4Address(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_destinationIPv4Address.log();
if (single_value->field_destinationIPv4Address.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sourceIPv6Address := ");
if (match_value.sourceIPv6Address().ispresent()) {
single_value->field_sourceIPv6Address.log_match(match_value.sourceIPv6Address(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sourceIPv6Address.log();
if (single_value->field_sourceIPv6Address.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", destinationIPv6Address := ");
if (match_value.destinationIPv6Address().ispresent()) {
single_value->field_destinationIPv6Address.log_match(match_value.destinationIPv6Address(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_destinationIPv6Address.log();
if (single_value->field_destinationIPv6Address.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sourceAddressPrefixLength := ");
if (match_value.sourceAddressPrefixLength().ispresent()) {
single_value->field_sourceAddressPrefixLength.log_match(match_value.sourceAddressPrefixLength(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sourceAddressPrefixLength.log();
if (single_value->field_sourceAddressPrefixLength.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", destinationAddressPrefixLength := ");
if (match_value.destinationAddressPrefixLength().ispresent()) {
single_value->field_destinationAddressPrefixLength.log_match(match_value.destinationAddressPrefixLength(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_destinationAddressPrefixLength.log();
if (single_value->field_destinationAddressPrefixLength.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iPSecSecurityParameterIndex := ");
if (match_value.iPSecSecurityParameterIndex().ispresent()) {
single_value->field_iPSecSecurityParameterIndex.log_match(match_value.iPSecSecurityParameterIndex(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iPSecSecurityParameterIndex.log();
if (single_value->field_iPSecSecurityParameterIndex.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", protocolTypeNextHeader := ");
if (match_value.protocolTypeNextHeader().ispresent()) {
single_value->field_protocolTypeNextHeader.log_match(match_value.protocolTypeNextHeader(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_protocolTypeNextHeader.log();
if (single_value->field_protocolTypeNextHeader.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", startSourcePortRange := ");
if (match_value.startSourcePortRange().ispresent()) {
single_value->field_startSourcePortRange.log_match(match_value.startSourcePortRange(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_startSourcePortRange.log();
if (single_value->field_startSourcePortRange.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", endSourcePortRange := ");
if (match_value.endSourcePortRange().ispresent()) {
single_value->field_endSourcePortRange.log_match(match_value.endSourcePortRange(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_endSourcePortRange.log();
if (single_value->field_endSourcePortRange.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", startDestinationPortRange := ");
if (match_value.startDestinationPortRange().ispresent()) {
single_value->field_startDestinationPortRange.log_match(match_value.startDestinationPortRange(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_startDestinationPortRange.log();
if (single_value->field_startDestinationPortRange.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", endDestinationPortRange := ");
if (match_value.endDestinationPortRange().ispresent()) {
single_value->field_endDestinationPortRange.log_match(match_value.endDestinationPortRange(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_endDestinationPortRange.log();
if (single_value->field_endDestinationPortRange.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", typeOfService := ");
if (match_value.typeOfService().ispresent()) {
single_value->field_typeOfService.log_match(match_value.typeOfService(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_typeOfService.log();
if (single_value->field_typeOfService.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", flowLabel := ");
if (match_value.flowLabel().ispresent()) {
single_value->field_flowLabel.log_match(match_value.flowLabel(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_flowLabel.log();
if (single_value->field_flowLabel.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 RoutingFilter_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (flagA().is_bound()) flagA().set_implicit_omit();
if (flagB().is_bound()) flagB().set_implicit_omit();
if (flagC().is_bound()) flagC().set_implicit_omit();
if (flagD().is_bound()) flagD().set_implicit_omit();
if (flagE().is_bound()) flagE().set_implicit_omit();
if (flagF().is_bound()) flagF().set_implicit_omit();
if (flagG().is_bound()) flagG().set_implicit_omit();
if (flagH().is_bound()) flagH().set_implicit_omit();
if (flagI().is_bound()) flagI().set_implicit_omit();
if (flagJ().is_bound()) flagJ().set_implicit_omit();
if (flagK().is_bound()) flagK().set_implicit_omit();
if (flagL().is_bound()) flagL().set_implicit_omit();
if (flagM().is_bound()) flagM().set_implicit_omit();
if (flagN().is_bound()) flagN().set_implicit_omit();
if (flagsZ().is_bound()) flagsZ().set_implicit_omit();
if (!sourceIPv4Address().is_bound()) sourceIPv4Address() = OMIT_VALUE;
else sourceIPv4Address().set_implicit_omit();
if (!destinationIPv4Address().is_bound()) destinationIPv4Address() = OMIT_VALUE;
else destinationIPv4Address().set_implicit_omit();
if (!sourceIPv6Address().is_bound()) sourceIPv6Address() = OMIT_VALUE;
else sourceIPv6Address().set_implicit_omit();
if (!destinationIPv6Address().is_bound()) destinationIPv6Address() = OMIT_VALUE;
else destinationIPv6Address().set_implicit_omit();
if (!sourceAddressPrefixLength().is_bound()) sourceAddressPrefixLength() = OMIT_VALUE;
else sourceAddressPrefixLength().set_implicit_omit();
if (!destinationAddressPrefixLength().is_bound()) destinationAddressPrefixLength() = OMIT_VALUE;
else destinationAddressPrefixLength().set_implicit_omit();
if (!iPSecSecurityParameterIndex().is_bound()) iPSecSecurityParameterIndex() = OMIT_VALUE;
else iPSecSecurityParameterIndex().set_implicit_omit();
if (!protocolTypeNextHeader().is_bound()) protocolTypeNextHeader() = OMIT_VALUE;
else protocolTypeNextHeader().set_implicit_omit();
if (!startSourcePortRange().is_bound()) startSourcePortRange() = OMIT_VALUE;
else startSourcePortRange().set_implicit_omit();
if (!endSourcePortRange().is_bound()) endSourcePortRange() = OMIT_VALUE;
else endSourcePortRange().set_implicit_omit();
if (!startDestinationPortRange().is_bound()) startDestinationPortRange() = OMIT_VALUE;
else startDestinationPortRange().set_implicit_omit();
if (!endDestinationPortRange().is_bound()) endDestinationPortRange() = OMIT_VALUE;
else endDestinationPortRange().set_implicit_omit();
if (!typeOfService().is_bound()) typeOfService() = OMIT_VALUE;
else typeOfService().set_implicit_omit();
if (!flowLabel().is_bound()) flowLabel() = OMIT_VALUE;
else flowLabel().set_implicit_omit();
}

void RoutingFilter_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_flagA.encode_text(text_buf);
single_value->field_flagB.encode_text(text_buf);
single_value->field_flagC.encode_text(text_buf);
single_value->field_flagD.encode_text(text_buf);
single_value->field_flagE.encode_text(text_buf);
single_value->field_flagF.encode_text(text_buf);
single_value->field_flagG.encode_text(text_buf);
single_value->field_flagH.encode_text(text_buf);
single_value->field_flagI.encode_text(text_buf);
single_value->field_flagJ.encode_text(text_buf);
single_value->field_flagK.encode_text(text_buf);
single_value->field_flagL.encode_text(text_buf);
single_value->field_flagM.encode_text(text_buf);
single_value->field_flagN.encode_text(text_buf);
single_value->field_flagsZ.encode_text(text_buf);
single_value->field_sourceIPv4Address.encode_text(text_buf);
single_value->field_destinationIPv4Address.encode_text(text_buf);
single_value->field_sourceIPv6Address.encode_text(text_buf);
single_value->field_destinationIPv6Address.encode_text(text_buf);
single_value->field_sourceAddressPrefixLength.encode_text(text_buf);
single_value->field_destinationAddressPrefixLength.encode_text(text_buf);
single_value->field_iPSecSecurityParameterIndex.encode_text(text_buf);
single_value->field_protocolTypeNextHeader.encode_text(text_buf);
single_value->field_startSourcePortRange.encode_text(text_buf);
single_value->field_endSourcePortRange.encode_text(text_buf);
single_value->field_startDestinationPortRange.encode_text(text_buf);
single_value->field_endDestinationPortRange.encode_text(text_buf);
single_value->field_typeOfService.encode_text(text_buf);
single_value->field_flowLabel.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
}
}

void RoutingFilter_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_flagA.decode_text(text_buf);
single_value->field_flagB.decode_text(text_buf);
single_value->field_flagC.decode_text(text_buf);
single_value->field_flagD.decode_text(text_buf);
single_value->field_flagE.decode_text(text_buf);
single_value->field_flagF.decode_text(text_buf);
single_value->field_flagG.decode_text(text_buf);
single_value->field_flagH.decode_text(text_buf);
single_value->field_flagI.decode_text(text_buf);
single_value->field_flagJ.decode_text(text_buf);
single_value->field_flagK.decode_text(text_buf);
single_value->field_flagL.decode_text(text_buf);
single_value->field_flagM.decode_text(text_buf);
single_value->field_flagN.decode_text(text_buf);
single_value->field_flagsZ.decode_text(text_buf);
single_value->field_sourceIPv4Address.decode_text(text_buf);
single_value->field_destinationIPv4Address.decode_text(text_buf);
single_value->field_sourceIPv6Address.decode_text(text_buf);
single_value->field_destinationIPv6Address.decode_text(text_buf);
single_value->field_sourceAddressPrefixLength.decode_text(text_buf);
single_value->field_destinationAddressPrefixLength.decode_text(text_buf);
single_value->field_iPSecSecurityParameterIndex.decode_text(text_buf);
single_value->field_protocolTypeNextHeader.decode_text(text_buf);
single_value->field_startSourcePortRange.decode_text(text_buf);
single_value->field_endSourcePortRange.decode_text(text_buf);
single_value->field_startDestinationPortRange.decode_text(text_buf);
single_value->field_endDestinationPortRange.decode_text(text_buf);
single_value->field_typeOfService.decode_text(text_buf);
single_value->field_flowLabel.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 RoutingFilter_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.RoutingFilter.");
}
}

void RoutingFilter_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: {
    RoutingFilter_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 (29<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RoutingFilter has 29 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) flagA().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) flagB().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) flagC().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flagD().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) flagE().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) flagF().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) flagG().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) flagH().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) flagI().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) flagJ().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) flagK().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) flagL().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) flagM().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) flagN().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) flagsZ().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) sourceIPv4Address().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) destinationIPv4Address().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) sourceIPv6Address().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) destinationIPv6Address().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) sourceAddressPrefixLength().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) destinationAddressPrefixLength().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) iPSecSecurityParameterIndex().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) protocolTypeNextHeader().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) startSourcePortRange().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) endSourcePortRange().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) startDestinationPortRange().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) endDestinationPortRange().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) typeOfService().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) flowLabel().set_param(*param.get_elem(28));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagB")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagB().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagE")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagE().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagF().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagG")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagG().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagH")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagH().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagJ")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagJ().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagK")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagK().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flagsZ")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flagsZ().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceIPv4Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceIPv4Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destinationIPv4Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destinationIPv4Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceIPv6Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceIPv6Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destinationIPv6Address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destinationIPv6Address().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceAddressPrefixLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceAddressPrefixLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destinationAddressPrefixLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destinationAddressPrefixLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iPSecSecurityParameterIndex")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iPSecSecurityParameterIndex().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolTypeNextHeader")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolTypeNextHeader().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startSourcePortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startSourcePortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "endSourcePortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          endSourcePortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startDestinationPortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startDestinationPortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "endDestinationPortRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          endDestinationPortRange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "typeOfService")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfService().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flowLabel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flowLabel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RoutingFilter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RoutingFilter_template* precondition = new RoutingFilter_template;
    precondition->set_param(*param.get_elem(0));
    RoutingFilter_template* implied_template = new RoutingFilter_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RoutingFilter_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RoutingFilter");
  }
  is_ifpresent = param.get_ifpresent();
}

void RoutingFilter_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_flagA.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagB.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagC.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagD.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagE.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagF.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagG.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagH.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagJ.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagK.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagL.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagM.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flagsZ.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_sourceIPv4Address.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_destinationIPv4Address.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_sourceIPv6Address.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_destinationIPv6Address.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_sourceAddressPrefixLength.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_destinationAddressPrefixLength.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_iPSecSecurityParameterIndex.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_protocolTypeNextHeader.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_startSourcePortRange.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_endSourcePortRange.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_startDestinationPortRange.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_endDestinationPortRange.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_typeOfService.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
single_value->field_flowLabel.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingFilter");
}

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

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

NBIFOM__RoutingRule::NBIFOM__RoutingRule()
{
}

NBIFOM__RoutingRule::NBIFOM__RoutingRule(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_routingRuleIdentifier,
    const BITSTRING& par_operationCode,
    const BITSTRING& par_spare,
    const BITSTRING& par_routingAccess,
    const OCTETSTRING& par_routingRulePrioroty,
    const RoutingFilter& par_routingFilter)
  :   field_lengthIndicator(par_lengthIndicator),
  field_routingRuleIdentifier(par_routingRuleIdentifier),
  field_operationCode(par_operationCode),
  field_spare(par_spare),
  field_routingAccess(par_routingAccess),
  field_routingRulePrioroty(par_routingRulePrioroty),
  field_routingFilter(par_routingFilter)
{
}

NBIFOM__RoutingRule::NBIFOM__RoutingRule(const NBIFOM__RoutingRule& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.routingRuleIdentifier().is_bound()) field_routingRuleIdentifier = other_value.routingRuleIdentifier();
else field_routingRuleIdentifier.clean_up();
if (other_value.operationCode().is_bound()) field_operationCode = other_value.operationCode();
else field_operationCode.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.routingAccess().is_bound()) field_routingAccess = other_value.routingAccess();
else field_routingAccess.clean_up();
if (other_value.routingRulePrioroty().is_bound()) field_routingRulePrioroty = other_value.routingRulePrioroty();
else field_routingRulePrioroty.clean_up();
if (other_value.routingFilter().is_bound()) field_routingFilter = other_value.routingFilter();
else field_routingFilter.clean_up();
}

void NBIFOM__RoutingRule::clean_up()
{
field_lengthIndicator.clean_up();
field_routingRuleIdentifier.clean_up();
field_operationCode.clean_up();
field_spare.clean_up();
field_routingAccess.clean_up();
field_routingRulePrioroty.clean_up();
field_routingFilter.clean_up();
}

const TTCN_Typedescriptor_t* NBIFOM__RoutingRule::get_descriptor() const { return &NBIFOM__RoutingRule_descr_; }
NBIFOM__RoutingRule& NBIFOM__RoutingRule::operator=(const NBIFOM__RoutingRule& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.routingRuleIdentifier().is_bound()) field_routingRuleIdentifier = other_value.routingRuleIdentifier();
  else field_routingRuleIdentifier.clean_up();
  if (other_value.operationCode().is_bound()) field_operationCode = other_value.operationCode();
  else field_operationCode.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.routingAccess().is_bound()) field_routingAccess = other_value.routingAccess();
  else field_routingAccess.clean_up();
  if (other_value.routingRulePrioroty().is_bound()) field_routingRulePrioroty = other_value.routingRulePrioroty();
  else field_routingRulePrioroty.clean_up();
  if (other_value.routingFilter().is_bound()) field_routingFilter = other_value.routingFilter();
  else field_routingFilter.clean_up();
}
return *this;
}

boolean NBIFOM__RoutingRule::operator==(const NBIFOM__RoutingRule& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_routingRuleIdentifier==other_value.field_routingRuleIdentifier
  && field_operationCode==other_value.field_operationCode
  && field_spare==other_value.field_spare
  && field_routingAccess==other_value.field_routingAccess
  && field_routingRulePrioroty==other_value.field_routingRulePrioroty
  && field_routingFilter==other_value.field_routingFilter;
}

boolean NBIFOM__RoutingRule::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_routingRuleIdentifier.is_bound())
  || (field_operationCode.is_bound())
  || (field_spare.is_bound())
  || (field_routingAccess.is_bound())
  || (field_routingRulePrioroty.is_bound())
  || (field_routingFilter.is_bound());
}
boolean NBIFOM__RoutingRule::is_value() const
{
return field_lengthIndicator.is_value()
  && field_routingRuleIdentifier.is_value()
  && field_operationCode.is_value()
  && field_spare.is_value()
  && field_routingAccess.is_value()
  && field_routingRulePrioroty.is_value()
  && field_routingFilter.is_value();
}
void NBIFOM__RoutingRule::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", routingRuleIdentifier := ");
field_routingRuleIdentifier.log();
TTCN_Logger::log_event_str(", operationCode := ");
field_operationCode.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", routingAccess := ");
field_routingAccess.log();
TTCN_Logger::log_event_str(", routingRulePrioroty := ");
field_routingRulePrioroty.log();
TTCN_Logger::log_event_str(", routingFilter := ");
field_routingFilter.log();
TTCN_Logger::log_event_str(" }");
}

void NBIFOM__RoutingRule::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (routingRuleIdentifier().is_bound()) routingRuleIdentifier().set_implicit_omit();
if (operationCode().is_bound()) operationCode().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (routingAccess().is_bound()) routingAccess().set_implicit_omit();
if (routingRulePrioroty().is_bound()) routingRulePrioroty().set_implicit_omit();
if (routingFilter().is_bound()) routingFilter().set_implicit_omit();
}

void NBIFOM__RoutingRule::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routingRuleIdentifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAccess().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) routingRulePrioroty().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) routingFilter().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingRuleIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingRuleIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAccess")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAccess().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingRulePrioroty")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingRulePrioroty().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingFilter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingFilter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
  }
}

void NBIFOM__RoutingRule::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_routingRuleIdentifier.encode_text(text_buf);
field_operationCode.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_routingAccess.encode_text(text_buf);
field_routingRulePrioroty.encode_text(text_buf);
field_routingFilter.encode_text(text_buf);
}

void NBIFOM__RoutingRule::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_routingRuleIdentifier.decode_text(text_buf);
field_operationCode.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_routingAccess.decode_text(text_buf);
field_routingRulePrioroty.decode_text(text_buf);
field_routingFilter.decode_text(text_buf);
}

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

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

int NBIFOM__RoutingRule::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, NBIFOM__RoutingRule_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NBIFOM__RoutingRule_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(NBIFOM__RoutingRule_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_routingRuleIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), 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());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_operationCode.RAW_decode(General__Types::BIT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), 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());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_routingAccess.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_routingRulePrioroty.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, RoutingFilter_descr_.raw->forceomit);
  decoded_field_length = field_routingFilter.RAW_decode(RoutingFilter_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NBIFOM__RoutingRule::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, NBIFOM__RoutingRule_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RoutingFilter_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &NBIFOM__RoutingRule_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 6;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(6);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  encoded_length += field_routingRuleIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_operationCode.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_routingAccess.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_routingRulePrioroty.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_routingFilter.RAW_encode(RoutingFilter_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct NBIFOM__RoutingRule_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_routingRuleIdentifier;
BITSTRING_template field_operationCode;
BITSTRING_template field_spare;
BITSTRING_template field_routingAccess;
OCTETSTRING_template field_routingRulePrioroty;
RoutingFilter_template field_routingFilter;
};

void NBIFOM__RoutingRule_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_lengthIndicator = ANY_VALUE;
single_value->field_routingRuleIdentifier = ANY_VALUE;
single_value->field_operationCode = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_routingAccess = ANY_VALUE;
single_value->field_routingRulePrioroty = ANY_VALUE;
single_value->field_routingFilter = ANY_VALUE;
}
}
}

void NBIFOM__RoutingRule_template::copy_value(const NBIFOM__RoutingRule& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.routingRuleIdentifier().is_bound()) {
  single_value->field_routingRuleIdentifier = other_value.routingRuleIdentifier();
} else {
  single_value->field_routingRuleIdentifier.clean_up();
}
if (other_value.operationCode().is_bound()) {
  single_value->field_operationCode = other_value.operationCode();
} else {
  single_value->field_operationCode.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.routingAccess().is_bound()) {
  single_value->field_routingAccess = other_value.routingAccess();
} else {
  single_value->field_routingAccess.clean_up();
}
if (other_value.routingRulePrioroty().is_bound()) {
  single_value->field_routingRulePrioroty = other_value.routingRulePrioroty();
} else {
  single_value->field_routingRulePrioroty.clean_up();
}
if (other_value.routingFilter().is_bound()) {
  single_value->field_routingFilter = other_value.routingFilter();
} else {
  single_value->field_routingFilter.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NBIFOM__RoutingRule_template::copy_template(const NBIFOM__RoutingRule_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingRuleIdentifier().get_selection()) {
single_value->field_routingRuleIdentifier = other_value.routingRuleIdentifier();
} else {
single_value->field_routingRuleIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.operationCode().get_selection()) {
single_value->field_operationCode = other_value.operationCode();
} else {
single_value->field_operationCode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAccess().get_selection()) {
single_value->field_routingAccess = other_value.routingAccess();
} else {
single_value->field_routingAccess.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingRulePrioroty().get_selection()) {
single_value->field_routingRulePrioroty = other_value.routingRulePrioroty();
} else {
single_value->field_routingRulePrioroty.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingFilter().get_selection()) {
single_value->field_routingFilter = other_value.routingFilter();
} else {
single_value->field_routingFilter.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 NBIFOM__RoutingRule_template[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 NBIFOM__RoutingRule_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__RoutingRule_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
break;
}
set_selection(other_value);
}

NBIFOM__RoutingRule_template::NBIFOM__RoutingRule_template()
{
}

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

NBIFOM__RoutingRule_template::NBIFOM__RoutingRule_template(const NBIFOM__RoutingRule& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NBIFOM__RoutingRule_template::match(const NBIFOM__RoutingRule& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.routingRuleIdentifier().is_bound()) return FALSE;
if(!single_value->field_routingRuleIdentifier.match(other_value.routingRuleIdentifier(), legacy))return FALSE;
if(!other_value.operationCode().is_bound()) return FALSE;
if(!single_value->field_operationCode.match(other_value.operationCode(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.routingAccess().is_bound()) return FALSE;
if(!single_value->field_routingAccess.match(other_value.routingAccess(), legacy))return FALSE;
if(!other_value.routingRulePrioroty().is_bound()) return FALSE;
if(!single_value->field_routingRulePrioroty.match(other_value.routingRulePrioroty(), legacy))return FALSE;
if(!other_value.routingFilter().is_bound()) return FALSE;
if(!single_value->field_routingFilter.match(other_value.routingFilter(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
}
return FALSE;
}

boolean NBIFOM__RoutingRule_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_routingRuleIdentifier.is_bound()
 || single_value->field_operationCode.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_routingAccess.is_bound()
 || single_value->field_routingRulePrioroty.is_bound()
 || single_value->field_routingFilter.is_bound();
}

boolean NBIFOM__RoutingRule_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_routingRuleIdentifier.is_value()
 && single_value->field_operationCode.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_routingAccess.is_value()
 && single_value->field_routingRulePrioroty.is_value()
 && single_value->field_routingFilter.is_value();
}

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

NBIFOM__RoutingRule NBIFOM__RoutingRule_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
NBIFOM__RoutingRule ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_routingRuleIdentifier.is_bound()) {
ret_val.routingRuleIdentifier() = single_value->field_routingRuleIdentifier.valueof();
}
if (single_value->field_operationCode.is_bound()) {
ret_val.operationCode() = single_value->field_operationCode.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_routingAccess.is_bound()) {
ret_val.routingAccess() = single_value->field_routingAccess.valueof();
}
if (single_value->field_routingRulePrioroty.is_bound()) {
ret_val.routingRulePrioroty() = single_value->field_routingRulePrioroty.valueof();
}
if (single_value->field_routingFilter.is_bound()) {
ret_val.routingFilter() = single_value->field_routingFilter.valueof();
}
return ret_val;
}

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

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

INTEGER_template& NBIFOM__RoutingRule_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& NBIFOM__RoutingRule_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& NBIFOM__RoutingRule_template::routingRuleIdentifier()
{
set_specific();
return single_value->field_routingRuleIdentifier;
}

const OCTETSTRING_template& NBIFOM__RoutingRule_template::routingRuleIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingRuleIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
return single_value->field_routingRuleIdentifier;
}

BITSTRING_template& NBIFOM__RoutingRule_template::operationCode()
{
set_specific();
return single_value->field_operationCode;
}

const BITSTRING_template& NBIFOM__RoutingRule_template::operationCode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field operationCode of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
return single_value->field_operationCode;
}

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

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

BITSTRING_template& NBIFOM__RoutingRule_template::routingAccess()
{
set_specific();
return single_value->field_routingAccess;
}

const BITSTRING_template& NBIFOM__RoutingRule_template::routingAccess() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAccess of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
return single_value->field_routingAccess;
}

OCTETSTRING_template& NBIFOM__RoutingRule_template::routingRulePrioroty()
{
set_specific();
return single_value->field_routingRulePrioroty;
}

const OCTETSTRING_template& NBIFOM__RoutingRule_template::routingRulePrioroty() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingRulePrioroty of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
return single_value->field_routingRulePrioroty;
}

RoutingFilter_template& NBIFOM__RoutingRule_template::routingFilter()
{
set_specific();
return single_value->field_routingFilter;
}

const RoutingFilter_template& NBIFOM__RoutingRule_template::routingFilter() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingFilter of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
return single_value->field_routingFilter;
}

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

void NBIFOM__RoutingRule_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", routingRuleIdentifier := ");
single_value->field_routingRuleIdentifier.log();
TTCN_Logger::log_event_str(", operationCode := ");
single_value->field_operationCode.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", routingAccess := ");
single_value->field_routingAccess.log();
TTCN_Logger::log_event_str(", routingRulePrioroty := ");
single_value->field_routingRulePrioroty.log();
TTCN_Logger::log_event_str(", routingFilter := ");
single_value->field_routingFilter.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 NBIFOM__RoutingRule_template::log_match(const NBIFOM__RoutingRule& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingRuleIdentifier.match(match_value.routingRuleIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".routingRuleIdentifier");
single_value->field_routingRuleIdentifier.log_match(match_value.routingRuleIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_operationCode.match(match_value.operationCode(), legacy)){
TTCN_Logger::log_logmatch_info(".operationCode");
single_value->field_operationCode.log_match(match_value.operationCode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAccess.match(match_value.routingAccess(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAccess");
single_value->field_routingAccess.log_match(match_value.routingAccess(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingRulePrioroty.match(match_value.routingRulePrioroty(), legacy)){
TTCN_Logger::log_logmatch_info(".routingRulePrioroty");
single_value->field_routingRulePrioroty.log_match(match_value.routingRulePrioroty(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingFilter.match(match_value.routingFilter(), legacy)){
TTCN_Logger::log_logmatch_info(".routingFilter");
single_value->field_routingFilter.log_match(match_value.routingFilter(), 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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", routingRuleIdentifier := ");
single_value->field_routingRuleIdentifier.log_match(match_value.routingRuleIdentifier(), legacy);
TTCN_Logger::log_event_str(", operationCode := ");
single_value->field_operationCode.log_match(match_value.operationCode(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", routingAccess := ");
single_value->field_routingAccess.log_match(match_value.routingAccess(), legacy);
TTCN_Logger::log_event_str(", routingRulePrioroty := ");
single_value->field_routingRulePrioroty.log_match(match_value.routingRulePrioroty(), legacy);
TTCN_Logger::log_event_str(", routingFilter := ");
single_value->field_routingFilter.log_match(match_value.routingFilter(), 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 NBIFOM__RoutingRule_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (routingRuleIdentifier().is_bound()) routingRuleIdentifier().set_implicit_omit();
if (operationCode().is_bound()) operationCode().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (routingAccess().is_bound()) routingAccess().set_implicit_omit();
if (routingRulePrioroty().is_bound()) routingRulePrioroty().set_implicit_omit();
if (routingFilter().is_bound()) routingFilter().set_implicit_omit();
}

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

void NBIFOM__RoutingRule_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_lengthIndicator.decode_text(text_buf);
single_value->field_routingRuleIdentifier.decode_text(text_buf);
single_value->field_operationCode.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_routingAccess.decode_text(text_buf);
single_value->field_routingRulePrioroty.decode_text(text_buf);
single_value->field_routingFilter.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 NBIFOM__RoutingRule_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule.");
}
}

void NBIFOM__RoutingRule_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: {
    NBIFOM__RoutingRule_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routingRuleIdentifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) operationCode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAccess().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) routingRulePrioroty().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) routingFilter().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingRuleIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingRuleIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operationCode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operationCode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAccess")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAccess().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingRulePrioroty")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingRulePrioroty().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingFilter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingFilter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NBIFOM_RoutingRule: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NBIFOM__RoutingRule_template* precondition = new NBIFOM__RoutingRule_template;
    precondition->set_param(*param.get_elem(0));
    NBIFOM__RoutingRule_template* implied_template = new NBIFOM__RoutingRule_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NBIFOM__RoutingRule_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
  }
  is_ifpresent = param.get_ifpresent();
}

void NBIFOM__RoutingRule_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
single_value->field_routingRuleIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
single_value->field_operationCode.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
single_value->field_routingAccess.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
single_value->field_routingRulePrioroty.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
single_value->field_routingFilter.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_RoutingRule");
}

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

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

NBIFOM__AccessUsabilityIndication::NBIFOM__AccessUsabilityIndication()
{
}

NBIFOM__AccessUsabilityIndication::NBIFOM__AccessUsabilityIndication(const BITSTRING& par_threeGPPAccessUsableValue,
    const BITSTRING& par_wLANAccessUsableValue,
    const BITSTRING& par_spare)
  :   field_threeGPPAccessUsableValue(par_threeGPPAccessUsableValue),
  field_wLANAccessUsableValue(par_wLANAccessUsableValue),
  field_spare(par_spare)
{
}

NBIFOM__AccessUsabilityIndication::NBIFOM__AccessUsabilityIndication(const NBIFOM__AccessUsabilityIndication& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication.");
if (other_value.threeGPPAccessUsableValue().is_bound()) field_threeGPPAccessUsableValue = other_value.threeGPPAccessUsableValue();
else field_threeGPPAccessUsableValue.clean_up();
if (other_value.wLANAccessUsableValue().is_bound()) field_wLANAccessUsableValue = other_value.wLANAccessUsableValue();
else field_wLANAccessUsableValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void NBIFOM__AccessUsabilityIndication::clean_up()
{
field_threeGPPAccessUsableValue.clean_up();
field_wLANAccessUsableValue.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* NBIFOM__AccessUsabilityIndication::get_descriptor() const { return &NBIFOM__AccessUsabilityIndication_descr_; }
NBIFOM__AccessUsabilityIndication& NBIFOM__AccessUsabilityIndication::operator=(const NBIFOM__AccessUsabilityIndication& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication.");
  if (other_value.threeGPPAccessUsableValue().is_bound()) field_threeGPPAccessUsableValue = other_value.threeGPPAccessUsableValue();
  else field_threeGPPAccessUsableValue.clean_up();
  if (other_value.wLANAccessUsableValue().is_bound()) field_wLANAccessUsableValue = other_value.wLANAccessUsableValue();
  else field_wLANAccessUsableValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean NBIFOM__AccessUsabilityIndication::operator==(const NBIFOM__AccessUsabilityIndication& other_value) const
{
return field_threeGPPAccessUsableValue==other_value.field_threeGPPAccessUsableValue
  && field_wLANAccessUsableValue==other_value.field_wLANAccessUsableValue
  && field_spare==other_value.field_spare;
}

boolean NBIFOM__AccessUsabilityIndication::is_bound() const
{
return (field_threeGPPAccessUsableValue.is_bound())
  || (field_wLANAccessUsableValue.is_bound())
  || (field_spare.is_bound());
}
boolean NBIFOM__AccessUsabilityIndication::is_value() const
{
return field_threeGPPAccessUsableValue.is_value()
  && field_wLANAccessUsableValue.is_value()
  && field_spare.is_value();
}
void NBIFOM__AccessUsabilityIndication::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ threeGPPAccessUsableValue := ");
field_threeGPPAccessUsableValue.log();
TTCN_Logger::log_event_str(", wLANAccessUsableValue := ");
field_wLANAccessUsableValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void NBIFOM__AccessUsabilityIndication::set_implicit_omit()
{
if (threeGPPAccessUsableValue().is_bound()) threeGPPAccessUsableValue().set_implicit_omit();
if (wLANAccessUsableValue().is_bound()) wLANAccessUsableValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void NBIFOM__AccessUsabilityIndication::encode_text(Text_Buf& text_buf) const
{
field_threeGPPAccessUsableValue.encode_text(text_buf);
field_wLANAccessUsableValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void NBIFOM__AccessUsabilityIndication::decode_text(Text_Buf& text_buf)
{
field_threeGPPAccessUsableValue.decode_text(text_buf);
field_wLANAccessUsableValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int NBIFOM__AccessUsabilityIndication::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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_threeGPPAccessUsableValue.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_wLANAccessUsableValue.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NBIFOM__AccessUsabilityIndication::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::BIT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  encoded_length += field_threeGPPAccessUsableValue.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_wLANAccessUsableValue.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct NBIFOM__AccessUsabilityIndication_template::single_value_struct {
BITSTRING_template field_threeGPPAccessUsableValue;
BITSTRING_template field_wLANAccessUsableValue;
BITSTRING_template field_spare;
};

void NBIFOM__AccessUsabilityIndication_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_threeGPPAccessUsableValue = ANY_VALUE;
single_value->field_wLANAccessUsableValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void NBIFOM__AccessUsabilityIndication_template::copy_value(const NBIFOM__AccessUsabilityIndication& other_value)
{
single_value = new single_value_struct;
if (other_value.threeGPPAccessUsableValue().is_bound()) {
  single_value->field_threeGPPAccessUsableValue = other_value.threeGPPAccessUsableValue();
} else {
  single_value->field_threeGPPAccessUsableValue.clean_up();
}
if (other_value.wLANAccessUsableValue().is_bound()) {
  single_value->field_wLANAccessUsableValue = other_value.wLANAccessUsableValue();
} else {
  single_value->field_wLANAccessUsableValue.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NBIFOM__AccessUsabilityIndication_template::copy_template(const NBIFOM__AccessUsabilityIndication_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.threeGPPAccessUsableValue().get_selection()) {
single_value->field_threeGPPAccessUsableValue = other_value.threeGPPAccessUsableValue();
} else {
single_value->field_threeGPPAccessUsableValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.wLANAccessUsableValue().get_selection()) {
single_value->field_wLANAccessUsableValue = other_value.wLANAccessUsableValue();
} else {
single_value->field_wLANAccessUsableValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NBIFOM__AccessUsabilityIndication_template[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 NBIFOM__AccessUsabilityIndication_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__AccessUsabilityIndication_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication.");
break;
}
set_selection(other_value);
}

NBIFOM__AccessUsabilityIndication_template::NBIFOM__AccessUsabilityIndication_template()
{
}

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

NBIFOM__AccessUsabilityIndication_template::NBIFOM__AccessUsabilityIndication_template(const NBIFOM__AccessUsabilityIndication& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

NBIFOM__AccessUsabilityIndication NBIFOM__AccessUsabilityIndication_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication.");
NBIFOM__AccessUsabilityIndication ret_val;
if (single_value->field_threeGPPAccessUsableValue.is_bound()) {
ret_val.threeGPPAccessUsableValue() = single_value->field_threeGPPAccessUsableValue.valueof();
}
if (single_value->field_wLANAccessUsableValue.is_bound()) {
ret_val.wLANAccessUsableValue() = single_value->field_wLANAccessUsableValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& NBIFOM__AccessUsabilityIndication_template::threeGPPAccessUsableValue()
{
set_specific();
return single_value->field_threeGPPAccessUsableValue;
}

const BITSTRING_template& NBIFOM__AccessUsabilityIndication_template::threeGPPAccessUsableValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field threeGPPAccessUsableValue of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication.");
return single_value->field_threeGPPAccessUsableValue;
}

BITSTRING_template& NBIFOM__AccessUsabilityIndication_template::wLANAccessUsableValue()
{
set_specific();
return single_value->field_wLANAccessUsableValue;
}

const BITSTRING_template& NBIFOM__AccessUsabilityIndication_template::wLANAccessUsableValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field wLANAccessUsableValue of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication.");
return single_value->field_wLANAccessUsableValue;
}

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

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

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

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

void NBIFOM__AccessUsabilityIndication_template::log_match(const NBIFOM__AccessUsabilityIndication& 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_threeGPPAccessUsableValue.match(match_value.threeGPPAccessUsableValue(), legacy)){
TTCN_Logger::log_logmatch_info(".threeGPPAccessUsableValue");
single_value->field_threeGPPAccessUsableValue.log_match(match_value.threeGPPAccessUsableValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_wLANAccessUsableValue.match(match_value.wLANAccessUsableValue(), legacy)){
TTCN_Logger::log_logmatch_info(".wLANAccessUsableValue");
single_value->field_wLANAccessUsableValue.log_match(match_value.wLANAccessUsableValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ threeGPPAccessUsableValue := ");
single_value->field_threeGPPAccessUsableValue.log_match(match_value.threeGPPAccessUsableValue(), legacy);
TTCN_Logger::log_event_str(", wLANAccessUsableValue := ");
single_value->field_wLANAccessUsableValue.log_match(match_value.wLANAccessUsableValue(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void NBIFOM__AccessUsabilityIndication_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (threeGPPAccessUsableValue().is_bound()) threeGPPAccessUsableValue().set_implicit_omit();
if (wLANAccessUsableValue().is_bound()) wLANAccessUsableValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void NBIFOM__AccessUsabilityIndication_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_threeGPPAccessUsableValue.decode_text(text_buf);
single_value->field_wLANAccessUsableValue.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NBIFOM__AccessUsabilityIndication_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication.");
}
}

void NBIFOM__AccessUsabilityIndication_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: {
    NBIFOM__AccessUsabilityIndication_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication 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) threeGPPAccessUsableValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) wLANAccessUsableValue().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "threeGPPAccessUsableValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          threeGPPAccessUsableValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "wLANAccessUsableValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          wLANAccessUsableValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NBIFOM__AccessUsabilityIndication_template* precondition = new NBIFOM__AccessUsabilityIndication_template;
    precondition->set_param(*param.get_elem(0));
    NBIFOM__AccessUsabilityIndication_template* implied_template = new NBIFOM__AccessUsabilityIndication_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NBIFOM__AccessUsabilityIndication_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication");
  }
  is_ifpresent = param.get_ifpresent();
}

void NBIFOM__AccessUsabilityIndication_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_threeGPPAccessUsableValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication");
single_value->field_wLANAccessUsableValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_AccessUsabilityIndication");
}

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

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

NBIFOM__Parameter::NBIFOM__Parameter()
{
}

NBIFOM__Parameter::NBIFOM__Parameter(const OCTETSTRING& par_parameterIdentifier,
    const INTEGER& par_lengthIndicator,
    const NBIFOM__ParameterContents& par_parameterContents)
  :   field_parameterIdentifier(par_parameterIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_parameterContents(par_parameterContents)
{
}

NBIFOM__Parameter::NBIFOM__Parameter(const NBIFOM__Parameter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
if (other_value.parameterIdentifier().is_bound()) field_parameterIdentifier = other_value.parameterIdentifier();
else field_parameterIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.parameterContents().is_bound()) field_parameterContents = other_value.parameterContents();
else field_parameterContents.clean_up();
}

void NBIFOM__Parameter::clean_up()
{
field_parameterIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_parameterContents.clean_up();
}

const TTCN_Typedescriptor_t* NBIFOM__Parameter::get_descriptor() const { return &NBIFOM__Parameter_descr_; }
NBIFOM__Parameter& NBIFOM__Parameter::operator=(const NBIFOM__Parameter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
  if (other_value.parameterIdentifier().is_bound()) field_parameterIdentifier = other_value.parameterIdentifier();
  else field_parameterIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.parameterContents().is_bound()) field_parameterContents = other_value.parameterContents();
  else field_parameterContents.clean_up();
}
return *this;
}

boolean NBIFOM__Parameter::operator==(const NBIFOM__Parameter& other_value) const
{
return field_parameterIdentifier==other_value.field_parameterIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_parameterContents==other_value.field_parameterContents;
}

boolean NBIFOM__Parameter::is_bound() const
{
return (field_parameterIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_parameterContents.is_bound());
}
boolean NBIFOM__Parameter::is_value() const
{
return field_parameterIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_parameterContents.is_value();
}
void NBIFOM__Parameter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ parameterIdentifier := ");
field_parameterIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", parameterContents := ");
field_parameterContents.log();
TTCN_Logger::log_event_str(" }");
}

void NBIFOM__Parameter::set_implicit_omit()
{
if (parameterIdentifier().is_bound()) parameterIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (parameterContents().is_bound()) parameterContents().set_implicit_omit();
}

void NBIFOM__Parameter::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter 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) parameterIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) parameterContents().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(), "parameterIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parameterContents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterContents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NBIFOM_Parameter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
  }
}

void NBIFOM__Parameter::encode_text(Text_Buf& text_buf) const
{
field_parameterIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_parameterContents.encode_text(text_buf);
}

void NBIFOM__Parameter::decode_text(Text_Buf& text_buf)
{
field_parameterIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_parameterContents.decode_text(text_buf);
}

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

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

int NBIFOM__Parameter::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_parameterIdentifier.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, NBIFOM__Parameter_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NBIFOM__Parameter_lengthIndicator_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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(NBIFOM__Parameter_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  if (field_parameterIdentifier ==  os_22) selected_field = 0;
  else if (field_parameterIdentifier ==  os_23) selected_field = 1;
  else if (field_parameterIdentifier ==  os_24) selected_field = 2;
  else if (field_parameterIdentifier ==  os_25) selected_field = 3;
  else if (field_parameterIdentifier ==  os_26) selected_field = 4;
  else if (field_parameterIdentifier ==  os_27) selected_field = 5;
  else if (field_parameterIdentifier ==  os_28) selected_field = 6;
  else if (field_parameterIdentifier ==  os_29) selected_field = 7;
  else selected_field = 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, NBIFOM__Parameter_parameterContents_descr_.raw->forceomit);
  decoded_field_length = field_parameterContents.RAW_decode(NBIFOM__Parameter_parameterContents_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NBIFOM__Parameter::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, NBIFOM__Parameter_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, NBIFOM__Parameter_parameterContents_descr_.raw);
  encoded_length += field_parameterIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &NBIFOM__Parameter_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_parameterContents.RAW_encode(NBIFOM__Parameter_parameterContents_descr_, *myleaf.body.node.nodes[2]);
  switch (field_parameterContents.get_selection()) {
  case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
  if (field_parameterIdentifier !=  os_22) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
  if (field_parameterIdentifier !=  os_23) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_23.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
  if (field_parameterIdentifier !=  os_24) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_24.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
  if (field_parameterIdentifier !=  os_25) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_25.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
  if (field_parameterIdentifier !=  os_26) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_26.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
  if (field_parameterIdentifier !=  os_27) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_27.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
  if (field_parameterIdentifier !=  os_28) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
  if (field_parameterIdentifier !=  os_29) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     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_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct NBIFOM__Parameter_template::single_value_struct {
OCTETSTRING_template field_parameterIdentifier;
INTEGER_template field_lengthIndicator;
NBIFOM__ParameterContents_template field_parameterContents;
};

void NBIFOM__Parameter_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_parameterIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_parameterContents = ANY_VALUE;
}
}
}

void NBIFOM__Parameter_template::copy_value(const NBIFOM__Parameter& other_value)
{
single_value = new single_value_struct;
if (other_value.parameterIdentifier().is_bound()) {
  single_value->field_parameterIdentifier = other_value.parameterIdentifier();
} else {
  single_value->field_parameterIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.parameterContents().is_bound()) {
  single_value->field_parameterContents = other_value.parameterContents();
} else {
  single_value->field_parameterContents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NBIFOM__Parameter_template::copy_template(const NBIFOM__Parameter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.parameterIdentifier().get_selection()) {
single_value->field_parameterIdentifier = other_value.parameterIdentifier();
} else {
single_value->field_parameterIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.parameterContents().get_selection()) {
single_value->field_parameterContents = other_value.parameterContents();
} else {
single_value->field_parameterContents.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 NBIFOM__Parameter_template[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 NBIFOM__Parameter_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__Parameter_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
break;
}
set_selection(other_value);
}

NBIFOM__Parameter_template::NBIFOM__Parameter_template()
{
}

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

NBIFOM__Parameter_template::NBIFOM__Parameter_template(const NBIFOM__Parameter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NBIFOM__Parameter_template::match(const NBIFOM__Parameter& 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.parameterIdentifier().is_bound()) return FALSE;
if(!single_value->field_parameterIdentifier.match(other_value.parameterIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.parameterContents().is_bound()) return FALSE;
if(!single_value->field_parameterContents.match(other_value.parameterContents(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
}
return FALSE;
}

boolean NBIFOM__Parameter_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_parameterIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_parameterContents.is_bound();
}

boolean NBIFOM__Parameter_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_parameterIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_parameterContents.is_value();
}

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

NBIFOM__Parameter NBIFOM__Parameter_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
NBIFOM__Parameter ret_val;
if (single_value->field_parameterIdentifier.is_bound()) {
ret_val.parameterIdentifier() = single_value->field_parameterIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_parameterContents.is_bound()) {
ret_val.parameterContents() = single_value->field_parameterContents.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& NBIFOM__Parameter_template::parameterIdentifier()
{
set_specific();
return single_value->field_parameterIdentifier;
}

const OCTETSTRING_template& NBIFOM__Parameter_template::parameterIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parameterIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
return single_value->field_parameterIdentifier;
}

INTEGER_template& NBIFOM__Parameter_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& NBIFOM__Parameter_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
return single_value->field_lengthIndicator;
}

NBIFOM__ParameterContents_template& NBIFOM__Parameter_template::parameterContents()
{
set_specific();
return single_value->field_parameterContents;
}

const NBIFOM__ParameterContents_template& NBIFOM__Parameter_template::parameterContents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parameterContents of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
return single_value->field_parameterContents;
}

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

void NBIFOM__Parameter_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ parameterIdentifier := ");
single_value->field_parameterIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", parameterContents := ");
single_value->field_parameterContents.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 NBIFOM__Parameter_template::log_match(const NBIFOM__Parameter& 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_parameterIdentifier.match(match_value.parameterIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".parameterIdentifier");
single_value->field_parameterIdentifier.log_match(match_value.parameterIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_parameterContents.match(match_value.parameterContents(), legacy)){
TTCN_Logger::log_logmatch_info(".parameterContents");
single_value->field_parameterContents.log_match(match_value.parameterContents(), 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("{ parameterIdentifier := ");
single_value->field_parameterIdentifier.log_match(match_value.parameterIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", parameterContents := ");
single_value->field_parameterContents.log_match(match_value.parameterContents(), 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 NBIFOM__Parameter_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (parameterIdentifier().is_bound()) parameterIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (parameterContents().is_bound()) parameterContents().set_implicit_omit();
}

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

void NBIFOM__Parameter_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_parameterIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_parameterContents.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 NBIFOM__Parameter_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
}
}

void NBIFOM__Parameter_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: {
    NBIFOM__Parameter_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter 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) parameterIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) parameterContents().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(), "parameterIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "parameterContents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterContents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NBIFOM_Parameter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NBIFOM__Parameter_template* precondition = new NBIFOM__Parameter_template;
    precondition->set_param(*param.get_elem(0));
    NBIFOM__Parameter_template* implied_template = new NBIFOM__Parameter_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NBIFOM__Parameter_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
  }
  is_ifpresent = param.get_ifpresent();
}

void NBIFOM__Parameter_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_parameterIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
single_value->field_parameterContents.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
}

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

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

NBIFOM__ContainerTLV::NBIFOM__ContainerTLV()
{
}

NBIFOM__ContainerTLV::NBIFOM__ContainerTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const NBIFOM__ParameterList& par_contents)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_contents(par_contents)
{
}

NBIFOM__ContainerTLV::NBIFOM__ContainerTLV(const NBIFOM__ContainerTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.contents().is_bound()) field_contents = other_value.contents();
else field_contents.clean_up();
}

void NBIFOM__ContainerTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_contents.clean_up();
}

const TTCN_Typedescriptor_t* NBIFOM__ContainerTLV::get_descriptor() const { return &NBIFOM__ContainerTLV_descr_; }
NBIFOM__ContainerTLV& NBIFOM__ContainerTLV::operator=(const NBIFOM__ContainerTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.contents().is_bound()) field_contents = other_value.contents();
  else field_contents.clean_up();
}
return *this;
}

boolean NBIFOM__ContainerTLV::operator==(const NBIFOM__ContainerTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_contents==other_value.field_contents;
}

boolean NBIFOM__ContainerTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_contents.is_bound());
}
boolean NBIFOM__ContainerTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_contents.is_value();
}
void NBIFOM__ContainerTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", contents := ");
field_contents.log();
TTCN_Logger::log_event_str(" }");
}

void NBIFOM__ContainerTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (contents().is_bound()) contents().set_implicit_omit();
}

void NBIFOM__ContainerTLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) contents().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
  }
}

void NBIFOM__ContainerTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_contents.encode_text(text_buf);
}

void NBIFOM__ContainerTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_contents.decode_text(text_buf);
}

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

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

int NBIFOM__ContainerTLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, NBIFOM__ContainerTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NBIFOM__ContainerTLV_lengthIndicator_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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(NBIFOM__ContainerTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, NBIFOM__ParameterList_descr_.raw->forceomit);
  decoded_field_length = field_contents.RAW_decode(NBIFOM__ParameterList_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), 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());
  value_of_length_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  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 NBIFOM__ContainerTLV::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, NBIFOM__ContainerTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, NBIFOM__ParameterList_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &NBIFOM__ContainerTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_contents.RAW_encode(NBIFOM__ParameterList_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  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 NBIFOM__ContainerTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
NBIFOM__ParameterList_template field_contents;
};

void NBIFOM__ContainerTLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_contents = ANY_VALUE;
}
}
}

void NBIFOM__ContainerTLV_template::copy_value(const NBIFOM__ContainerTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.contents().is_bound()) {
  single_value->field_contents = other_value.contents();
} else {
  single_value->field_contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NBIFOM__ContainerTLV_template::copy_template(const NBIFOM__ContainerTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.contents().get_selection()) {
single_value->field_contents = other_value.contents();
} else {
single_value->field_contents.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NBIFOM__ContainerTLV_template[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 NBIFOM__ContainerTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__ContainerTLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
break;
}
set_selection(other_value);
}

NBIFOM__ContainerTLV_template::NBIFOM__ContainerTLV_template()
{
}

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

NBIFOM__ContainerTLV_template::NBIFOM__ContainerTLV_template(const NBIFOM__ContainerTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NBIFOM__ContainerTLV_template::match(const NBIFOM__ContainerTLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.contents().is_bound()) return FALSE;
if(!single_value->field_contents.match(other_value.contents(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
}
return FALSE;
}

boolean NBIFOM__ContainerTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_contents.is_bound();
}

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

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

NBIFOM__ContainerTLV NBIFOM__ContainerTLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
NBIFOM__ContainerTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_contents.is_bound()) {
ret_val.contents() = single_value->field_contents.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& NBIFOM__ContainerTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& NBIFOM__ContainerTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& NBIFOM__ContainerTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& NBIFOM__ContainerTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
return single_value->field_lengthIndicator;
}

NBIFOM__ParameterList_template& NBIFOM__ContainerTLV_template::contents()
{
set_specific();
return single_value->field_contents;
}

const NBIFOM__ParameterList_template& NBIFOM__ContainerTLV_template::contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field contents of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
return single_value->field_contents;
}

int NBIFOM__ContainerTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
  }
  return 0;
}

void NBIFOM__ContainerTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", contents := ");
single_value->field_contents.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void NBIFOM__ContainerTLV_template::log_match(const NBIFOM__ContainerTLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_contents.match(match_value.contents(), legacy)){
TTCN_Logger::log_logmatch_info(".contents");
single_value->field_contents.log_match(match_value.contents(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", contents := ");
single_value->field_contents.log_match(match_value.contents(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void NBIFOM__ContainerTLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (contents().is_bound()) contents().set_implicit_omit();
}

void NBIFOM__ContainerTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_contents.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
}
}

void NBIFOM__ContainerTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_contents.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NBIFOM__ContainerTLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
}
}

void NBIFOM__ContainerTLV_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: {
    NBIFOM__ContainerTLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) contents().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NBIFOM__ContainerTLV_template* precondition = new NBIFOM__ContainerTLV_template;
    precondition->set_param(*param.get_elem(0));
    NBIFOM__ContainerTLV_template* implied_template = new NBIFOM__ContainerTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NBIFOM__ContainerTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NBIFOM__ContainerTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
single_value->field_contents.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
}

boolean NBIFOM__ContainerTLV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean NBIFOM__ContainerTLV_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;
}

PDPContextStatusTLV::PDPContextStatusTLV()
{
}

PDPContextStatusTLV::PDPContextStatusTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

PDPContextStatusTLV::PDPContextStatusTLV(const PDPContextStatusTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void PDPContextStatusTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* PDPContextStatusTLV::get_descriptor() const { return &PDPContextStatusTLV_descr_; }
PDPContextStatusTLV& PDPContextStatusTLV::operator=(const PDPContextStatusTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

boolean PDPContextStatusTLV::operator==(const PDPContextStatusTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_valueField==other_value.field_valueField;
}

boolean PDPContextStatusTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_valueField.is_bound());
}
boolean PDPContextStatusTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_valueField.is_value();
}
void PDPContextStatusTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void PDPContextStatusTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void PDPContextStatusTLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDPContextStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
  }
}

void PDPContextStatusTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void PDPContextStatusTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

void PDPContextStatusTLV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDPContextStatusTLV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDPContextStatusTLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PDPContextStatusTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PDPContextStatusTLV_lengthIndicator_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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(PDPContextStatusTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(General__Types::OCT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), 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());
  value_of_length_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_18) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDPContextStatusTLV::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, PDPContextStatusTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT2_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &PDPContextStatusTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_valueField.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_18) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_18.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDPContextStatusTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valueField;
};

void PDPContextStatusTLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_valueField = ANY_VALUE;
}
}
}

void PDPContextStatusTLV_template::copy_value(const PDPContextStatusTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDPContextStatusTLV_template::copy_template(const PDPContextStatusTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDPContextStatusTLV_template[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 PDPContextStatusTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new PDPContextStatusTLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
break;
}
set_selection(other_value);
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template()
{
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template(const PDPContextStatusTLV& other_value)
{
copy_value(other_value);
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template(const OPTIONAL<PDPContextStatusTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDPContextStatusTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV from an unbound optional field.");
}
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template(PDPContextStatusTLV_template* p_precondition, PDPContextStatusTLV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template(Dynamic_Match_Interface<PDPContextStatusTLV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDPContextStatusTLV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template(const PDPContextStatusTLV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDPContextStatusTLV_template::~PDPContextStatusTLV_template()
{
clean_up();
}

PDPContextStatusTLV_template& PDPContextStatusTLV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDPContextStatusTLV_template& PDPContextStatusTLV_template::operator=(const PDPContextStatusTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDPContextStatusTLV_template& PDPContextStatusTLV_template::operator=(const OPTIONAL<PDPContextStatusTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDPContextStatusTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
}
return *this;
}

PDPContextStatusTLV_template& PDPContextStatusTLV_template::operator=(const PDPContextStatusTLV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDPContextStatusTLV_template::match(const PDPContextStatusTLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
}
return FALSE;
}

boolean PDPContextStatusTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_valueField.is_bound();
}

boolean PDPContextStatusTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_valueField.is_value();
}

void PDPContextStatusTLV_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;
}

PDPContextStatusTLV PDPContextStatusTLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
PDPContextStatusTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void PDPContextStatusTLV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDPContextStatusTLV_template[list_length];
}

PDPContextStatusTLV_template& PDPContextStatusTLV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDPContextStatusTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& PDPContextStatusTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& PDPContextStatusTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& PDPContextStatusTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& PDPContextStatusTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const OCTETSTRING_template& PDPContextStatusTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
return single_value->field_valueField;
}

int PDPContextStatusTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
  }
  return 0;
}

void PDPContextStatusTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDPContextStatusTLV_template::log_match(const PDPContextStatusTLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDPContextStatusTLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void PDPContextStatusTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_valueField.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
}
}

void PDPContextStatusTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDPContextStatusTLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
}
}

void PDPContextStatusTLV_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: {
    PDPContextStatusTLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDPContextStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDPContextStatusTLV_template* precondition = new PDPContextStatusTLV_template;
    precondition->set_param(*param.get_elem(0));
    PDPContextStatusTLV_template* implied_template = new PDPContextStatusTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDPContextStatusTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDPContextStatusTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
}

boolean PDPContextStatusTLV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDPContextStatusTLV_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;
}

RadioPriorityV::RadioPriorityV()
{
}

RadioPriorityV::RadioPriorityV(const BITSTRING& par_priorityLevelValue,
    const BITSTRING& par_spare)
  :   field_priorityLevelValue(par_priorityLevelValue),
  field_spare(par_spare)
{
}

RadioPriorityV::RadioPriorityV(const RadioPriorityV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
else field_priorityLevelValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void RadioPriorityV::clean_up()
{
field_priorityLevelValue.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriorityV::get_descriptor() const { return &RadioPriorityV_descr_; }
RadioPriorityV& RadioPriorityV::operator=(const RadioPriorityV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
  if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
  else field_priorityLevelValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean RadioPriorityV::operator==(const RadioPriorityV& other_value) const
{
return field_priorityLevelValue==other_value.field_priorityLevelValue
  && field_spare==other_value.field_spare;
}

boolean RadioPriorityV::is_bound() const
{
return (field_priorityLevelValue.is_bound())
  || (field_spare.is_bound());
}
boolean RadioPriorityV::is_value() const
{
return field_priorityLevelValue.is_value()
  && field_spare.is_value();
}
void RadioPriorityV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
field_priorityLevelValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void RadioPriorityV::set_implicit_omit()
{
if (priorityLevelValue().is_bound()) priorityLevelValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void RadioPriorityV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RadioPriorityV 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) priorityLevelValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriorityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriorityV");
  }
}

void RadioPriorityV::encode_text(Text_Buf& text_buf) const
{
field_priorityLevelValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void RadioPriorityV::decode_text(Text_Buf& text_buf)
{
field_priorityLevelValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void RadioPriorityV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RadioPriorityV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RadioPriorityV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_priorityLevelValue.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RadioPriorityV::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::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_priorityLevelValue.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RadioPriorityV_template::single_value_struct {
BITSTRING_template field_priorityLevelValue;
BITSTRING_template field_spare;
};

void RadioPriorityV_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_priorityLevelValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void RadioPriorityV_template::copy_value(const RadioPriorityV& other_value)
{
single_value = new single_value_struct;
if (other_value.priorityLevelValue().is_bound()) {
  single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
  single_value->field_priorityLevelValue.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RadioPriorityV_template::copy_template(const RadioPriorityV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.priorityLevelValue().get_selection()) {
single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
single_value->field_priorityLevelValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RadioPriorityV_template[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 RadioPriorityV_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriorityV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
break;
}
set_selection(other_value);
}

RadioPriorityV_template::RadioPriorityV_template()
{
}

RadioPriorityV_template::RadioPriorityV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RadioPriorityV_template::RadioPriorityV_template(const RadioPriorityV& other_value)
{
copy_value(other_value);
}

RadioPriorityV_template::RadioPriorityV_template(const OPTIONAL<RadioPriorityV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RadioPriorityV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.RadioPriorityV from an unbound optional field.");
}
}

RadioPriorityV_template::RadioPriorityV_template(RadioPriorityV_template* p_precondition, RadioPriorityV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RadioPriorityV_template::RadioPriorityV_template(Dynamic_Match_Interface<RadioPriorityV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RadioPriorityV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RadioPriorityV_template::RadioPriorityV_template(const RadioPriorityV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RadioPriorityV_template::~RadioPriorityV_template()
{
clean_up();
}

RadioPriorityV_template& RadioPriorityV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RadioPriorityV_template& RadioPriorityV_template::operator=(const RadioPriorityV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RadioPriorityV_template& RadioPriorityV_template::operator=(const OPTIONAL<RadioPriorityV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RadioPriorityV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
}
return *this;
}

RadioPriorityV_template& RadioPriorityV_template::operator=(const RadioPriorityV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RadioPriorityV_template::match(const RadioPriorityV& 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.priorityLevelValue().is_bound()) return FALSE;
if(!single_value->field_priorityLevelValue.match(other_value.priorityLevelValue(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
}
return FALSE;
}

boolean RadioPriorityV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_priorityLevelValue.is_bound()
 || single_value->field_spare.is_bound();
}

boolean RadioPriorityV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_priorityLevelValue.is_value()
 && single_value->field_spare.is_value();
}

void RadioPriorityV_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;
}

RadioPriorityV RadioPriorityV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
RadioPriorityV ret_val;
if (single_value->field_priorityLevelValue.is_bound()) {
ret_val.priorityLevelValue() = single_value->field_priorityLevelValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void RadioPriorityV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriorityV_template[list_length];
}

RadioPriorityV_template& RadioPriorityV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
return value_list.list_value[list_index];
}

BITSTRING_template& RadioPriorityV_template::priorityLevelValue()
{
set_specific();
return single_value->field_priorityLevelValue;
}

const BITSTRING_template& RadioPriorityV_template::priorityLevelValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityLevelValue of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
return single_value->field_priorityLevelValue;
}

BITSTRING_template& RadioPriorityV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& RadioPriorityV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
return single_value->field_spare;
}

int RadioPriorityV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
  }
  return 0;
}

void RadioPriorityV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RadioPriorityV_template::log_match(const RadioPriorityV& 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_priorityLevelValue.match(match_value.priorityLevelValue(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityLevelValue");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RadioPriorityV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (priorityLevelValue().is_bound()) priorityLevelValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void RadioPriorityV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_priorityLevelValue.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
}
}

void RadioPriorityV_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_priorityLevelValue.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RadioPriorityV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
}
}

void RadioPriorityV_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: {
    RadioPriorityV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RadioPriorityV 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) priorityLevelValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriorityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriorityV_template* precondition = new RadioPriorityV_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriorityV_template* implied_template = new RadioPriorityV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriorityV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriorityV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriorityV_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_priorityLevelValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityV");
}

boolean RadioPriorityV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RadioPriorityV_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;
}

RadioPriorityTV::RadioPriorityTV()
{
}

RadioPriorityTV::RadioPriorityTV(const RadioPriorityV& par_valueField,
    const BITSTRING& par_elementIdentifier)
  :   field_valueField(par_valueField),
  field_elementIdentifier(par_elementIdentifier)
{
}

RadioPriorityTV::RadioPriorityTV(const RadioPriorityTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void RadioPriorityTV::clean_up()
{
field_valueField.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriorityTV::get_descriptor() const { return &RadioPriorityTV_descr_; }
RadioPriorityTV& RadioPriorityTV::operator=(const RadioPriorityTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean RadioPriorityTV::operator==(const RadioPriorityTV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean RadioPriorityTV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean RadioPriorityTV::is_value() const
{
return field_valueField.is_value()
  && field_elementIdentifier.is_value();
}
void RadioPriorityTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void RadioPriorityTV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RadioPriorityTV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RadioPriorityTV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriorityTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriorityTV");
  }
}

void RadioPriorityTV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void RadioPriorityTV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void RadioPriorityTV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RadioPriorityTV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RadioPriorityTV::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, RadioPriorityV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(RadioPriorityV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  bs_10) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RadioPriorityTV::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, RadioPriorityV_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_valueField.RAW_encode(RadioPriorityV_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  bs_10) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_10.RAW_encode(General__Types::BIT4_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 RadioPriorityTV_template::single_value_struct {
RadioPriorityV_template field_valueField;
BITSTRING_template field_elementIdentifier;
};

void RadioPriorityTV_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_valueField = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void RadioPriorityTV_template::copy_value(const RadioPriorityTV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RadioPriorityTV_template::copy_template(const RadioPriorityTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 RadioPriorityTV_template[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 RadioPriorityTV_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriorityTV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
break;
}
set_selection(other_value);
}

RadioPriorityTV_template::RadioPriorityTV_template()
{
}

RadioPriorityTV_template::RadioPriorityTV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RadioPriorityTV_template::RadioPriorityTV_template(const RadioPriorityTV& other_value)
{
copy_value(other_value);
}

RadioPriorityTV_template::RadioPriorityTV_template(const OPTIONAL<RadioPriorityTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RadioPriorityTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV from an unbound optional field.");
}
}

RadioPriorityTV_template::RadioPriorityTV_template(RadioPriorityTV_template* p_precondition, RadioPriorityTV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RadioPriorityTV_template::RadioPriorityTV_template(Dynamic_Match_Interface<RadioPriorityTV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RadioPriorityTV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RadioPriorityTV_template::RadioPriorityTV_template(const RadioPriorityTV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RadioPriorityTV_template::~RadioPriorityTV_template()
{
clean_up();
}

RadioPriorityTV_template& RadioPriorityTV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RadioPriorityTV_template& RadioPriorityTV_template::operator=(const RadioPriorityTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RadioPriorityTV_template& RadioPriorityTV_template::operator=(const OPTIONAL<RadioPriorityTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RadioPriorityTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
}
return *this;
}

RadioPriorityTV_template& RadioPriorityTV_template::operator=(const RadioPriorityTV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RadioPriorityTV_template::match(const RadioPriorityTV& 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
}
return FALSE;
}

boolean RadioPriorityTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_valueField.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean RadioPriorityTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_valueField.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void RadioPriorityTV_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;
}

RadioPriorityTV RadioPriorityTV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
RadioPriorityTV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void RadioPriorityTV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriorityTV_template[list_length];
}

RadioPriorityTV_template& RadioPriorityTV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
return value_list.list_value[list_index];
}

RadioPriorityV_template& RadioPriorityTV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const RadioPriorityV_template& RadioPriorityTV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
return single_value->field_valueField;
}

BITSTRING_template& RadioPriorityTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& RadioPriorityTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
return single_value->field_elementIdentifier;
}

int RadioPriorityTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
  }
  return 0;
}

void RadioPriorityTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valueField := ");
single_value->field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 RadioPriorityTV_template::log_match(const RadioPriorityTV& 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 RadioPriorityTV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RadioPriorityTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_valueField.encode_text(text_buf);
single_value->field_elementIdentifier.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
}
}

void RadioPriorityTV_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_valueField.decode_text(text_buf);
single_value->field_elementIdentifier.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 RadioPriorityTV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
}
}

void RadioPriorityTV_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: {
    RadioPriorityTV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RadioPriorityTV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriorityTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriorityTV_template* precondition = new RadioPriorityTV_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriorityTV_template* implied_template = new RadioPriorityTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriorityTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriorityTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriorityTV_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_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityTV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityTV");
}

boolean RadioPriorityTV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RadioPriorityTV_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;
}

GPRSTimerV::GPRSTimerV()
{
}

GPRSTimerV::GPRSTimerV(const BITSTRING& par_timerValue,
    const BITSTRING& par_unit)
  :   field_timerValue(par_timerValue),
  field_unit(par_unit)
{
}

GPRSTimerV::GPRSTimerV(const GPRSTimerV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
if (other_value.timerValue().is_bound()) field_timerValue = other_value.timerValue();
else field_timerValue.clean_up();
if (other_value.unit().is_bound()) field_unit = other_value.unit();
else field_unit.clean_up();
}

void GPRSTimerV::clean_up()
{
field_timerValue.clean_up();
field_unit.clean_up();
}

const TTCN_Typedescriptor_t* GPRSTimerV::get_descriptor() const { return &GPRSTimerV_descr_; }
GPRSTimerV& GPRSTimerV::operator=(const GPRSTimerV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
  if (other_value.timerValue().is_bound()) field_timerValue = other_value.timerValue();
  else field_timerValue.clean_up();
  if (other_value.unit().is_bound()) field_unit = other_value.unit();
  else field_unit.clean_up();
}
return *this;
}

boolean GPRSTimerV::operator==(const GPRSTimerV& other_value) const
{
return field_timerValue==other_value.field_timerValue
  && field_unit==other_value.field_unit;
}

boolean GPRSTimerV::is_bound() const
{
return (field_timerValue.is_bound())
  || (field_unit.is_bound());
}
boolean GPRSTimerV::is_value() const
{
return field_timerValue.is_value()
  && field_unit.is_value();
}
void GPRSTimerV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ timerValue := ");
field_timerValue.log();
TTCN_Logger::log_event_str(", unit := ");
field_unit.log();
TTCN_Logger::log_event_str(" }");
}

void GPRSTimerV::set_implicit_omit()
{
if (timerValue().is_bound()) timerValue().set_implicit_omit();
if (unit().is_bound()) unit().set_implicit_omit();
}

void GPRSTimerV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.GPRSTimerV 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) timerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unit().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(), "timerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.GPRSTimerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GPRSTimerV");
  }
}

void GPRSTimerV::encode_text(Text_Buf& text_buf) const
{
field_timerValue.encode_text(text_buf);
field_unit.encode_text(text_buf);
}

void GPRSTimerV::decode_text(Text_Buf& text_buf)
{
field_timerValue.decode_text(text_buf);
field_unit.decode_text(text_buf);
}

void GPRSTimerV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void GPRSTimerV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int GPRSTimerV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_timerValue.RAW_decode(General__Types::BIT5_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_unit.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GPRSTimerV::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::BIT5_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  encoded_length += field_timerValue.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_unit.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct GPRSTimerV_template::single_value_struct {
BITSTRING_template field_timerValue;
BITSTRING_template field_unit;
};

void GPRSTimerV_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_timerValue = ANY_VALUE;
single_value->field_unit = ANY_VALUE;
}
}
}

void GPRSTimerV_template::copy_value(const GPRSTimerV& other_value)
{
single_value = new single_value_struct;
if (other_value.timerValue().is_bound()) {
  single_value->field_timerValue = other_value.timerValue();
} else {
  single_value->field_timerValue.clean_up();
}
if (other_value.unit().is_bound()) {
  single_value->field_unit = other_value.unit();
} else {
  single_value->field_unit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GPRSTimerV_template::copy_template(const GPRSTimerV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.timerValue().get_selection()) {
single_value->field_timerValue = other_value.timerValue();
} else {
single_value->field_timerValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.unit().get_selection()) {
single_value->field_unit = other_value.unit();
} else {
single_value->field_unit.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 GPRSTimerV_template[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 GPRSTimerV_template(*other_value.implication_.precondition);
implication_.implied_template = new GPRSTimerV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
break;
}
set_selection(other_value);
}

GPRSTimerV_template::GPRSTimerV_template()
{
}

GPRSTimerV_template::GPRSTimerV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

GPRSTimerV_template::GPRSTimerV_template(const GPRSTimerV& other_value)
{
copy_value(other_value);
}

GPRSTimerV_template::GPRSTimerV_template(const OPTIONAL<GPRSTimerV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GPRSTimerV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.GPRSTimerV from an unbound optional field.");
}
}

GPRSTimerV_template::GPRSTimerV_template(GPRSTimerV_template* p_precondition, GPRSTimerV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

GPRSTimerV_template::GPRSTimerV_template(Dynamic_Match_Interface<GPRSTimerV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<GPRSTimerV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

GPRSTimerV_template::GPRSTimerV_template(const GPRSTimerV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

GPRSTimerV_template::~GPRSTimerV_template()
{
clean_up();
}

GPRSTimerV_template& GPRSTimerV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

GPRSTimerV_template& GPRSTimerV_template::operator=(const GPRSTimerV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

GPRSTimerV_template& GPRSTimerV_template::operator=(const OPTIONAL<GPRSTimerV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GPRSTimerV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
}
return *this;
}

GPRSTimerV_template& GPRSTimerV_template::operator=(const GPRSTimerV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean GPRSTimerV_template::match(const GPRSTimerV& 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.timerValue().is_bound()) return FALSE;
if(!single_value->field_timerValue.match(other_value.timerValue(), legacy))return FALSE;
if(!other_value.unit().is_bound()) return FALSE;
if(!single_value->field_unit.match(other_value.unit(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
}
return FALSE;
}

boolean GPRSTimerV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_timerValue.is_bound()
 || single_value->field_unit.is_bound();
}

boolean GPRSTimerV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_timerValue.is_value()
 && single_value->field_unit.is_value();
}

void GPRSTimerV_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;
}

GPRSTimerV GPRSTimerV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
GPRSTimerV ret_val;
if (single_value->field_timerValue.is_bound()) {
ret_val.timerValue() = single_value->field_timerValue.valueof();
}
if (single_value->field_unit.is_bound()) {
ret_val.unit() = single_value->field_unit.valueof();
}
return ret_val;
}

void GPRSTimerV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GPRSTimerV_template[list_length];
}

GPRSTimerV_template& GPRSTimerV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
return value_list.list_value[list_index];
}

BITSTRING_template& GPRSTimerV_template::timerValue()
{
set_specific();
return single_value->field_timerValue;
}

const BITSTRING_template& GPRSTimerV_template::timerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timerValue of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
return single_value->field_timerValue;
}

BITSTRING_template& GPRSTimerV_template::unit()
{
set_specific();
return single_value->field_unit;
}

const BITSTRING_template& GPRSTimerV_template::unit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field unit of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
return single_value->field_unit;
}

int GPRSTimerV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
  }
  return 0;
}

void GPRSTimerV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ timerValue := ");
single_value->field_timerValue.log();
TTCN_Logger::log_event_str(", unit := ");
single_value->field_unit.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 GPRSTimerV_template::log_match(const GPRSTimerV& 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_timerValue.match(match_value.timerValue(), legacy)){
TTCN_Logger::log_logmatch_info(".timerValue");
single_value->field_timerValue.log_match(match_value.timerValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_unit.match(match_value.unit(), legacy)){
TTCN_Logger::log_logmatch_info(".unit");
single_value->field_unit.log_match(match_value.unit(), 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("{ timerValue := ");
single_value->field_timerValue.log_match(match_value.timerValue(), legacy);
TTCN_Logger::log_event_str(", unit := ");
single_value->field_unit.log_match(match_value.unit(), 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 GPRSTimerV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (timerValue().is_bound()) timerValue().set_implicit_omit();
if (unit().is_bound()) unit().set_implicit_omit();
}

void GPRSTimerV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_timerValue.encode_text(text_buf);
single_value->field_unit.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
}
}

void GPRSTimerV_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_timerValue.decode_text(text_buf);
single_value->field_unit.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 GPRSTimerV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
}
}

void GPRSTimerV_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: {
    GPRSTimerV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.GPRSTimerV 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) timerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unit().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(), "timerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.GPRSTimerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    GPRSTimerV_template* precondition = new GPRSTimerV_template;
    precondition->set_param(*param.get_elem(0));
    GPRSTimerV_template* implied_template = new GPRSTimerV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GPRSTimerV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.GPRSTimerV");
  }
  is_ifpresent = param.get_ifpresent();
}

void GPRSTimerV_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_timerValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerV");
single_value->field_unit.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerV");
}

boolean GPRSTimerV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean GPRSTimerV_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;
}

GPRSTimerTV::GPRSTimerTV()
{
}

GPRSTimerTV::GPRSTimerTV(const OCTETSTRING& par_elementIdentifier,
    const GPRSTimerV& par_gprsTimerV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_gprsTimerV(par_gprsTimerV)
{
}

GPRSTimerTV::GPRSTimerTV(const GPRSTimerTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.gprsTimerV().is_bound()) field_gprsTimerV = other_value.gprsTimerV();
else field_gprsTimerV.clean_up();
}

void GPRSTimerTV::clean_up()
{
field_elementIdentifier.clean_up();
field_gprsTimerV.clean_up();
}

const TTCN_Typedescriptor_t* GPRSTimerTV::get_descriptor() const { return &GPRSTimerTV_descr_; }
GPRSTimerTV& GPRSTimerTV::operator=(const GPRSTimerTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.gprsTimerV().is_bound()) field_gprsTimerV = other_value.gprsTimerV();
  else field_gprsTimerV.clean_up();
}
return *this;
}

boolean GPRSTimerTV::operator==(const GPRSTimerTV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_gprsTimerV==other_value.field_gprsTimerV;
}

boolean GPRSTimerTV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_gprsTimerV.is_bound());
}
boolean GPRSTimerTV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_gprsTimerV.is_value();
}
void GPRSTimerTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", gprsTimerV := ");
field_gprsTimerV.log();
TTCN_Logger::log_event_str(" }");
}

void GPRSTimerTV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (gprsTimerV().is_bound()) gprsTimerV().set_implicit_omit();
}

void GPRSTimerTV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.GPRSTimerTV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gprsTimerV().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsTimerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsTimerV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.GPRSTimerTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GPRSTimerTV");
  }
}

void GPRSTimerTV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_gprsTimerV.encode_text(text_buf);
}

void GPRSTimerTV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_gprsTimerV.decode_text(text_buf);
}

void GPRSTimerTV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void GPRSTimerTV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int GPRSTimerTV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_gprsTimerV.RAW_decode(GPRSTimerV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  os_30) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GPRSTimerTV::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, GPRSTimerV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gprsTimerV.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_30) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_30.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct GPRSTimerTV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
GPRSTimerV_template field_gprsTimerV;
};

void GPRSTimerTV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_gprsTimerV = ANY_VALUE;
}
}
}

void GPRSTimerTV_template::copy_value(const GPRSTimerTV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.gprsTimerV().is_bound()) {
  single_value->field_gprsTimerV = other_value.gprsTimerV();
} else {
  single_value->field_gprsTimerV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GPRSTimerTV_template::copy_template(const GPRSTimerTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsTimerV().get_selection()) {
single_value->field_gprsTimerV = other_value.gprsTimerV();
} else {
single_value->field_gprsTimerV.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 GPRSTimerTV_template[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 GPRSTimerTV_template(*other_value.implication_.precondition);
implication_.implied_template = new GPRSTimerTV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
break;
}
set_selection(other_value);
}

GPRSTimerTV_template::GPRSTimerTV_template()
{
}

GPRSTimerTV_template::GPRSTimerTV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

GPRSTimerTV_template::GPRSTimerTV_template(const GPRSTimerTV& other_value)
{
copy_value(other_value);
}

GPRSTimerTV_template::GPRSTimerTV_template(const OPTIONAL<GPRSTimerTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GPRSTimerTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV from an unbound optional field.");
}
}

GPRSTimerTV_template::GPRSTimerTV_template(GPRSTimerTV_template* p_precondition, GPRSTimerTV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

GPRSTimerTV_template::GPRSTimerTV_template(Dynamic_Match_Interface<GPRSTimerTV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<GPRSTimerTV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

GPRSTimerTV_template::GPRSTimerTV_template(const GPRSTimerTV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

GPRSTimerTV_template::~GPRSTimerTV_template()
{
clean_up();
}

GPRSTimerTV_template& GPRSTimerTV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

GPRSTimerTV_template& GPRSTimerTV_template::operator=(const GPRSTimerTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

GPRSTimerTV_template& GPRSTimerTV_template::operator=(const OPTIONAL<GPRSTimerTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GPRSTimerTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
}
return *this;
}

GPRSTimerTV_template& GPRSTimerTV_template::operator=(const GPRSTimerTV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean GPRSTimerTV_template::match(const GPRSTimerTV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.gprsTimerV().is_bound()) return FALSE;
if(!single_value->field_gprsTimerV.match(other_value.gprsTimerV(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
}
return FALSE;
}

boolean GPRSTimerTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_gprsTimerV.is_bound();
}

boolean GPRSTimerTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_gprsTimerV.is_value();
}

void GPRSTimerTV_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;
}

GPRSTimerTV GPRSTimerTV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
GPRSTimerTV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_gprsTimerV.is_bound()) {
ret_val.gprsTimerV() = single_value->field_gprsTimerV.valueof();
}
return ret_val;
}

void GPRSTimerTV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GPRSTimerTV_template[list_length];
}

GPRSTimerTV_template& GPRSTimerTV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& GPRSTimerTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& GPRSTimerTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
return single_value->field_elementIdentifier;
}

GPRSTimerV_template& GPRSTimerTV_template::gprsTimerV()
{
set_specific();
return single_value->field_gprsTimerV;
}

const GPRSTimerV_template& GPRSTimerTV_template::gprsTimerV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsTimerV of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
return single_value->field_gprsTimerV;
}

int GPRSTimerTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
  }
  return 0;
}

void GPRSTimerTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", gprsTimerV := ");
single_value->field_gprsTimerV.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 GPRSTimerTV_template::log_match(const GPRSTimerTV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gprsTimerV.match(match_value.gprsTimerV(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsTimerV");
single_value->field_gprsTimerV.log_match(match_value.gprsTimerV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", gprsTimerV := ");
single_value->field_gprsTimerV.log_match(match_value.gprsTimerV(), 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 GPRSTimerTV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (gprsTimerV().is_bound()) gprsTimerV().set_implicit_omit();
}

void GPRSTimerTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_gprsTimerV.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
}
}

void GPRSTimerTV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_gprsTimerV.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 GPRSTimerTV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
}
}

void GPRSTimerTV_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: {
    GPRSTimerTV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.GPRSTimerTV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gprsTimerV().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsTimerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsTimerV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.GPRSTimerTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    GPRSTimerTV_template* precondition = new GPRSTimerTV_template;
    precondition->set_param(*param.get_elem(0));
    GPRSTimerTV_template* implied_template = new GPRSTimerTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GPRSTimerTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.GPRSTimerTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void GPRSTimerTV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerTV");
single_value->field_gprsTimerV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerTV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerTV");
}

boolean GPRSTimerTV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean GPRSTimerTV_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;
}

GPRSTimer2TLV::GPRSTimer2TLV()
{
}

GPRSTimer2TLV::GPRSTimer2TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const GPRSTimerV& par_gprsTimer2V)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_gprsTimer2V(par_gprsTimer2V)
{
}

GPRSTimer2TLV::GPRSTimer2TLV(const GPRSTimer2TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.gprsTimer2V().is_bound()) field_gprsTimer2V = other_value.gprsTimer2V();
else field_gprsTimer2V.clean_up();
}

void GPRSTimer2TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_gprsTimer2V.clean_up();
}

const TTCN_Typedescriptor_t* GPRSTimer2TLV::get_descriptor() const { return &GPRSTimer2TLV_descr_; }
GPRSTimer2TLV& GPRSTimer2TLV::operator=(const GPRSTimer2TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.gprsTimer2V().is_bound()) field_gprsTimer2V = other_value.gprsTimer2V();
  else field_gprsTimer2V.clean_up();
}
return *this;
}

boolean GPRSTimer2TLV::operator==(const GPRSTimer2TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_gprsTimer2V==other_value.field_gprsTimer2V;
}

boolean GPRSTimer2TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_gprsTimer2V.is_bound());
}
boolean GPRSTimer2TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_gprsTimer2V.is_value();
}
void GPRSTimer2TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", gprsTimer2V := ");
field_gprsTimer2V.log();
TTCN_Logger::log_event_str(" }");
}

void GPRSTimer2TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (gprsTimer2V().is_bound()) gprsTimer2V().set_implicit_omit();
}

void GPRSTimer2TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gprsTimer2V().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsTimer2V")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsTimer2V().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.GPRSTimer2TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
  }
}

void GPRSTimer2TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_gprsTimer2V.encode_text(text_buf);
}

void GPRSTimer2TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_gprsTimer2V.decode_text(text_buf);
}

void GPRSTimer2TLV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void GPRSTimer2TLV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int GPRSTimer2TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, GPRSTimer2TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(GPRSTimer2TLV_lengthIndicator_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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(GPRSTimer2TLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_gprsTimer2V.RAW_decode(GPRSTimerV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), 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());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GPRSTimer2TLV::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, GPRSTimer2TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GPRSTimerV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &GPRSTimer2TLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_gprsTimer2V.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct GPRSTimer2TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
GPRSTimerV_template field_gprsTimer2V;
};

void GPRSTimer2TLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_gprsTimer2V = ANY_VALUE;
}
}
}

void GPRSTimer2TLV_template::copy_value(const GPRSTimer2TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.gprsTimer2V().is_bound()) {
  single_value->field_gprsTimer2V = other_value.gprsTimer2V();
} else {
  single_value->field_gprsTimer2V.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GPRSTimer2TLV_template::copy_template(const GPRSTimer2TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsTimer2V().get_selection()) {
single_value->field_gprsTimer2V = other_value.gprsTimer2V();
} else {
single_value->field_gprsTimer2V.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 GPRSTimer2TLV_template[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 GPRSTimer2TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new GPRSTimer2TLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
break;
}
set_selection(other_value);
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template()
{
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template(const GPRSTimer2TLV& other_value)
{
copy_value(other_value);
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template(const OPTIONAL<GPRSTimer2TLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GPRSTimer2TLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV from an unbound optional field.");
}
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template(GPRSTimer2TLV_template* p_precondition, GPRSTimer2TLV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template(Dynamic_Match_Interface<GPRSTimer2TLV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<GPRSTimer2TLV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template(const GPRSTimer2TLV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

GPRSTimer2TLV_template::~GPRSTimer2TLV_template()
{
clean_up();
}

GPRSTimer2TLV_template& GPRSTimer2TLV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

GPRSTimer2TLV_template& GPRSTimer2TLV_template::operator=(const GPRSTimer2TLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

GPRSTimer2TLV_template& GPRSTimer2TLV_template::operator=(const OPTIONAL<GPRSTimer2TLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GPRSTimer2TLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
}
return *this;
}

GPRSTimer2TLV_template& GPRSTimer2TLV_template::operator=(const GPRSTimer2TLV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean GPRSTimer2TLV_template::match(const GPRSTimer2TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.gprsTimer2V().is_bound()) return FALSE;
if(!single_value->field_gprsTimer2V.match(other_value.gprsTimer2V(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
}
return FALSE;
}

boolean GPRSTimer2TLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_gprsTimer2V.is_bound();
}

boolean GPRSTimer2TLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_gprsTimer2V.is_value();
}

void GPRSTimer2TLV_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;
}

GPRSTimer2TLV GPRSTimer2TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
GPRSTimer2TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_gprsTimer2V.is_bound()) {
ret_val.gprsTimer2V() = single_value->field_gprsTimer2V.valueof();
}
return ret_val;
}

void GPRSTimer2TLV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GPRSTimer2TLV_template[list_length];
}

GPRSTimer2TLV_template& GPRSTimer2TLV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& GPRSTimer2TLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& GPRSTimer2TLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& GPRSTimer2TLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& GPRSTimer2TLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
return single_value->field_lengthIndicator;
}

GPRSTimerV_template& GPRSTimer2TLV_template::gprsTimer2V()
{
set_specific();
return single_value->field_gprsTimer2V;
}

const GPRSTimerV_template& GPRSTimer2TLV_template::gprsTimer2V() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsTimer2V of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
return single_value->field_gprsTimer2V;
}

int GPRSTimer2TLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
  }
  return 0;
}

void GPRSTimer2TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", gprsTimer2V := ");
single_value->field_gprsTimer2V.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 GPRSTimer2TLV_template::log_match(const GPRSTimer2TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gprsTimer2V.match(match_value.gprsTimer2V(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsTimer2V");
single_value->field_gprsTimer2V.log_match(match_value.gprsTimer2V(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", gprsTimer2V := ");
single_value->field_gprsTimer2V.log_match(match_value.gprsTimer2V(), 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 GPRSTimer2TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (gprsTimer2V().is_bound()) gprsTimer2V().set_implicit_omit();
}

void GPRSTimer2TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_gprsTimer2V.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
}
}

void GPRSTimer2TLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_gprsTimer2V.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 GPRSTimer2TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
}
}

void GPRSTimer2TLV_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: {
    GPRSTimer2TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gprsTimer2V().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsTimer2V")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsTimer2V().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.GPRSTimer2TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    GPRSTimer2TLV_template* precondition = new GPRSTimer2TLV_template;
    precondition->set_param(*param.get_elem(0));
    GPRSTimer2TLV_template* implied_template = new GPRSTimer2TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GPRSTimer2TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void GPRSTimer2TLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
single_value->field_gprsTimer2V.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
}

boolean GPRSTimer2TLV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean GPRSTimer2TLV_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 */
