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

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

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

/* Including header files */

#include "MobileL3_GMM_SM_Types.hh"

namespace MobileL3__GMM__SM__Types {

/* Member functions of C++ classes */

NSAPIV::NSAPIV()
{
}

NSAPIV::NSAPIV(const BITSTRING& par_valueField,
    const BITSTRING& par_spare)
  :   field_valueField(par_valueField),
  field_spare(par_spare)
{
}

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

void NSAPIV::clean_up()
{
field_valueField.clean_up();
field_spare.clean_up();
}

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

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

boolean NSAPIV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_spare.is_bound());
}
boolean NSAPIV::is_value() const
{
return field_valueField.is_value()
  && field_spare.is_value();
}
void NSAPIV::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(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void NSAPIV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void NSAPIV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void NSAPIV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int NSAPIV::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_valueField.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 NSAPIV::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_valueField.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 NSAPIV_template::single_value_struct {
BITSTRING_template field_valueField;
BITSTRING_template field_spare;
};

void NSAPIV_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_spare = ANY_VALUE;
}
}
}

void NSAPIV_template::copy_value(const NSAPIV& 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.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NSAPIV_template::copy_template(const NSAPIV_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.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 NSAPIV_template[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 NSAPIV_template(*other_value.implication_.precondition);
implication_.implied_template = new NSAPIV_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.NSAPIV.");
break;
}
set_selection(other_value);
}

NSAPIV_template::NSAPIV_template()
{
}

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

NSAPIV_template::NSAPIV_template(const NSAPIV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NSAPIV_template::match(const NSAPIV& 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.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.NSAPIV.");
}
return FALSE;
}

boolean NSAPIV_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_spare.is_bound();
}

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

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

NSAPIV NSAPIV_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.NSAPIV.");
NSAPIV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& NSAPIV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

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

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

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

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

void NSAPIV_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(", 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 NSAPIV_template::log_match(const NSAPIV& 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_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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), 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 NSAPIV_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_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.NSAPIV.");
}
}

void NSAPIV_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_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 NSAPIV_template[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.NSAPIV.");
}
}

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

void NSAPIV_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.NSAPIV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NSAPIV");
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.NSAPIV");
}

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

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

NSAPITV::NSAPITV()
{
}

NSAPITV::NSAPITV(const OCTETSTRING& par_elementIdentifier,
    const NSAPIV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_valueField(par_valueField)
{
}

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

void NSAPITV::clean_up()
{
field_elementIdentifier.clean_up();
field_valueField.clean_up();
}

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

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

boolean NSAPITV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_valueField.is_bound());
}
boolean NSAPITV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_valueField.is_value();
}
void NSAPITV::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(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void NSAPITV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

void NSAPITV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void NSAPITV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

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

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

int NSAPITV::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, NSAPIV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(NSAPIV_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 NSAPITV::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, NSAPIV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_valueField.RAW_encode(NSAPIV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct NSAPITV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
NSAPIV_template field_valueField;
};

void NSAPITV_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_valueField = ANY_VALUE;
}
}
}

void NSAPITV_template::copy_value(const NSAPITV& 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.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NSAPITV_template::copy_template(const NSAPITV_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.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 NSAPITV_template[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 NSAPITV_template(*other_value.implication_.precondition);
implication_.implied_template = new NSAPITV_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.NSAPITV.");
break;
}
set_selection(other_value);
}

NSAPITV_template::NSAPITV_template()
{
}

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

NSAPITV_template::NSAPITV_template(const NSAPITV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NSAPITV_template::match(const NSAPITV& 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.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.NSAPITV.");
}
return FALSE;
}

boolean NSAPITV_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_valueField.is_bound();
}

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

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

NSAPITV NSAPITV_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.NSAPITV.");
NSAPITV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

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

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

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

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

NSAPIV_template& NSAPITV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

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

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

void NSAPITV_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(", 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 NSAPITV_template::log_match(const NSAPITV& 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_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(", 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 NSAPITV_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_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.NSAPITV.");
}
}

void NSAPITV_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_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 NSAPITV_template[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.NSAPITV.");
}
}

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

void NSAPITV_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.NSAPITV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NSAPITV");
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.NSAPITV");
}

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

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

ProtocolConfigOptionsV::ProtocolConfigOptionsV()
{
}

ProtocolConfigOptionsV::ProtocolConfigOptionsV(const BITSTRING& par_configProtocol,
    const BITSTRING& par_spare,
    const BITSTRING& par_extensionField,
    const OPTIONAL< ProtocolIDs__and__ContainerIDs >& par_protocolIDs__and__ContainerIDs)
  :   field_configProtocol(par_configProtocol),
  field_spare(par_spare),
  field_extensionField(par_extensionField),
  field_protocolIDs__and__ContainerIDs(par_protocolIDs__and__ContainerIDs)
{
}

ProtocolConfigOptionsV::ProtocolConfigOptionsV(const ProtocolConfigOptionsV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsV.");
if (other_value.configProtocol().is_bound()) field_configProtocol = other_value.configProtocol();
else field_configProtocol.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.extensionField().is_bound()) field_extensionField = other_value.extensionField();
else field_extensionField.clean_up();
if (other_value.protocolIDs__and__ContainerIDs().is_bound()) field_protocolIDs__and__ContainerIDs = other_value.protocolIDs__and__ContainerIDs();
else field_protocolIDs__and__ContainerIDs.clean_up();
}

void ProtocolConfigOptionsV::clean_up()
{
field_configProtocol.clean_up();
field_spare.clean_up();
field_extensionField.clean_up();
field_protocolIDs__and__ContainerIDs.clean_up();
}

const TTCN_Typedescriptor_t* ProtocolConfigOptionsV::get_descriptor() const { return &ProtocolConfigOptionsV_descr_; }
ProtocolConfigOptionsV& ProtocolConfigOptionsV::operator=(const ProtocolConfigOptionsV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsV.");
  if (other_value.configProtocol().is_bound()) field_configProtocol = other_value.configProtocol();
  else field_configProtocol.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.extensionField().is_bound()) field_extensionField = other_value.extensionField();
  else field_extensionField.clean_up();
  if (other_value.protocolIDs__and__ContainerIDs().is_bound()) field_protocolIDs__and__ContainerIDs = other_value.protocolIDs__and__ContainerIDs();
  else field_protocolIDs__and__ContainerIDs.clean_up();
}
return *this;
}

boolean ProtocolConfigOptionsV::operator==(const ProtocolConfigOptionsV& other_value) const
{
return field_configProtocol==other_value.field_configProtocol
  && field_spare==other_value.field_spare
  && field_extensionField==other_value.field_extensionField
  && field_protocolIDs__and__ContainerIDs==other_value.field_protocolIDs__and__ContainerIDs;
}

boolean ProtocolConfigOptionsV::is_bound() const
{
return (field_configProtocol.is_bound())
  || (field_spare.is_bound())
  || (field_extensionField.is_bound())
  || (OPTIONAL_OMIT == field_protocolIDs__and__ContainerIDs.get_selection() || field_protocolIDs__and__ContainerIDs.is_bound());
}
boolean ProtocolConfigOptionsV::is_value() const
{
return field_configProtocol.is_value()
  && field_spare.is_value()
  && field_extensionField.is_value()
  && (OPTIONAL_OMIT == field_protocolIDs__and__ContainerIDs.get_selection() || field_protocolIDs__and__ContainerIDs.is_value());
}
int ProtocolConfigOptionsV::size_of() const
{
  int ret_val = 3;
  if (field_protocolIDs__and__ContainerIDs.ispresent()) ret_val++;
  return ret_val;
}

void ProtocolConfigOptionsV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ configProtocol := ");
field_configProtocol.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", extensionField := ");
field_extensionField.log();
TTCN_Logger::log_event_str(", protocolIDs_and_ContainerIDs := ");
field_protocolIDs__and__ContainerIDs.log();
TTCN_Logger::log_event_str(" }");
}

void ProtocolConfigOptionsV::set_implicit_omit()
{
if (configProtocol().is_bound()) configProtocol().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (extensionField().is_bound()) extensionField().set_implicit_omit();
if (!protocolIDs__and__ContainerIDs().is_bound()) protocolIDs__and__ContainerIDs() = OMIT_VALUE;
else protocolIDs__and__ContainerIDs().set_implicit_omit();
}

void ProtocolConfigOptionsV::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.ProtocolConfigOptionsV 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) configProtocol().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) extensionField().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) protocolIDs__and__ContainerIDs().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(), "configProtocol")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          configProtocol().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "extensionField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extensionField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolIDs_and_ContainerIDs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolIDs__and__ContainerIDs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.ProtocolConfigOptionsV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsV");
  }
}

void ProtocolConfigOptionsV::encode_text(Text_Buf& text_buf) const
{
field_configProtocol.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_extensionField.encode_text(text_buf);
field_protocolIDs__and__ContainerIDs.encode_text(text_buf);
}

void ProtocolConfigOptionsV::decode_text(Text_Buf& text_buf)
{
field_configProtocol.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_extensionField.decode_text(text_buf);
field_protocolIDs__and__ContainerIDs.decode_text(text_buf);
}

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

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

int ProtocolConfigOptionsV::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_configProtocol.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::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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_extensionField.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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_protocolIDs__and__ContainerIDs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, ProtocolIDs__and__ContainerIDs_descr_.raw->forceomit);
  decoded_field_length = field_protocolIDs__and__ContainerIDs().RAW_decode(ProtocolIDs__and__ContainerIDs_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_protocolIDs__and__ContainerIDs = 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_protocolIDs__and__ContainerIDs=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ProtocolConfigOptionsV::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::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  if (field_protocolIDs__and__ContainerIDs.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ProtocolIDs__and__ContainerIDs_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_configProtocol.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_extensionField.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  if (field_protocolIDs__and__ContainerIDs.ispresent()) {
  encoded_length += field_protocolIDs__and__ContainerIDs().RAW_encode(ProtocolIDs__and__ContainerIDs_descr_, *myleaf.body.node.nodes[3]);
  }
  return myleaf.length = encoded_length;
}

struct ProtocolConfigOptionsV_template::single_value_struct {
BITSTRING_template field_configProtocol;
BITSTRING_template field_spare;
BITSTRING_template field_extensionField;
ProtocolIDs__and__ContainerIDs_template field_protocolIDs__and__ContainerIDs;
};

void ProtocolConfigOptionsV_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_configProtocol = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_extensionField = ANY_VALUE;
single_value->field_protocolIDs__and__ContainerIDs = ANY_OR_OMIT;
}
}
}

void ProtocolConfigOptionsV_template::copy_value(const ProtocolConfigOptionsV& other_value)
{
single_value = new single_value_struct;
if (other_value.configProtocol().is_bound()) {
  single_value->field_configProtocol = other_value.configProtocol();
} else {
  single_value->field_configProtocol.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.extensionField().is_bound()) {
  single_value->field_extensionField = other_value.extensionField();
} else {
  single_value->field_extensionField.clean_up();
}
if (other_value.protocolIDs__and__ContainerIDs().is_bound()) {
  if (other_value.protocolIDs__and__ContainerIDs().ispresent()) single_value->field_protocolIDs__and__ContainerIDs = other_value.protocolIDs__and__ContainerIDs()();
  else single_value->field_protocolIDs__and__ContainerIDs = OMIT_VALUE;
} else {
  single_value->field_protocolIDs__and__ContainerIDs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ProtocolConfigOptionsV_template::copy_template(const ProtocolConfigOptionsV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.configProtocol().get_selection()) {
single_value->field_configProtocol = other_value.configProtocol();
} else {
single_value->field_configProtocol.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.extensionField().get_selection()) {
single_value->field_extensionField = other_value.extensionField();
} else {
single_value->field_extensionField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protocolIDs__and__ContainerIDs().get_selection()) {
single_value->field_protocolIDs__and__ContainerIDs = other_value.protocolIDs__and__ContainerIDs();
} else {
single_value->field_protocolIDs__and__ContainerIDs.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 ProtocolConfigOptionsV_template[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 ProtocolConfigOptionsV_template(*other_value.implication_.precondition);
implication_.implied_template = new ProtocolConfigOptionsV_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.ProtocolConfigOptionsV.");
break;
}
set_selection(other_value);
}

ProtocolConfigOptionsV_template::ProtocolConfigOptionsV_template()
{
}

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

ProtocolConfigOptionsV_template::ProtocolConfigOptionsV_template(const ProtocolConfigOptionsV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ProtocolConfigOptionsV_template::match(const ProtocolConfigOptionsV& 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.configProtocol().is_bound()) return FALSE;
if(!single_value->field_configProtocol.match(other_value.configProtocol(), 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.extensionField().is_bound()) return FALSE;
if(!single_value->field_extensionField.match(other_value.extensionField(), legacy))return FALSE;
if(!other_value.protocolIDs__and__ContainerIDs().is_bound()) return FALSE;
if((other_value.protocolIDs__and__ContainerIDs().ispresent() ? !single_value->field_protocolIDs__and__ContainerIDs.match((const ProtocolIDs__and__ContainerIDs&)other_value.protocolIDs__and__ContainerIDs(), legacy) : !single_value->field_protocolIDs__and__ContainerIDs.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.ProtocolConfigOptionsV.");
}
return FALSE;
}

boolean ProtocolConfigOptionsV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_configProtocol.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_extensionField.is_bound()
 || (single_value->field_protocolIDs__and__ContainerIDs.is_omit() || single_value->field_protocolIDs__and__ContainerIDs.is_bound());
}

boolean ProtocolConfigOptionsV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_configProtocol.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_extensionField.is_value()
 && (single_value->field_protocolIDs__and__ContainerIDs.is_omit() || single_value->field_protocolIDs__and__ContainerIDs.is_value());
}

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

ProtocolConfigOptionsV ProtocolConfigOptionsV_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.ProtocolConfigOptionsV.");
ProtocolConfigOptionsV ret_val;
if (single_value->field_configProtocol.is_bound()) {
ret_val.configProtocol() = single_value->field_configProtocol.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_extensionField.is_bound()) {
ret_val.extensionField() = single_value->field_extensionField.valueof();
}
if (single_value->field_protocolIDs__and__ContainerIDs.is_omit()) ret_val.protocolIDs__and__ContainerIDs() = OMIT_VALUE;
else if (single_value->field_protocolIDs__and__ContainerIDs.is_bound()) {
ret_val.protocolIDs__and__ContainerIDs() = single_value->field_protocolIDs__and__ContainerIDs.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& ProtocolConfigOptionsV_template::configProtocol()
{
set_specific();
return single_value->field_configProtocol;
}

const BITSTRING_template& ProtocolConfigOptionsV_template::configProtocol() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field configProtocol of a non-specific template of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsV.");
return single_value->field_configProtocol;
}

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

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

BITSTRING_template& ProtocolConfigOptionsV_template::extensionField()
{
set_specific();
return single_value->field_extensionField;
}

const BITSTRING_template& ProtocolConfigOptionsV_template::extensionField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extensionField of a non-specific template of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsV.");
return single_value->field_extensionField;
}

ProtocolIDs__and__ContainerIDs_template& ProtocolConfigOptionsV_template::protocolIDs__and__ContainerIDs()
{
set_specific();
return single_value->field_protocolIDs__and__ContainerIDs;
}

const ProtocolIDs__and__ContainerIDs_template& ProtocolConfigOptionsV_template::protocolIDs__and__ContainerIDs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolIDs_and_ContainerIDs of a non-specific template of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsV.");
return single_value->field_protocolIDs__and__ContainerIDs;
}

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

void ProtocolConfigOptionsV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ configProtocol := ");
single_value->field_configProtocol.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", extensionField := ");
single_value->field_extensionField.log();
TTCN_Logger::log_event_str(", protocolIDs_and_ContainerIDs := ");
single_value->field_protocolIDs__and__ContainerIDs.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 ProtocolConfigOptionsV_template::log_match(const ProtocolConfigOptionsV& 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_configProtocol.match(match_value.configProtocol(), legacy)){
TTCN_Logger::log_logmatch_info(".configProtocol");
single_value->field_configProtocol.log_match(match_value.configProtocol(), 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_extensionField.match(match_value.extensionField(), legacy)){
TTCN_Logger::log_logmatch_info(".extensionField");
single_value->field_extensionField.log_match(match_value.extensionField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.protocolIDs__and__ContainerIDs().ispresent()){
if(!single_value->field_protocolIDs__and__ContainerIDs.match(match_value.protocolIDs__and__ContainerIDs(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolIDs_and_ContainerIDs");
single_value->field_protocolIDs__and__ContainerIDs.log_match(match_value.protocolIDs__and__ContainerIDs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_protocolIDs__and__ContainerIDs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".protocolIDs_and_ContainerIDs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_protocolIDs__and__ContainerIDs.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("{ configProtocol := ");
single_value->field_configProtocol.log_match(match_value.configProtocol(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", extensionField := ");
single_value->field_extensionField.log_match(match_value.extensionField(), legacy);
TTCN_Logger::log_event_str(", protocolIDs_and_ContainerIDs := ");
if (match_value.protocolIDs__and__ContainerIDs().ispresent()) {
single_value->field_protocolIDs__and__ContainerIDs.log_match(match_value.protocolIDs__and__ContainerIDs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_protocolIDs__and__ContainerIDs.log();
if (single_value->field_protocolIDs__and__ContainerIDs.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 ProtocolConfigOptionsV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_configProtocol.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_extensionField.encode_text(text_buf);
single_value->field_protocolIDs__and__ContainerIDs.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.ProtocolConfigOptionsV.");
}
}

void ProtocolConfigOptionsV_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_configProtocol.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_extensionField.decode_text(text_buf);
single_value->field_protocolIDs__and__ContainerIDs.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 ProtocolConfigOptionsV_template[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.ProtocolConfigOptionsV.");
}
}

void ProtocolConfigOptionsV_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: {
    ProtocolConfigOptionsV_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.ProtocolConfigOptionsV 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) configProtocol().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) extensionField().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) protocolIDs__and__ContainerIDs().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(), "configProtocol")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          configProtocol().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "extensionField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extensionField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolIDs_and_ContainerIDs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolIDs__and__ContainerIDs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.ProtocolConfigOptionsV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ProtocolConfigOptionsV_template* precondition = new ProtocolConfigOptionsV_template;
    precondition->set_param(*param.get_elem(0));
    ProtocolConfigOptionsV_template* implied_template = new ProtocolConfigOptionsV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ProtocolConfigOptionsV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ProtocolConfigOptionsV_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_configProtocol.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsV");
single_value->field_extensionField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsV");
single_value->field_protocolIDs__and__ContainerIDs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsV");
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.ProtocolConfigOptionsV");
}

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

boolean ProtocolConfigOptionsV_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 ProtocolID__or__ContainerID ProtocolIDs__and__ContainerIDs::UNBOUND_ELEM;
ProtocolIDs__and__ContainerIDs::ProtocolIDs__and__ContainerIDs()
{
val_ptr = NULL;
}

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

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

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

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

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

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

boolean ProtocolIDs__and__ContainerIDs::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.ProtocolIDs_and_ContainerIDs.");
return val_ptr->n_elements == 0 ;
}

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

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

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

const ProtocolID__or__ContainerID& ProtocolIDs__and__ContainerIDs::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @MobileL3_GMM_SM_Types.ProtocolIDs_and_ContainerIDs.");
if (index_value < 0) TTCN_error("Accessing an element of type @MobileL3_GMM_SM_Types.ProtocolIDs_and_ContainerIDs 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.ProtocolIDs_and_ContainerIDs: 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 ProtocolID__or__ContainerID& ProtocolIDs__and__ContainerIDs::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.ProtocolIDs_and_ContainerIDs.");
return (*this)[(int)index_value];
}

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

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

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

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

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

ProtocolIDs__and__ContainerIDs ProtocolIDs__and__ContainerIDs::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.ProtocolIDs_and_ContainerIDs.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@MobileL3_GMM_SM_Types.ProtocolIDs_and_ContainerIDs","element");
ProtocolIDs__and__ContainerIDs 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 ProtocolID__or__ContainerID(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

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

ProtocolIDs__and__ContainerIDs ProtocolIDs__and__ContainerIDs::replace(int index, int len, const ProtocolIDs__and__ContainerIDs_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 ProtocolIDs__and__ContainerIDs::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.ProtocolIDs_and_ContainerIDs.");
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 = (ProtocolID__or__ContainerID**)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 ProtocolID__or__ContainerID(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (ProtocolID__or__ContainerID**)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.ProtocolIDs_and_ContainerIDs: %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 = (ProtocolID__or__ContainerID**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

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

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

void ProtocolIDs__and__ContainerIDs::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.ProtocolIDs_and_ContainerIDs.");
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 ProtocolIDs__and__ContainerIDs::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.ProtocolIDs_and_ContainerIDs.");
val_ptr->value_elements = (ProtocolID__or__ContainerID**)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 ProtocolID__or__ContainerID;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

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

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

int ProtocolIDs__and__ContainerIDs::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 ProtocolIDs__and__ContainerIDs::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 ProtocolIDs__and__ContainerIDs_template::copy_value(const ProtocolIDs__and__ContainerIDs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @MobileL3_GMM_SM_Types.ProtocolIDs_and_ContainerIDs with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (ProtocolID__or__ContainerID_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 ProtocolID__or__ContainerID_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new ProtocolID__or__ContainerID_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void ProtocolIDs__and__ContainerIDs_template::copy_template(const ProtocolIDs__and__ContainerIDs_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 = (ProtocolID__or__ContainerID_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 ProtocolID__or__ContainerID_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new ProtocolID__or__ContainerID_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 ProtocolIDs__and__ContainerIDs_template[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 ProtocolIDs__and__ContainerIDs_template(*other_value.implication_.precondition);
implication_.implied_template = new ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs.");
break;
}
set_selection(other_value);
}

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

ProtocolIDs__and__ContainerIDs_template::ProtocolIDs__and__ContainerIDs_template()
{
}

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

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

ProtocolIDs__and__ContainerIDs_template::ProtocolIDs__and__ContainerIDs_template(const ProtocolIDs__and__ContainerIDs& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

ProtocolID__or__ContainerID_template& ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs.");
return (*this)[(int)index_value];
}

const ProtocolID__or__ContainerID_template& ProtocolIDs__and__ContainerIDs_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @MobileL3_GMM_SM_Types.ProtocolIDs_and_ContainerIDs 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.ProtocolIDs_and_ContainerIDs.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @MobileL3_GMM_SM_Types.ProtocolIDs_and_ContainerIDs: 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 ProtocolID__or__ContainerID_template& ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs.");
return (*this)[(int)index_value];
}

void ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs.");
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 = (ProtocolID__or__ContainerID_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 ProtocolID__or__ContainerID_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 ProtocolID__or__ContainerID_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 = (ProtocolID__or__ContainerID_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

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

boolean ProtocolIDs__and__ContainerIDs_template::match(const ProtocolIDs__and__ContainerIDs& 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.ProtocolIDs_and_ContainerIDs.");
}
return FALSE;
}

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

ProtocolIDs__and__ContainerIDs ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs.");
ProtocolIDs__and__ContainerIDs 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;
}

ProtocolIDs__and__ContainerIDs ProtocolIDs__and__ContainerIDs_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);
}

ProtocolIDs__and__ContainerIDs ProtocolIDs__and__ContainerIDs_template::replace(int index, int len, const ProtocolIDs__and__ContainerIDs_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());
}

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

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

void ProtocolIDs__and__ContainerIDs_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 ProtocolIDs__and__ContainerIDs_template::log_match(const ProtocolIDs__and__ContainerIDs& 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 ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs.");
}
}

void ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs.");
single_value.value_elements = (ProtocolID__or__ContainerID_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 ProtocolID__or__ContainerID_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 ProtocolIDs__and__ContainerIDs_template[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.ProtocolIDs_and_ContainerIDs.");
}
}

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

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

void ProtocolIDs__and__ContainerIDs_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.ProtocolIDs_and_ContainerIDs");
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.ProtocolIDs_and_ContainerIDs");
}

boolean ProtocolIDs__and__ContainerIDs_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);
}
}
ProtocolID__or__ContainerID::ProtocolID__or__ContainerID()
{
}

ProtocolID__or__ContainerID::ProtocolID__or__ContainerID(const OCTETSTRING& par_protocolID__or__ContainerID,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_protID__orContID__Contents)
  :   field_protocolID__or__ContainerID(par_protocolID__or__ContainerID),
  field_lengthIndicator(par_lengthIndicator),
  field_protID__orContID__Contents(par_protID__orContID__Contents)
{
}

ProtocolID__or__ContainerID::ProtocolID__or__ContainerID(const ProtocolID__or__ContainerID& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID.");
if (other_value.protocolID__or__ContainerID().is_bound()) field_protocolID__or__ContainerID = other_value.protocolID__or__ContainerID();
else field_protocolID__or__ContainerID.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.protID__orContID__Contents().is_bound()) field_protID__orContID__Contents = other_value.protID__orContID__Contents();
else field_protID__orContID__Contents.clean_up();
}

void ProtocolID__or__ContainerID::clean_up()
{
field_protocolID__or__ContainerID.clean_up();
field_lengthIndicator.clean_up();
field_protID__orContID__Contents.clean_up();
}

const TTCN_Typedescriptor_t* ProtocolID__or__ContainerID::get_descriptor() const { return &ProtocolID__or__ContainerID_descr_; }
ProtocolID__or__ContainerID& ProtocolID__or__ContainerID::operator=(const ProtocolID__or__ContainerID& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID.");
  if (other_value.protocolID__or__ContainerID().is_bound()) field_protocolID__or__ContainerID = other_value.protocolID__or__ContainerID();
  else field_protocolID__or__ContainerID.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.protID__orContID__Contents().is_bound()) field_protID__orContID__Contents = other_value.protID__orContID__Contents();
  else field_protID__orContID__Contents.clean_up();
}
return *this;
}

boolean ProtocolID__or__ContainerID::operator==(const ProtocolID__or__ContainerID& other_value) const
{
return field_protocolID__or__ContainerID==other_value.field_protocolID__or__ContainerID
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_protID__orContID__Contents==other_value.field_protID__orContID__Contents;
}

boolean ProtocolID__or__ContainerID::is_bound() const
{
return (field_protocolID__or__ContainerID.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_protID__orContID__Contents.is_bound());
}
boolean ProtocolID__or__ContainerID::is_value() const
{
return field_protocolID__or__ContainerID.is_value()
  && field_lengthIndicator.is_value()
  && field_protID__orContID__Contents.is_value();
}
void ProtocolID__or__ContainerID::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ protocolID_or_ContainerID := ");
field_protocolID__or__ContainerID.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", protID_orContID_Contents := ");
field_protID__orContID__Contents.log();
TTCN_Logger::log_event_str(" }");
}

void ProtocolID__or__ContainerID::set_implicit_omit()
{
if (protocolID__or__ContainerID().is_bound()) protocolID__or__ContainerID().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (protID__orContID__Contents().is_bound()) protID__orContID__Contents().set_implicit_omit();
}

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

void ProtocolID__or__ContainerID::encode_text(Text_Buf& text_buf) const
{
field_protocolID__or__ContainerID.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_protID__orContID__Contents.encode_text(text_buf);
}

void ProtocolID__or__ContainerID::decode_text(Text_Buf& text_buf)
{
field_protocolID__or__ContainerID.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_protID__orContID__Contents.decode_text(text_buf);
}

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

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

int ProtocolID__or__ContainerID::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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_protocolID__or__ContainerID.RAW_decode(General__Types::OCT2_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, ProtocolID__or__ContainerID_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(ProtocolID__or__ContainerID_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(ProtocolID__or__ContainerID_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_protID__orContID__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 ProtocolID__or__ContainerID::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ProtocolID__or__ContainerID_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_protocolID__or__ContainerID.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &ProtocolID__or__ContainerID_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_protID__orContID__Contents.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct ProtocolID__or__ContainerID_template::single_value_struct {
OCTETSTRING_template field_protocolID__or__ContainerID;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_protID__orContID__Contents;
};

void ProtocolID__or__ContainerID_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_protocolID__or__ContainerID = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_protID__orContID__Contents = ANY_VALUE;
}
}
}

void ProtocolID__or__ContainerID_template::copy_value(const ProtocolID__or__ContainerID& other_value)
{
single_value = new single_value_struct;
if (other_value.protocolID__or__ContainerID().is_bound()) {
  single_value->field_protocolID__or__ContainerID = other_value.protocolID__or__ContainerID();
} else {
  single_value->field_protocolID__or__ContainerID.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.protID__orContID__Contents().is_bound()) {
  single_value->field_protID__orContID__Contents = other_value.protID__orContID__Contents();
} else {
  single_value->field_protID__orContID__Contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ProtocolID__or__ContainerID_template::copy_template(const ProtocolID__or__ContainerID_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.protocolID__or__ContainerID().get_selection()) {
single_value->field_protocolID__or__ContainerID = other_value.protocolID__or__ContainerID();
} else {
single_value->field_protocolID__or__ContainerID.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.protID__orContID__Contents().get_selection()) {
single_value->field_protID__orContID__Contents = other_value.protID__orContID__Contents();
} else {
single_value->field_protID__orContID__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 ProtocolID__or__ContainerID_template[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 ProtocolID__or__ContainerID_template(*other_value.implication_.precondition);
implication_.implied_template = new ProtocolID__or__ContainerID_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.ProtocolID_or_ContainerID.");
break;
}
set_selection(other_value);
}

ProtocolID__or__ContainerID_template::ProtocolID__or__ContainerID_template()
{
}

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

ProtocolID__or__ContainerID_template::ProtocolID__or__ContainerID_template(const ProtocolID__or__ContainerID& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ProtocolID__or__ContainerID_template::match(const ProtocolID__or__ContainerID& 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.protocolID__or__ContainerID().is_bound()) return FALSE;
if(!single_value->field_protocolID__or__ContainerID.match(other_value.protocolID__or__ContainerID(), 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.protID__orContID__Contents().is_bound()) return FALSE;
if(!single_value->field_protID__orContID__Contents.match(other_value.protID__orContID__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.ProtocolID_or_ContainerID.");
}
return FALSE;
}

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

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

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

ProtocolID__or__ContainerID ProtocolID__or__ContainerID_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.ProtocolID_or_ContainerID.");
ProtocolID__or__ContainerID ret_val;
if (single_value->field_protocolID__or__ContainerID.is_bound()) {
ret_val.protocolID__or__ContainerID() = single_value->field_protocolID__or__ContainerID.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_protID__orContID__Contents.is_bound()) {
ret_val.protID__orContID__Contents() = single_value->field_protID__orContID__Contents.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& ProtocolID__or__ContainerID_template::protocolID__or__ContainerID()
{
set_specific();
return single_value->field_protocolID__or__ContainerID;
}

const OCTETSTRING_template& ProtocolID__or__ContainerID_template::protocolID__or__ContainerID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolID_or_ContainerID of a non-specific template of type @MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID.");
return single_value->field_protocolID__or__ContainerID;
}

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

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

OCTETSTRING_template& ProtocolID__or__ContainerID_template::protID__orContID__Contents()
{
set_specific();
return single_value->field_protID__orContID__Contents;
}

const OCTETSTRING_template& ProtocolID__or__ContainerID_template::protID__orContID__Contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protID_orContID_Contents of a non-specific template of type @MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID.");
return single_value->field_protID__orContID__Contents;
}

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

void ProtocolID__or__ContainerID_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ protocolID_or_ContainerID := ");
single_value->field_protocolID__or__ContainerID.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", protID_orContID_Contents := ");
single_value->field_protID__orContID__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 ProtocolID__or__ContainerID_template::log_match(const ProtocolID__or__ContainerID& 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_protocolID__or__ContainerID.match(match_value.protocolID__or__ContainerID(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolID_or_ContainerID");
single_value->field_protocolID__or__ContainerID.log_match(match_value.protocolID__or__ContainerID(), 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_protID__orContID__Contents.match(match_value.protID__orContID__Contents(), legacy)){
TTCN_Logger::log_logmatch_info(".protID_orContID_Contents");
single_value->field_protID__orContID__Contents.log_match(match_value.protID__orContID__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("{ protocolID_or_ContainerID := ");
single_value->field_protocolID__or__ContainerID.log_match(match_value.protocolID__or__ContainerID(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", protID_orContID_Contents := ");
single_value->field_protID__orContID__Contents.log_match(match_value.protID__orContID__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 ProtocolID__or__ContainerID_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_protocolID__or__ContainerID.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_protID__orContID__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.ProtocolID_or_ContainerID.");
}
}

void ProtocolID__or__ContainerID_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_protocolID__or__ContainerID.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_protID__orContID__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 ProtocolID__or__ContainerID_template[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.ProtocolID_or_ContainerID.");
}
}

void ProtocolID__or__ContainerID_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: {
    ProtocolID__or__ContainerID_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.ProtocolID_or_ContainerID 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) protocolID__or__ContainerID().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) protID__orContID__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(), "protocolID_or_ContainerID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolID__or__ContainerID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "protID_orContID_Contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protID__orContID__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.ProtocolID_or_ContainerID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ProtocolID__or__ContainerID_template* precondition = new ProtocolID__or__ContainerID_template;
    precondition->set_param(*param.get_elem(0));
    ProtocolID__or__ContainerID_template* implied_template = new ProtocolID__or__ContainerID_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ProtocolID__or__ContainerID_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID");
  }
  is_ifpresent = param.get_ifpresent();
}

void ProtocolID__or__ContainerID_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_protocolID__or__ContainerID.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID");
single_value->field_protID__orContID__Contents.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolID_or_ContainerID");
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.ProtocolID_or_ContainerID");
}

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

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

ProtocolConfigOptionsTLV::ProtocolConfigOptionsTLV()
{
}

ProtocolConfigOptionsTLV::ProtocolConfigOptionsTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const ProtocolConfigOptionsV& par_protocolConfigOptionsV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_protocolConfigOptionsV(par_protocolConfigOptionsV)
{
}

ProtocolConfigOptionsTLV::ProtocolConfigOptionsTLV(const ProtocolConfigOptionsTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsTLV.");
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.protocolConfigOptionsV().is_bound()) field_protocolConfigOptionsV = other_value.protocolConfigOptionsV();
else field_protocolConfigOptionsV.clean_up();
}

void ProtocolConfigOptionsTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_protocolConfigOptionsV.clean_up();
}

const TTCN_Typedescriptor_t* ProtocolConfigOptionsTLV::get_descriptor() const { return &ProtocolConfigOptionsTLV_descr_; }
ProtocolConfigOptionsTLV& ProtocolConfigOptionsTLV::operator=(const ProtocolConfigOptionsTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsTLV.");
  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.protocolConfigOptionsV().is_bound()) field_protocolConfigOptionsV = other_value.protocolConfigOptionsV();
  else field_protocolConfigOptionsV.clean_up();
}
return *this;
}

boolean ProtocolConfigOptionsTLV::operator==(const ProtocolConfigOptionsTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_protocolConfigOptionsV==other_value.field_protocolConfigOptionsV;
}

boolean ProtocolConfigOptionsTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_protocolConfigOptionsV.is_bound());
}
boolean ProtocolConfigOptionsTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_protocolConfigOptionsV.is_value();
}
void ProtocolConfigOptionsTLV::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(", protocolConfigOptionsV := ");
field_protocolConfigOptionsV.log();
TTCN_Logger::log_event_str(" }");
}

void ProtocolConfigOptionsTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (protocolConfigOptionsV().is_bound()) protocolConfigOptionsV().set_implicit_omit();
}

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

void ProtocolConfigOptionsTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_protocolConfigOptionsV.encode_text(text_buf);
}

void ProtocolConfigOptionsTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_protocolConfigOptionsV.decode_text(text_buf);
}

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

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

int ProtocolConfigOptionsTLV::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, ProtocolConfigOptionsTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(ProtocolConfigOptionsTLV_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(ProtocolConfigOptionsTLV_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, ProtocolConfigOptionsV_descr_.raw->forceomit);
  decoded_field_length = field_protocolConfigOptionsV.RAW_decode(ProtocolConfigOptionsV_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_0) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ProtocolConfigOptionsTLV::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, ProtocolConfigOptionsTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ProtocolConfigOptionsV_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 = &ProtocolConfigOptionsTLV_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_protocolConfigOptionsV.RAW_encode(ProtocolConfigOptionsV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_0) {
  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_0.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 ProtocolConfigOptionsTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
ProtocolConfigOptionsV_template field_protocolConfigOptionsV;
};

void ProtocolConfigOptionsTLV_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_protocolConfigOptionsV = ANY_VALUE;
}
}
}

void ProtocolConfigOptionsTLV_template::copy_value(const ProtocolConfigOptionsTLV& 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.protocolConfigOptionsV().is_bound()) {
  single_value->field_protocolConfigOptionsV = other_value.protocolConfigOptionsV();
} else {
  single_value->field_protocolConfigOptionsV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ProtocolConfigOptionsTLV_template::copy_template(const ProtocolConfigOptionsTLV_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.protocolConfigOptionsV().get_selection()) {
single_value->field_protocolConfigOptionsV = other_value.protocolConfigOptionsV();
} else {
single_value->field_protocolConfigOptionsV.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 ProtocolConfigOptionsTLV_template[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 ProtocolConfigOptionsTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new ProtocolConfigOptionsTLV_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.ProtocolConfigOptionsTLV.");
break;
}
set_selection(other_value);
}

ProtocolConfigOptionsTLV_template::ProtocolConfigOptionsTLV_template()
{
}

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

ProtocolConfigOptionsTLV_template::ProtocolConfigOptionsTLV_template(const ProtocolConfigOptionsTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ProtocolConfigOptionsTLV_template::match(const ProtocolConfigOptionsTLV& 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.protocolConfigOptionsV().is_bound()) return FALSE;
if(!single_value->field_protocolConfigOptionsV.match(other_value.protocolConfigOptionsV(), 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.ProtocolConfigOptionsTLV.");
}
return FALSE;
}

boolean ProtocolConfigOptionsTLV_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_protocolConfigOptionsV.is_bound();
}

boolean ProtocolConfigOptionsTLV_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_protocolConfigOptionsV.is_value();
}

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

ProtocolConfigOptionsTLV ProtocolConfigOptionsTLV_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.ProtocolConfigOptionsTLV.");
ProtocolConfigOptionsTLV 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_protocolConfigOptionsV.is_bound()) {
ret_val.protocolConfigOptionsV() = single_value->field_protocolConfigOptionsV.valueof();
}
return ret_val;
}

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

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

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

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

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

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

ProtocolConfigOptionsV_template& ProtocolConfigOptionsTLV_template::protocolConfigOptionsV()
{
set_specific();
return single_value->field_protocolConfigOptionsV;
}

const ProtocolConfigOptionsV_template& ProtocolConfigOptionsTLV_template::protocolConfigOptionsV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolConfigOptionsV of a non-specific template of type @MobileL3_GMM_SM_Types.ProtocolConfigOptionsTLV.");
return single_value->field_protocolConfigOptionsV;
}

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

void ProtocolConfigOptionsTLV_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(", protocolConfigOptionsV := ");
single_value->field_protocolConfigOptionsV.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 ProtocolConfigOptionsTLV_template::log_match(const ProtocolConfigOptionsTLV& 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_protocolConfigOptionsV.match(match_value.protocolConfigOptionsV(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolConfigOptionsV");
single_value->field_protocolConfigOptionsV.log_match(match_value.protocolConfigOptionsV(), 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(", protocolConfigOptionsV := ");
single_value->field_protocolConfigOptionsV.log_match(match_value.protocolConfigOptionsV(), 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 ProtocolConfigOptionsTLV_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_protocolConfigOptionsV.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.ProtocolConfigOptionsTLV.");
}
}

void ProtocolConfigOptionsTLV_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_protocolConfigOptionsV.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 ProtocolConfigOptionsTLV_template[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.ProtocolConfigOptionsTLV.");
}
}

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

void ProtocolConfigOptionsTLV_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.ProtocolConfigOptionsTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsTLV");
single_value->field_protocolConfigOptionsV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ProtocolConfigOptionsTLV");
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.ProtocolConfigOptionsTLV");
}

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

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

PDPAddressV::PDPAddressV()
{
}

PDPAddressV::PDPAddressV(const BITSTRING& par_pdpTypeOrg,
    const BITSTRING& par_spare,
    const OCTETSTRING& par_pdpTypeNum,
    const OPTIONAL< OCTETSTRING >& par_addressInfo)
  :   field_pdpTypeOrg(par_pdpTypeOrg),
  field_spare(par_spare),
  field_pdpTypeNum(par_pdpTypeNum),
  field_addressInfo(par_addressInfo)
{
}

PDPAddressV::PDPAddressV(const PDPAddressV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDPAddressV.");
if (other_value.pdpTypeOrg().is_bound()) field_pdpTypeOrg = other_value.pdpTypeOrg();
else field_pdpTypeOrg.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.pdpTypeNum().is_bound()) field_pdpTypeNum = other_value.pdpTypeNum();
else field_pdpTypeNum.clean_up();
if (other_value.addressInfo().is_bound()) field_addressInfo = other_value.addressInfo();
else field_addressInfo.clean_up();
}

void PDPAddressV::clean_up()
{
field_pdpTypeOrg.clean_up();
field_spare.clean_up();
field_pdpTypeNum.clean_up();
field_addressInfo.clean_up();
}

const TTCN_Typedescriptor_t* PDPAddressV::get_descriptor() const { return &PDPAddressV_descr_; }
PDPAddressV& PDPAddressV::operator=(const PDPAddressV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDPAddressV.");
  if (other_value.pdpTypeOrg().is_bound()) field_pdpTypeOrg = other_value.pdpTypeOrg();
  else field_pdpTypeOrg.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.pdpTypeNum().is_bound()) field_pdpTypeNum = other_value.pdpTypeNum();
  else field_pdpTypeNum.clean_up();
  if (other_value.addressInfo().is_bound()) field_addressInfo = other_value.addressInfo();
  else field_addressInfo.clean_up();
}
return *this;
}

boolean PDPAddressV::operator==(const PDPAddressV& other_value) const
{
return field_pdpTypeOrg==other_value.field_pdpTypeOrg
  && field_spare==other_value.field_spare
  && field_pdpTypeNum==other_value.field_pdpTypeNum
  && field_addressInfo==other_value.field_addressInfo;
}

boolean PDPAddressV::is_bound() const
{
return (field_pdpTypeOrg.is_bound())
  || (field_spare.is_bound())
  || (field_pdpTypeNum.is_bound())
  || (OPTIONAL_OMIT == field_addressInfo.get_selection() || field_addressInfo.is_bound());
}
boolean PDPAddressV::is_value() const
{
return field_pdpTypeOrg.is_value()
  && field_spare.is_value()
  && field_pdpTypeNum.is_value()
  && (OPTIONAL_OMIT == field_addressInfo.get_selection() || field_addressInfo.is_value());
}
int PDPAddressV::size_of() const
{
  int ret_val = 3;
  if (field_addressInfo.ispresent()) ret_val++;
  return ret_val;
}

void PDPAddressV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ pdpTypeOrg := ");
field_pdpTypeOrg.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", pdpTypeNum := ");
field_pdpTypeNum.log();
TTCN_Logger::log_event_str(", addressInfo := ");
field_addressInfo.log();
TTCN_Logger::log_event_str(" }");
}

void PDPAddressV::set_implicit_omit()
{
if (pdpTypeOrg().is_bound()) pdpTypeOrg().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (pdpTypeNum().is_bound()) pdpTypeNum().set_implicit_omit();
if (!addressInfo().is_bound()) addressInfo() = OMIT_VALUE;
else addressInfo().set_implicit_omit();
}

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

void PDPAddressV::encode_text(Text_Buf& text_buf) const
{
field_pdpTypeOrg.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_pdpTypeNum.encode_text(text_buf);
field_addressInfo.encode_text(text_buf);
}

void PDPAddressV::decode_text(Text_Buf& text_buf)
{
field_pdpTypeOrg.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_pdpTypeNum.decode_text(text_buf);
field_addressInfo.decode_text(text_buf);
}

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

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

int PDPAddressV::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_pdpTypeOrg.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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_pdpTypeNum.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_addressInfo = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_addressInfo().RAW_decode(OCTETSTRING_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_addressInfo = 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_addressInfo=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDPAddressV::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::BIT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  if (field_addressInfo.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_pdpTypeOrg.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]);
  encoded_length += field_pdpTypeNum.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  if (field_addressInfo.ispresent()) {
  encoded_length += field_addressInfo().RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  }
  return myleaf.length = encoded_length;
}

struct PDPAddressV_template::single_value_struct {
BITSTRING_template field_pdpTypeOrg;
BITSTRING_template field_spare;
OCTETSTRING_template field_pdpTypeNum;
OCTETSTRING_template field_addressInfo;
};

void PDPAddressV_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_pdpTypeOrg = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_pdpTypeNum = ANY_VALUE;
single_value->field_addressInfo = ANY_OR_OMIT;
}
}
}

void PDPAddressV_template::copy_value(const PDPAddressV& other_value)
{
single_value = new single_value_struct;
if (other_value.pdpTypeOrg().is_bound()) {
  single_value->field_pdpTypeOrg = other_value.pdpTypeOrg();
} else {
  single_value->field_pdpTypeOrg.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.pdpTypeNum().is_bound()) {
  single_value->field_pdpTypeNum = other_value.pdpTypeNum();
} else {
  single_value->field_pdpTypeNum.clean_up();
}
if (other_value.addressInfo().is_bound()) {
  if (other_value.addressInfo().ispresent()) single_value->field_addressInfo = other_value.addressInfo()();
  else single_value->field_addressInfo = OMIT_VALUE;
} else {
  single_value->field_addressInfo.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDPAddressV_template::copy_template(const PDPAddressV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.pdpTypeOrg().get_selection()) {
single_value->field_pdpTypeOrg = other_value.pdpTypeOrg();
} else {
single_value->field_pdpTypeOrg.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.pdpTypeNum().get_selection()) {
single_value->field_pdpTypeNum = other_value.pdpTypeNum();
} else {
single_value->field_pdpTypeNum.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.addressInfo().get_selection()) {
single_value->field_addressInfo = other_value.addressInfo();
} else {
single_value->field_addressInfo.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 PDPAddressV_template[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 PDPAddressV_template(*other_value.implication_.precondition);
implication_.implied_template = new PDPAddressV_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.PDPAddressV.");
break;
}
set_selection(other_value);
}

PDPAddressV_template::PDPAddressV_template()
{
}

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

PDPAddressV_template::PDPAddressV_template(const PDPAddressV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDPAddressV_template::match(const PDPAddressV& 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.pdpTypeOrg().is_bound()) return FALSE;
if(!single_value->field_pdpTypeOrg.match(other_value.pdpTypeOrg(), 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.pdpTypeNum().is_bound()) return FALSE;
if(!single_value->field_pdpTypeNum.match(other_value.pdpTypeNum(), legacy))return FALSE;
if(!other_value.addressInfo().is_bound()) return FALSE;
if((other_value.addressInfo().ispresent() ? !single_value->field_addressInfo.match((const OCTETSTRING&)other_value.addressInfo(), legacy) : !single_value->field_addressInfo.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.PDPAddressV.");
}
return FALSE;
}

boolean PDPAddressV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_pdpTypeOrg.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_pdpTypeNum.is_bound()
 || (single_value->field_addressInfo.is_omit() || single_value->field_addressInfo.is_bound());
}

boolean PDPAddressV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_pdpTypeOrg.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_pdpTypeNum.is_value()
 && (single_value->field_addressInfo.is_omit() || single_value->field_addressInfo.is_value());
}

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

PDPAddressV PDPAddressV_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.PDPAddressV.");
PDPAddressV ret_val;
if (single_value->field_pdpTypeOrg.is_bound()) {
ret_val.pdpTypeOrg() = single_value->field_pdpTypeOrg.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_pdpTypeNum.is_bound()) {
ret_val.pdpTypeNum() = single_value->field_pdpTypeNum.valueof();
}
if (single_value->field_addressInfo.is_omit()) ret_val.addressInfo() = OMIT_VALUE;
else if (single_value->field_addressInfo.is_bound()) {
ret_val.addressInfo() = single_value->field_addressInfo.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& PDPAddressV_template::pdpTypeOrg()
{
set_specific();
return single_value->field_pdpTypeOrg;
}

const BITSTRING_template& PDPAddressV_template::pdpTypeOrg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpTypeOrg of a non-specific template of type @MobileL3_GMM_SM_Types.PDPAddressV.");
return single_value->field_pdpTypeOrg;
}

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

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

OCTETSTRING_template& PDPAddressV_template::pdpTypeNum()
{
set_specific();
return single_value->field_pdpTypeNum;
}

const OCTETSTRING_template& PDPAddressV_template::pdpTypeNum() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpTypeNum of a non-specific template of type @MobileL3_GMM_SM_Types.PDPAddressV.");
return single_value->field_pdpTypeNum;
}

OCTETSTRING_template& PDPAddressV_template::addressInfo()
{
set_specific();
return single_value->field_addressInfo;
}

const OCTETSTRING_template& PDPAddressV_template::addressInfo() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addressInfo of a non-specific template of type @MobileL3_GMM_SM_Types.PDPAddressV.");
return single_value->field_addressInfo;
}

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

void PDPAddressV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ pdpTypeOrg := ");
single_value->field_pdpTypeOrg.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", pdpTypeNum := ");
single_value->field_pdpTypeNum.log();
TTCN_Logger::log_event_str(", addressInfo := ");
single_value->field_addressInfo.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 PDPAddressV_template::log_match(const PDPAddressV& 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_pdpTypeOrg.match(match_value.pdpTypeOrg(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpTypeOrg");
single_value->field_pdpTypeOrg.log_match(match_value.pdpTypeOrg(), 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_pdpTypeNum.match(match_value.pdpTypeNum(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpTypeNum");
single_value->field_pdpTypeNum.log_match(match_value.pdpTypeNum(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.addressInfo().ispresent()){
if(!single_value->field_addressInfo.match(match_value.addressInfo(), legacy)){
TTCN_Logger::log_logmatch_info(".addressInfo");
single_value->field_addressInfo.log_match(match_value.addressInfo(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_addressInfo.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".addressInfo := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_addressInfo.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("{ pdpTypeOrg := ");
single_value->field_pdpTypeOrg.log_match(match_value.pdpTypeOrg(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", pdpTypeNum := ");
single_value->field_pdpTypeNum.log_match(match_value.pdpTypeNum(), legacy);
TTCN_Logger::log_event_str(", addressInfo := ");
if (match_value.addressInfo().ispresent()) {
single_value->field_addressInfo.log_match(match_value.addressInfo(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_addressInfo.log();
if (single_value->field_addressInfo.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 PDPAddressV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_pdpTypeOrg.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_pdpTypeNum.encode_text(text_buf);
single_value->field_addressInfo.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.PDPAddressV.");
}
}

void PDPAddressV_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_pdpTypeOrg.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_pdpTypeNum.decode_text(text_buf);
single_value->field_addressInfo.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 PDPAddressV_template[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.PDPAddressV.");
}
}

void PDPAddressV_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: {
    PDPAddressV_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.PDPAddressV 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) pdpTypeOrg().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) pdpTypeNum().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) addressInfo().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(), "pdpTypeOrg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpTypeOrg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "pdpTypeNum")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpTypeNum().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "addressInfo")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          addressInfo().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PDPAddressV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDPAddressV_template* precondition = new PDPAddressV_template;
    precondition->set_param(*param.get_elem(0));
    PDPAddressV_template* implied_template = new PDPAddressV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDPAddressV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDPAddressV");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDPAddressV_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_pdpTypeOrg.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPAddressV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPAddressV");
single_value->field_pdpTypeNum.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPAddressV");
single_value->field_addressInfo.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPAddressV");
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.PDPAddressV");
}

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

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

PDPAddressLV::PDPAddressLV()
{
}

PDPAddressLV::PDPAddressLV(const INTEGER& par_lengthIndicator,
    const PDPAddressV& par_pdpAddressV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_pdpAddressV(par_pdpAddressV)
{
}

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

void PDPAddressLV::clean_up()
{
field_lengthIndicator.clean_up();
field_pdpAddressV.clean_up();
}

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

boolean PDPAddressLV::operator==(const PDPAddressLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_pdpAddressV==other_value.field_pdpAddressV;
}

boolean PDPAddressLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_pdpAddressV.is_bound());
}
boolean PDPAddressLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_pdpAddressV.is_value();
}
void PDPAddressLV::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(", pdpAddressV := ");
field_pdpAddressV.log();
TTCN_Logger::log_event_str(" }");
}

void PDPAddressLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (pdpAddressV().is_bound()) pdpAddressV().set_implicit_omit();
}

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

void PDPAddressLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_pdpAddressV.encode_text(text_buf);
}

void PDPAddressLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_pdpAddressV.decode_text(text_buf);
}

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

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

int PDPAddressLV::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, PDPAddressLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PDPAddressLV_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(PDPAddressLV_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, PDPAddressV_descr_.raw->forceomit);
  decoded_field_length = field_pdpAddressV.RAW_decode(PDPAddressV_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 PDPAddressLV::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, PDPAddressLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDPAddressV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &PDPAddressLV_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_pdpAddressV.RAW_encode(PDPAddressV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDPAddressLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
PDPAddressV_template field_pdpAddressV;
};

void PDPAddressLV_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_pdpAddressV = ANY_VALUE;
}
}
}

void PDPAddressLV_template::copy_value(const PDPAddressLV& 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.pdpAddressV().is_bound()) {
  single_value->field_pdpAddressV = other_value.pdpAddressV();
} else {
  single_value->field_pdpAddressV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDPAddressLV_template::copy_template(const PDPAddressLV_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.pdpAddressV().get_selection()) {
single_value->field_pdpAddressV = other_value.pdpAddressV();
} else {
single_value->field_pdpAddressV.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 PDPAddressLV_template[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 PDPAddressLV_template(*other_value.implication_.precondition);
implication_.implied_template = new PDPAddressLV_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.PDPAddressLV.");
break;
}
set_selection(other_value);
}

PDPAddressLV_template::PDPAddressLV_template()
{
}

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

PDPAddressLV_template::PDPAddressLV_template(const PDPAddressLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDPAddressLV_template::match(const PDPAddressLV& 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.pdpAddressV().is_bound()) return FALSE;
if(!single_value->field_pdpAddressV.match(other_value.pdpAddressV(), 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.PDPAddressLV.");
}
return FALSE;
}

boolean PDPAddressLV_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_pdpAddressV.is_bound();
}

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

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

PDPAddressLV PDPAddressLV_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.PDPAddressLV.");
PDPAddressLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_pdpAddressV.is_bound()) {
ret_val.pdpAddressV() = single_value->field_pdpAddressV.valueof();
}
return ret_val;
}

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

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

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

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

PDPAddressV_template& PDPAddressLV_template::pdpAddressV()
{
set_specific();
return single_value->field_pdpAddressV;
}

const PDPAddressV_template& PDPAddressLV_template::pdpAddressV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpAddressV of a non-specific template of type @MobileL3_GMM_SM_Types.PDPAddressLV.");
return single_value->field_pdpAddressV;
}

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

void PDPAddressLV_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(", pdpAddressV := ");
single_value->field_pdpAddressV.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 PDPAddressLV_template::log_match(const PDPAddressLV& 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_pdpAddressV.match(match_value.pdpAddressV(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpAddressV");
single_value->field_pdpAddressV.log_match(match_value.pdpAddressV(), 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(", pdpAddressV := ");
single_value->field_pdpAddressV.log_match(match_value.pdpAddressV(), 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 PDPAddressLV_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_pdpAddressV.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.PDPAddressLV.");
}
}

void PDPAddressLV_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_pdpAddressV.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 PDPAddressLV_template[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.PDPAddressLV.");
}
}

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

void PDPAddressLV_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.PDPAddressLV");
single_value->field_pdpAddressV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPAddressLV");
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.PDPAddressLV");
}

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

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

PDPAddressTLV::PDPAddressTLV()
{
}

PDPAddressTLV::PDPAddressTLV(const OCTETSTRING& par_elementIdentifier,
    const PDPAddressLV& par_pDPAddressLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_pDPAddressLV(par_pDPAddressLV)
{
}

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

void PDPAddressTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_pDPAddressLV.clean_up();
}

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

boolean PDPAddressTLV::operator==(const PDPAddressTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_pDPAddressLV==other_value.field_pDPAddressLV;
}

boolean PDPAddressTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_pDPAddressLV.is_bound());
}
boolean PDPAddressTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_pDPAddressLV.is_value();
}
void PDPAddressTLV::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(", pDPAddressLV := ");
field_pDPAddressLV.log();
TTCN_Logger::log_event_str(" }");
}

void PDPAddressTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (pDPAddressLV().is_bound()) pDPAddressLV().set_implicit_omit();
}

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

void PDPAddressTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_pDPAddressLV.encode_text(text_buf);
}

void PDPAddressTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_pDPAddressLV.decode_text(text_buf);
}

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

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

int PDPAddressTLV::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, PDPAddressLV_descr_.raw->forceomit);
  decoded_field_length = field_pDPAddressLV.RAW_decode(PDPAddressLV_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_9) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDPAddressTLV::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, PDPAddressLV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pDPAddressLV.RAW_encode(PDPAddressLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_9) {
  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_9.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 PDPAddressTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
PDPAddressLV_template field_pDPAddressLV;
};

void PDPAddressTLV_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_pDPAddressLV = ANY_VALUE;
}
}
}

void PDPAddressTLV_template::copy_value(const PDPAddressTLV& 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.pDPAddressLV().is_bound()) {
  single_value->field_pDPAddressLV = other_value.pDPAddressLV();
} else {
  single_value->field_pDPAddressLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDPAddressTLV_template::copy_template(const PDPAddressTLV_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.pDPAddressLV().get_selection()) {
single_value->field_pDPAddressLV = other_value.pDPAddressLV();
} else {
single_value->field_pDPAddressLV.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 PDPAddressTLV_template[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 PDPAddressTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new PDPAddressTLV_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.PDPAddressTLV.");
break;
}
set_selection(other_value);
}

PDPAddressTLV_template::PDPAddressTLV_template()
{
}

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

PDPAddressTLV_template::PDPAddressTLV_template(const PDPAddressTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDPAddressTLV_template::match(const PDPAddressTLV& 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.pDPAddressLV().is_bound()) return FALSE;
if(!single_value->field_pDPAddressLV.match(other_value.pDPAddressLV(), 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.PDPAddressTLV.");
}
return FALSE;
}

boolean PDPAddressTLV_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_pDPAddressLV.is_bound();
}

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

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

PDPAddressTLV PDPAddressTLV_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.PDPAddressTLV.");
PDPAddressTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_pDPAddressLV.is_bound()) {
ret_val.pDPAddressLV() = single_value->field_pDPAddressLV.valueof();
}
return ret_val;
}

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

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

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

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

PDPAddressLV_template& PDPAddressTLV_template::pDPAddressLV()
{
set_specific();
return single_value->field_pDPAddressLV;
}

const PDPAddressLV_template& PDPAddressTLV_template::pDPAddressLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pDPAddressLV of a non-specific template of type @MobileL3_GMM_SM_Types.PDPAddressTLV.");
return single_value->field_pDPAddressLV;
}

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

void PDPAddressTLV_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(", pDPAddressLV := ");
single_value->field_pDPAddressLV.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 PDPAddressTLV_template::log_match(const PDPAddressTLV& 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_pDPAddressLV.match(match_value.pDPAddressLV(), legacy)){
TTCN_Logger::log_logmatch_info(".pDPAddressLV");
single_value->field_pDPAddressLV.log_match(match_value.pDPAddressLV(), 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(", pDPAddressLV := ");
single_value->field_pDPAddressLV.log_match(match_value.pDPAddressLV(), 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 PDPAddressTLV_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_pDPAddressLV.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.PDPAddressTLV.");
}
}

void PDPAddressTLV_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_pDPAddressLV.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 PDPAddressTLV_template[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.PDPAddressTLV.");
}
}

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

void PDPAddressTLV_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.PDPAddressTLV");
single_value->field_pDPAddressLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPAddressTLV");
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.PDPAddressTLV");
}

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

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

QoSV::QoSV()
{
}

QoSV::QoSV(const BITSTRING& par_reliabilityClass,
    const BITSTRING& par_delayClass,
    const BITSTRING& par_spare1,
    const BITSTRING& par_precedenceClass,
    const BITSTRING& par_spare2,
    const BITSTRING& par_peakThroughput,
    const BITSTRING& par_meanThroughput,
    const BITSTRING& par_spare3,
    const OPTIONAL< BITSTRING >& par_deliverErroneusSDU,
    const OPTIONAL< BITSTRING >& par_deliveryOrder,
    const OPTIONAL< BITSTRING >& par_trafficClass,
    const OPTIONAL< OCTETSTRING >& par_maxSDUSize,
    const OPTIONAL< OCTETSTRING >& par_maxBitrateUplink,
    const OPTIONAL< OCTETSTRING >& par_maxBitrateDownlink,
    const OPTIONAL< BITSTRING >& par_sduErrorRatio,
    const OPTIONAL< BITSTRING >& par_residualBER,
    const OPTIONAL< BITSTRING >& par_trafficHandlingPriority,
    const OPTIONAL< BITSTRING >& par_transferDelay,
    const OPTIONAL< OCTETSTRING >& par_guaranteedBitRateUplink,
    const OPTIONAL< OCTETSTRING >& par_guaranteedBitRateDownlink,
    const OPTIONAL< BITSTRING >& par_sourceStatisticsDescriptor,
    const OPTIONAL< BITSTRING >& par_signallingIndication,
    const OPTIONAL< BITSTRING >& par_spare4,
    const OPTIONAL< OCTETSTRING >& par_maxBitrateDownlinkExt,
    const OPTIONAL< OCTETSTRING >& par_guaranteedBitRateDownlinkExt,
    const OPTIONAL< OCTETSTRING >& par_maxBitrateUplinkExt,
    const OPTIONAL< OCTETSTRING >& par_guaranteedBitRateUplinkExt,
    const OPTIONAL< OCTETSTRING >& par_maxBitrateDownlinkExt2,
    const OPTIONAL< OCTETSTRING >& par_guaranteedBitRateDownlinkExt2,
    const OPTIONAL< OCTETSTRING >& par_maxBitrateUplinkExt2,
    const OPTIONAL< OCTETSTRING >& par_guaranteedBitRateUplinkExt2)
  :   field_reliabilityClass(par_reliabilityClass),
  field_delayClass(par_delayClass),
  field_spare1(par_spare1),
  field_precedenceClass(par_precedenceClass),
  field_spare2(par_spare2),
  field_peakThroughput(par_peakThroughput),
  field_meanThroughput(par_meanThroughput),
  field_spare3(par_spare3),
  field_deliverErroneusSDU(par_deliverErroneusSDU),
  field_deliveryOrder(par_deliveryOrder),
  field_trafficClass(par_trafficClass),
  field_maxSDUSize(par_maxSDUSize),
  field_maxBitrateUplink(par_maxBitrateUplink),
  field_maxBitrateDownlink(par_maxBitrateDownlink),
  field_sduErrorRatio(par_sduErrorRatio),
  field_residualBER(par_residualBER),
  field_trafficHandlingPriority(par_trafficHandlingPriority),
  field_transferDelay(par_transferDelay),
  field_guaranteedBitRateUplink(par_guaranteedBitRateUplink),
  field_guaranteedBitRateDownlink(par_guaranteedBitRateDownlink),
  field_sourceStatisticsDescriptor(par_sourceStatisticsDescriptor),
  field_signallingIndication(par_signallingIndication),
  field_spare4(par_spare4),
  field_maxBitrateDownlinkExt(par_maxBitrateDownlinkExt),
  field_guaranteedBitRateDownlinkExt(par_guaranteedBitRateDownlinkExt),
  field_maxBitrateUplinkExt(par_maxBitrateUplinkExt),
  field_guaranteedBitRateUplinkExt(par_guaranteedBitRateUplinkExt),
  field_maxBitrateDownlinkExt2(par_maxBitrateDownlinkExt2),
  field_guaranteedBitRateDownlinkExt2(par_guaranteedBitRateDownlinkExt2),
  field_maxBitrateUplinkExt2(par_maxBitrateUplinkExt2),
  field_guaranteedBitRateUplinkExt2(par_guaranteedBitRateUplinkExt2)
{
}

QoSV::QoSV(const QoSV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.QoSV.");
if (other_value.reliabilityClass().is_bound()) field_reliabilityClass = other_value.reliabilityClass();
else field_reliabilityClass.clean_up();
if (other_value.delayClass().is_bound()) field_delayClass = other_value.delayClass();
else field_delayClass.clean_up();
if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
else field_spare1.clean_up();
if (other_value.precedenceClass().is_bound()) field_precedenceClass = other_value.precedenceClass();
else field_precedenceClass.clean_up();
if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
else field_spare2.clean_up();
if (other_value.peakThroughput().is_bound()) field_peakThroughput = other_value.peakThroughput();
else field_peakThroughput.clean_up();
if (other_value.meanThroughput().is_bound()) field_meanThroughput = other_value.meanThroughput();
else field_meanThroughput.clean_up();
if (other_value.spare3().is_bound()) field_spare3 = other_value.spare3();
else field_spare3.clean_up();
if (other_value.deliverErroneusSDU().is_bound()) field_deliverErroneusSDU = other_value.deliverErroneusSDU();
else field_deliverErroneusSDU.clean_up();
if (other_value.deliveryOrder().is_bound()) field_deliveryOrder = other_value.deliveryOrder();
else field_deliveryOrder.clean_up();
if (other_value.trafficClass().is_bound()) field_trafficClass = other_value.trafficClass();
else field_trafficClass.clean_up();
if (other_value.maxSDUSize().is_bound()) field_maxSDUSize = other_value.maxSDUSize();
else field_maxSDUSize.clean_up();
if (other_value.maxBitrateUplink().is_bound()) field_maxBitrateUplink = other_value.maxBitrateUplink();
else field_maxBitrateUplink.clean_up();
if (other_value.maxBitrateDownlink().is_bound()) field_maxBitrateDownlink = other_value.maxBitrateDownlink();
else field_maxBitrateDownlink.clean_up();
if (other_value.sduErrorRatio().is_bound()) field_sduErrorRatio = other_value.sduErrorRatio();
else field_sduErrorRatio.clean_up();
if (other_value.residualBER().is_bound()) field_residualBER = other_value.residualBER();
else field_residualBER.clean_up();
if (other_value.trafficHandlingPriority().is_bound()) field_trafficHandlingPriority = other_value.trafficHandlingPriority();
else field_trafficHandlingPriority.clean_up();
if (other_value.transferDelay().is_bound()) field_transferDelay = other_value.transferDelay();
else field_transferDelay.clean_up();
if (other_value.guaranteedBitRateUplink().is_bound()) field_guaranteedBitRateUplink = other_value.guaranteedBitRateUplink();
else field_guaranteedBitRateUplink.clean_up();
if (other_value.guaranteedBitRateDownlink().is_bound()) field_guaranteedBitRateDownlink = other_value.guaranteedBitRateDownlink();
else field_guaranteedBitRateDownlink.clean_up();
if (other_value.sourceStatisticsDescriptor().is_bound()) field_sourceStatisticsDescriptor = other_value.sourceStatisticsDescriptor();
else field_sourceStatisticsDescriptor.clean_up();
if (other_value.signallingIndication().is_bound()) field_signallingIndication = other_value.signallingIndication();
else field_signallingIndication.clean_up();
if (other_value.spare4().is_bound()) field_spare4 = other_value.spare4();
else field_spare4.clean_up();
if (other_value.maxBitrateDownlinkExt().is_bound()) field_maxBitrateDownlinkExt = other_value.maxBitrateDownlinkExt();
else field_maxBitrateDownlinkExt.clean_up();
if (other_value.guaranteedBitRateDownlinkExt().is_bound()) field_guaranteedBitRateDownlinkExt = other_value.guaranteedBitRateDownlinkExt();
else field_guaranteedBitRateDownlinkExt.clean_up();
if (other_value.maxBitrateUplinkExt().is_bound()) field_maxBitrateUplinkExt = other_value.maxBitrateUplinkExt();
else field_maxBitrateUplinkExt.clean_up();
if (other_value.guaranteedBitRateUplinkExt().is_bound()) field_guaranteedBitRateUplinkExt = other_value.guaranteedBitRateUplinkExt();
else field_guaranteedBitRateUplinkExt.clean_up();
if (other_value.maxBitrateDownlinkExt2().is_bound()) field_maxBitrateDownlinkExt2 = other_value.maxBitrateDownlinkExt2();
else field_maxBitrateDownlinkExt2.clean_up();
if (other_value.guaranteedBitRateDownlinkExt2().is_bound()) field_guaranteedBitRateDownlinkExt2 = other_value.guaranteedBitRateDownlinkExt2();
else field_guaranteedBitRateDownlinkExt2.clean_up();
if (other_value.maxBitrateUplinkExt2().is_bound()) field_maxBitrateUplinkExt2 = other_value.maxBitrateUplinkExt2();
else field_maxBitrateUplinkExt2.clean_up();
if (other_value.guaranteedBitRateUplinkExt2().is_bound()) field_guaranteedBitRateUplinkExt2 = other_value.guaranteedBitRateUplinkExt2();
else field_guaranteedBitRateUplinkExt2.clean_up();
}

void QoSV::clean_up()
{
field_reliabilityClass.clean_up();
field_delayClass.clean_up();
field_spare1.clean_up();
field_precedenceClass.clean_up();
field_spare2.clean_up();
field_peakThroughput.clean_up();
field_meanThroughput.clean_up();
field_spare3.clean_up();
field_deliverErroneusSDU.clean_up();
field_deliveryOrder.clean_up();
field_trafficClass.clean_up();
field_maxSDUSize.clean_up();
field_maxBitrateUplink.clean_up();
field_maxBitrateDownlink.clean_up();
field_sduErrorRatio.clean_up();
field_residualBER.clean_up();
field_trafficHandlingPriority.clean_up();
field_transferDelay.clean_up();
field_guaranteedBitRateUplink.clean_up();
field_guaranteedBitRateDownlink.clean_up();
field_sourceStatisticsDescriptor.clean_up();
field_signallingIndication.clean_up();
field_spare4.clean_up();
field_maxBitrateDownlinkExt.clean_up();
field_guaranteedBitRateDownlinkExt.clean_up();
field_maxBitrateUplinkExt.clean_up();
field_guaranteedBitRateUplinkExt.clean_up();
field_maxBitrateDownlinkExt2.clean_up();
field_guaranteedBitRateDownlinkExt2.clean_up();
field_maxBitrateUplinkExt2.clean_up();
field_guaranteedBitRateUplinkExt2.clean_up();
}

const TTCN_Typedescriptor_t* QoSV::get_descriptor() const { return &QoSV_descr_; }
QoSV& QoSV::operator=(const QoSV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.QoSV.");
  if (other_value.reliabilityClass().is_bound()) field_reliabilityClass = other_value.reliabilityClass();
  else field_reliabilityClass.clean_up();
  if (other_value.delayClass().is_bound()) field_delayClass = other_value.delayClass();
  else field_delayClass.clean_up();
  if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
  else field_spare1.clean_up();
  if (other_value.precedenceClass().is_bound()) field_precedenceClass = other_value.precedenceClass();
  else field_precedenceClass.clean_up();
  if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
  else field_spare2.clean_up();
  if (other_value.peakThroughput().is_bound()) field_peakThroughput = other_value.peakThroughput();
  else field_peakThroughput.clean_up();
  if (other_value.meanThroughput().is_bound()) field_meanThroughput = other_value.meanThroughput();
  else field_meanThroughput.clean_up();
  if (other_value.spare3().is_bound()) field_spare3 = other_value.spare3();
  else field_spare3.clean_up();
  if (other_value.deliverErroneusSDU().is_bound()) field_deliverErroneusSDU = other_value.deliverErroneusSDU();
  else field_deliverErroneusSDU.clean_up();
  if (other_value.deliveryOrder().is_bound()) field_deliveryOrder = other_value.deliveryOrder();
  else field_deliveryOrder.clean_up();
  if (other_value.trafficClass().is_bound()) field_trafficClass = other_value.trafficClass();
  else field_trafficClass.clean_up();
  if (other_value.maxSDUSize().is_bound()) field_maxSDUSize = other_value.maxSDUSize();
  else field_maxSDUSize.clean_up();
  if (other_value.maxBitrateUplink().is_bound()) field_maxBitrateUplink = other_value.maxBitrateUplink();
  else field_maxBitrateUplink.clean_up();
  if (other_value.maxBitrateDownlink().is_bound()) field_maxBitrateDownlink = other_value.maxBitrateDownlink();
  else field_maxBitrateDownlink.clean_up();
  if (other_value.sduErrorRatio().is_bound()) field_sduErrorRatio = other_value.sduErrorRatio();
  else field_sduErrorRatio.clean_up();
  if (other_value.residualBER().is_bound()) field_residualBER = other_value.residualBER();
  else field_residualBER.clean_up();
  if (other_value.trafficHandlingPriority().is_bound()) field_trafficHandlingPriority = other_value.trafficHandlingPriority();
  else field_trafficHandlingPriority.clean_up();
  if (other_value.transferDelay().is_bound()) field_transferDelay = other_value.transferDelay();
  else field_transferDelay.clean_up();
  if (other_value.guaranteedBitRateUplink().is_bound()) field_guaranteedBitRateUplink = other_value.guaranteedBitRateUplink();
  else field_guaranteedBitRateUplink.clean_up();
  if (other_value.guaranteedBitRateDownlink().is_bound()) field_guaranteedBitRateDownlink = other_value.guaranteedBitRateDownlink();
  else field_guaranteedBitRateDownlink.clean_up();
  if (other_value.sourceStatisticsDescriptor().is_bound()) field_sourceStatisticsDescriptor = other_value.sourceStatisticsDescriptor();
  else field_sourceStatisticsDescriptor.clean_up();
  if (other_value.signallingIndication().is_bound()) field_signallingIndication = other_value.signallingIndication();
  else field_signallingIndication.clean_up();
  if (other_value.spare4().is_bound()) field_spare4 = other_value.spare4();
  else field_spare4.clean_up();
  if (other_value.maxBitrateDownlinkExt().is_bound()) field_maxBitrateDownlinkExt = other_value.maxBitrateDownlinkExt();
  else field_maxBitrateDownlinkExt.clean_up();
  if (other_value.guaranteedBitRateDownlinkExt().is_bound()) field_guaranteedBitRateDownlinkExt = other_value.guaranteedBitRateDownlinkExt();
  else field_guaranteedBitRateDownlinkExt.clean_up();
  if (other_value.maxBitrateUplinkExt().is_bound()) field_maxBitrateUplinkExt = other_value.maxBitrateUplinkExt();
  else field_maxBitrateUplinkExt.clean_up();
  if (other_value.guaranteedBitRateUplinkExt().is_bound()) field_guaranteedBitRateUplinkExt = other_value.guaranteedBitRateUplinkExt();
  else field_guaranteedBitRateUplinkExt.clean_up();
  if (other_value.maxBitrateDownlinkExt2().is_bound()) field_maxBitrateDownlinkExt2 = other_value.maxBitrateDownlinkExt2();
  else field_maxBitrateDownlinkExt2.clean_up();
  if (other_value.guaranteedBitRateDownlinkExt2().is_bound()) field_guaranteedBitRateDownlinkExt2 = other_value.guaranteedBitRateDownlinkExt2();
  else field_guaranteedBitRateDownlinkExt2.clean_up();
  if (other_value.maxBitrateUplinkExt2().is_bound()) field_maxBitrateUplinkExt2 = other_value.maxBitrateUplinkExt2();
  else field_maxBitrateUplinkExt2.clean_up();
  if (other_value.guaranteedBitRateUplinkExt2().is_bound()) field_guaranteedBitRateUplinkExt2 = other_value.guaranteedBitRateUplinkExt2();
  else field_guaranteedBitRateUplinkExt2.clean_up();
}
return *this;
}

boolean QoSV::operator==(const QoSV& other_value) const
{
return field_reliabilityClass==other_value.field_reliabilityClass
  && field_delayClass==other_value.field_delayClass
  && field_spare1==other_value.field_spare1
  && field_precedenceClass==other_value.field_precedenceClass
  && field_spare2==other_value.field_spare2
  && field_peakThroughput==other_value.field_peakThroughput
  && field_meanThroughput==other_value.field_meanThroughput
  && field_spare3==other_value.field_spare3
  && field_deliverErroneusSDU==other_value.field_deliverErroneusSDU
  && field_deliveryOrder==other_value.field_deliveryOrder
  && field_trafficClass==other_value.field_trafficClass
  && field_maxSDUSize==other_value.field_maxSDUSize
  && field_maxBitrateUplink==other_value.field_maxBitrateUplink
  && field_maxBitrateDownlink==other_value.field_maxBitrateDownlink
  && field_sduErrorRatio==other_value.field_sduErrorRatio
  && field_residualBER==other_value.field_residualBER
  && field_trafficHandlingPriority==other_value.field_trafficHandlingPriority
  && field_transferDelay==other_value.field_transferDelay
  && field_guaranteedBitRateUplink==other_value.field_guaranteedBitRateUplink
  && field_guaranteedBitRateDownlink==other_value.field_guaranteedBitRateDownlink
  && field_sourceStatisticsDescriptor==other_value.field_sourceStatisticsDescriptor
  && field_signallingIndication==other_value.field_signallingIndication
  && field_spare4==other_value.field_spare4
  && field_maxBitrateDownlinkExt==other_value.field_maxBitrateDownlinkExt
  && field_guaranteedBitRateDownlinkExt==other_value.field_guaranteedBitRateDownlinkExt
  && field_maxBitrateUplinkExt==other_value.field_maxBitrateUplinkExt
  && field_guaranteedBitRateUplinkExt==other_value.field_guaranteedBitRateUplinkExt
  && field_maxBitrateDownlinkExt2==other_value.field_maxBitrateDownlinkExt2
  && field_guaranteedBitRateDownlinkExt2==other_value.field_guaranteedBitRateDownlinkExt2
  && field_maxBitrateUplinkExt2==other_value.field_maxBitrateUplinkExt2
  && field_guaranteedBitRateUplinkExt2==other_value.field_guaranteedBitRateUplinkExt2;
}

boolean QoSV::is_bound() const
{
return (field_reliabilityClass.is_bound())
  || (field_delayClass.is_bound())
  || (field_spare1.is_bound())
  || (field_precedenceClass.is_bound())
  || (field_spare2.is_bound())
  || (field_peakThroughput.is_bound())
  || (field_meanThroughput.is_bound())
  || (field_spare3.is_bound())
  || (OPTIONAL_OMIT == field_deliverErroneusSDU.get_selection() || field_deliverErroneusSDU.is_bound())
  || (OPTIONAL_OMIT == field_deliveryOrder.get_selection() || field_deliveryOrder.is_bound())
  || (OPTIONAL_OMIT == field_trafficClass.get_selection() || field_trafficClass.is_bound())
  || (OPTIONAL_OMIT == field_maxSDUSize.get_selection() || field_maxSDUSize.is_bound())
  || (OPTIONAL_OMIT == field_maxBitrateUplink.get_selection() || field_maxBitrateUplink.is_bound())
  || (OPTIONAL_OMIT == field_maxBitrateDownlink.get_selection() || field_maxBitrateDownlink.is_bound())
  || (OPTIONAL_OMIT == field_sduErrorRatio.get_selection() || field_sduErrorRatio.is_bound())
  || (OPTIONAL_OMIT == field_residualBER.get_selection() || field_residualBER.is_bound())
  || (OPTIONAL_OMIT == field_trafficHandlingPriority.get_selection() || field_trafficHandlingPriority.is_bound())
  || (OPTIONAL_OMIT == field_transferDelay.get_selection() || field_transferDelay.is_bound())
  || (OPTIONAL_OMIT == field_guaranteedBitRateUplink.get_selection() || field_guaranteedBitRateUplink.is_bound())
  || (OPTIONAL_OMIT == field_guaranteedBitRateDownlink.get_selection() || field_guaranteedBitRateDownlink.is_bound())
  || (OPTIONAL_OMIT == field_sourceStatisticsDescriptor.get_selection() || field_sourceStatisticsDescriptor.is_bound())
  || (OPTIONAL_OMIT == field_signallingIndication.get_selection() || field_signallingIndication.is_bound())
  || (OPTIONAL_OMIT == field_spare4.get_selection() || field_spare4.is_bound())
  || (OPTIONAL_OMIT == field_maxBitrateDownlinkExt.get_selection() || field_maxBitrateDownlinkExt.is_bound())
  || (OPTIONAL_OMIT == field_guaranteedBitRateDownlinkExt.get_selection() || field_guaranteedBitRateDownlinkExt.is_bound())
  || (OPTIONAL_OMIT == field_maxBitrateUplinkExt.get_selection() || field_maxBitrateUplinkExt.is_bound())
  || (OPTIONAL_OMIT == field_guaranteedBitRateUplinkExt.get_selection() || field_guaranteedBitRateUplinkExt.is_bound())
  || (OPTIONAL_OMIT == field_maxBitrateDownlinkExt2.get_selection() || field_maxBitrateDownlinkExt2.is_bound())
  || (OPTIONAL_OMIT == field_guaranteedBitRateDownlinkExt2.get_selection() || field_guaranteedBitRateDownlinkExt2.is_bound())
  || (OPTIONAL_OMIT == field_maxBitrateUplinkExt2.get_selection() || field_maxBitrateUplinkExt2.is_bound())
  || (OPTIONAL_OMIT == field_guaranteedBitRateUplinkExt2.get_selection() || field_guaranteedBitRateUplinkExt2.is_bound());
}
boolean QoSV::is_value() const
{
return field_reliabilityClass.is_value()
  && field_delayClass.is_value()
  && field_spare1.is_value()
  && field_precedenceClass.is_value()
  && field_spare2.is_value()
  && field_peakThroughput.is_value()
  && field_meanThroughput.is_value()
  && field_spare3.is_value()
  && (OPTIONAL_OMIT == field_deliverErroneusSDU.get_selection() || field_deliverErroneusSDU.is_value())
  && (OPTIONAL_OMIT == field_deliveryOrder.get_selection() || field_deliveryOrder.is_value())
  && (OPTIONAL_OMIT == field_trafficClass.get_selection() || field_trafficClass.is_value())
  && (OPTIONAL_OMIT == field_maxSDUSize.get_selection() || field_maxSDUSize.is_value())
  && (OPTIONAL_OMIT == field_maxBitrateUplink.get_selection() || field_maxBitrateUplink.is_value())
  && (OPTIONAL_OMIT == field_maxBitrateDownlink.get_selection() || field_maxBitrateDownlink.is_value())
  && (OPTIONAL_OMIT == field_sduErrorRatio.get_selection() || field_sduErrorRatio.is_value())
  && (OPTIONAL_OMIT == field_residualBER.get_selection() || field_residualBER.is_value())
  && (OPTIONAL_OMIT == field_trafficHandlingPriority.get_selection() || field_trafficHandlingPriority.is_value())
  && (OPTIONAL_OMIT == field_transferDelay.get_selection() || field_transferDelay.is_value())
  && (OPTIONAL_OMIT == field_guaranteedBitRateUplink.get_selection() || field_guaranteedBitRateUplink.is_value())
  && (OPTIONAL_OMIT == field_guaranteedBitRateDownlink.get_selection() || field_guaranteedBitRateDownlink.is_value())
  && (OPTIONAL_OMIT == field_sourceStatisticsDescriptor.get_selection() || field_sourceStatisticsDescriptor.is_value())
  && (OPTIONAL_OMIT == field_signallingIndication.get_selection() || field_signallingIndication.is_value())
  && (OPTIONAL_OMIT == field_spare4.get_selection() || field_spare4.is_value())
  && (OPTIONAL_OMIT == field_maxBitrateDownlinkExt.get_selection() || field_maxBitrateDownlinkExt.is_value())
  && (OPTIONAL_OMIT == field_guaranteedBitRateDownlinkExt.get_selection() || field_guaranteedBitRateDownlinkExt.is_value())
  && (OPTIONAL_OMIT == field_maxBitrateUplinkExt.get_selection() || field_maxBitrateUplinkExt.is_value())
  && (OPTIONAL_OMIT == field_guaranteedBitRateUplinkExt.get_selection() || field_guaranteedBitRateUplinkExt.is_value())
  && (OPTIONAL_OMIT == field_maxBitrateDownlinkExt2.get_selection() || field_maxBitrateDownlinkExt2.is_value())
  && (OPTIONAL_OMIT == field_guaranteedBitRateDownlinkExt2.get_selection() || field_guaranteedBitRateDownlinkExt2.is_value())
  && (OPTIONAL_OMIT == field_maxBitrateUplinkExt2.get_selection() || field_maxBitrateUplinkExt2.is_value())
  && (OPTIONAL_OMIT == field_guaranteedBitRateUplinkExt2.get_selection() || field_guaranteedBitRateUplinkExt2.is_value());
}
int QoSV::size_of() const
{
  int ret_val = 8;
  if (field_deliverErroneusSDU.ispresent()) ret_val++;
  if (field_deliveryOrder.ispresent()) ret_val++;
  if (field_trafficClass.ispresent()) ret_val++;
  if (field_maxSDUSize.ispresent()) ret_val++;
  if (field_maxBitrateUplink.ispresent()) ret_val++;
  if (field_maxBitrateDownlink.ispresent()) ret_val++;
  if (field_sduErrorRatio.ispresent()) ret_val++;
  if (field_residualBER.ispresent()) ret_val++;
  if (field_trafficHandlingPriority.ispresent()) ret_val++;
  if (field_transferDelay.ispresent()) ret_val++;
  if (field_guaranteedBitRateUplink.ispresent()) ret_val++;
  if (field_guaranteedBitRateDownlink.ispresent()) ret_val++;
  if (field_sourceStatisticsDescriptor.ispresent()) ret_val++;
  if (field_signallingIndication.ispresent()) ret_val++;
  if (field_spare4.ispresent()) ret_val++;
  if (field_maxBitrateDownlinkExt.ispresent()) ret_val++;
  if (field_guaranteedBitRateDownlinkExt.ispresent()) ret_val++;
  if (field_maxBitrateUplinkExt.ispresent()) ret_val++;
  if (field_guaranteedBitRateUplinkExt.ispresent()) ret_val++;
  if (field_maxBitrateDownlinkExt2.ispresent()) ret_val++;
  if (field_guaranteedBitRateDownlinkExt2.ispresent()) ret_val++;
  if (field_maxBitrateUplinkExt2.ispresent()) ret_val++;
  if (field_guaranteedBitRateUplinkExt2.ispresent()) ret_val++;
  return ret_val;
}

void QoSV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ reliabilityClass := ");
field_reliabilityClass.log();
TTCN_Logger::log_event_str(", delayClass := ");
field_delayClass.log();
TTCN_Logger::log_event_str(", spare1 := ");
field_spare1.log();
TTCN_Logger::log_event_str(", precedenceClass := ");
field_precedenceClass.log();
TTCN_Logger::log_event_str(", spare2 := ");
field_spare2.log();
TTCN_Logger::log_event_str(", peakThroughput := ");
field_peakThroughput.log();
TTCN_Logger::log_event_str(", meanThroughput := ");
field_meanThroughput.log();
TTCN_Logger::log_event_str(", spare3 := ");
field_spare3.log();
TTCN_Logger::log_event_str(", deliverErroneusSDU := ");
field_deliverErroneusSDU.log();
TTCN_Logger::log_event_str(", deliveryOrder := ");
field_deliveryOrder.log();
TTCN_Logger::log_event_str(", trafficClass := ");
field_trafficClass.log();
TTCN_Logger::log_event_str(", maxSDUSize := ");
field_maxSDUSize.log();
TTCN_Logger::log_event_str(", maxBitrateUplink := ");
field_maxBitrateUplink.log();
TTCN_Logger::log_event_str(", maxBitrateDownlink := ");
field_maxBitrateDownlink.log();
TTCN_Logger::log_event_str(", sduErrorRatio := ");
field_sduErrorRatio.log();
TTCN_Logger::log_event_str(", residualBER := ");
field_residualBER.log();
TTCN_Logger::log_event_str(", trafficHandlingPriority := ");
field_trafficHandlingPriority.log();
TTCN_Logger::log_event_str(", transferDelay := ");
field_transferDelay.log();
TTCN_Logger::log_event_str(", guaranteedBitRateUplink := ");
field_guaranteedBitRateUplink.log();
TTCN_Logger::log_event_str(", guaranteedBitRateDownlink := ");
field_guaranteedBitRateDownlink.log();
TTCN_Logger::log_event_str(", sourceStatisticsDescriptor := ");
field_sourceStatisticsDescriptor.log();
TTCN_Logger::log_event_str(", signallingIndication := ");
field_signallingIndication.log();
TTCN_Logger::log_event_str(", spare4 := ");
field_spare4.log();
TTCN_Logger::log_event_str(", maxBitrateDownlinkExt := ");
field_maxBitrateDownlinkExt.log();
TTCN_Logger::log_event_str(", guaranteedBitRateDownlinkExt := ");
field_guaranteedBitRateDownlinkExt.log();
TTCN_Logger::log_event_str(", maxBitrateUplinkExt := ");
field_maxBitrateUplinkExt.log();
TTCN_Logger::log_event_str(", guaranteedBitRateUplinkExt := ");
field_guaranteedBitRateUplinkExt.log();
TTCN_Logger::log_event_str(", maxBitrateDownlinkExt2 := ");
field_maxBitrateDownlinkExt2.log();
TTCN_Logger::log_event_str(", guaranteedBitRateDownlinkExt2 := ");
field_guaranteedBitRateDownlinkExt2.log();
TTCN_Logger::log_event_str(", maxBitrateUplinkExt2 := ");
field_maxBitrateUplinkExt2.log();
TTCN_Logger::log_event_str(", guaranteedBitRateUplinkExt2 := ");
field_guaranteedBitRateUplinkExt2.log();
TTCN_Logger::log_event_str(" }");
}

void QoSV::set_implicit_omit()
{
if (reliabilityClass().is_bound()) reliabilityClass().set_implicit_omit();
if (delayClass().is_bound()) delayClass().set_implicit_omit();
if (spare1().is_bound()) spare1().set_implicit_omit();
if (precedenceClass().is_bound()) precedenceClass().set_implicit_omit();
if (spare2().is_bound()) spare2().set_implicit_omit();
if (peakThroughput().is_bound()) peakThroughput().set_implicit_omit();
if (meanThroughput().is_bound()) meanThroughput().set_implicit_omit();
if (spare3().is_bound()) spare3().set_implicit_omit();
if (!deliverErroneusSDU().is_bound()) deliverErroneusSDU() = OMIT_VALUE;
else deliverErroneusSDU().set_implicit_omit();
if (!deliveryOrder().is_bound()) deliveryOrder() = OMIT_VALUE;
else deliveryOrder().set_implicit_omit();
if (!trafficClass().is_bound()) trafficClass() = OMIT_VALUE;
else trafficClass().set_implicit_omit();
if (!maxSDUSize().is_bound()) maxSDUSize() = OMIT_VALUE;
else maxSDUSize().set_implicit_omit();
if (!maxBitrateUplink().is_bound()) maxBitrateUplink() = OMIT_VALUE;
else maxBitrateUplink().set_implicit_omit();
if (!maxBitrateDownlink().is_bound()) maxBitrateDownlink() = OMIT_VALUE;
else maxBitrateDownlink().set_implicit_omit();
if (!sduErrorRatio().is_bound()) sduErrorRatio() = OMIT_VALUE;
else sduErrorRatio().set_implicit_omit();
if (!residualBER().is_bound()) residualBER() = OMIT_VALUE;
else residualBER().set_implicit_omit();
if (!trafficHandlingPriority().is_bound()) trafficHandlingPriority() = OMIT_VALUE;
else trafficHandlingPriority().set_implicit_omit();
if (!transferDelay().is_bound()) transferDelay() = OMIT_VALUE;
else transferDelay().set_implicit_omit();
if (!guaranteedBitRateUplink().is_bound()) guaranteedBitRateUplink() = OMIT_VALUE;
else guaranteedBitRateUplink().set_implicit_omit();
if (!guaranteedBitRateDownlink().is_bound()) guaranteedBitRateDownlink() = OMIT_VALUE;
else guaranteedBitRateDownlink().set_implicit_omit();
if (!sourceStatisticsDescriptor().is_bound()) sourceStatisticsDescriptor() = OMIT_VALUE;
else sourceStatisticsDescriptor().set_implicit_omit();
if (!signallingIndication().is_bound()) signallingIndication() = OMIT_VALUE;
else signallingIndication().set_implicit_omit();
if (!spare4().is_bound()) spare4() = OMIT_VALUE;
else spare4().set_implicit_omit();
if (!maxBitrateDownlinkExt().is_bound()) maxBitrateDownlinkExt() = OMIT_VALUE;
else maxBitrateDownlinkExt().set_implicit_omit();
if (!guaranteedBitRateDownlinkExt().is_bound()) guaranteedBitRateDownlinkExt() = OMIT_VALUE;
else guaranteedBitRateDownlinkExt().set_implicit_omit();
if (!maxBitrateUplinkExt().is_bound()) maxBitrateUplinkExt() = OMIT_VALUE;
else maxBitrateUplinkExt().set_implicit_omit();
if (!guaranteedBitRateUplinkExt().is_bound()) guaranteedBitRateUplinkExt() = OMIT_VALUE;
else guaranteedBitRateUplinkExt().set_implicit_omit();
if (!maxBitrateDownlinkExt2().is_bound()) maxBitrateDownlinkExt2() = OMIT_VALUE;
else maxBitrateDownlinkExt2().set_implicit_omit();
if (!guaranteedBitRateDownlinkExt2().is_bound()) guaranteedBitRateDownlinkExt2() = OMIT_VALUE;
else guaranteedBitRateDownlinkExt2().set_implicit_omit();
if (!maxBitrateUplinkExt2().is_bound()) maxBitrateUplinkExt2() = OMIT_VALUE;
else maxBitrateUplinkExt2().set_implicit_omit();
if (!guaranteedBitRateUplinkExt2().is_bound()) guaranteedBitRateUplinkExt2() = OMIT_VALUE;
else guaranteedBitRateUplinkExt2().set_implicit_omit();
}

void QoSV::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 (31<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.QoSV has 31 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) reliabilityClass().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) delayClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) precedenceClass().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) peakThroughput().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) meanThroughput().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) deliverErroneusSDU().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) deliveryOrder().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) trafficClass().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) maxSDUSize().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) maxBitrateUplink().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlink().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) sduErrorRatio().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) residualBER().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) trafficHandlingPriority().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) transferDelay().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateUplink().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateDownlink().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) sourceStatisticsDescriptor().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) signallingIndication().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) spare4().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlinkExt().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateDownlinkExt().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) maxBitrateUplinkExt().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateUplinkExt().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlinkExt2().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateDownlinkExt2().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) maxBitrateUplinkExt2().set_param(*param.get_elem(29));
    if (param.get_size()>30 && param.get_elem(30)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateUplinkExt2().set_param(*param.get_elem(30));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reliabilityClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reliabilityClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "delayClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          delayClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "precedenceClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          precedenceClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "peakThroughput")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peakThroughput().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meanThroughput")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meanThroughput().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deliverErroneusSDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deliverErroneusSDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deliveryOrder")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deliveryOrder().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trafficClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trafficClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxSDUSize")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxSDUSize().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateUplink")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateUplink().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "sduErrorRatio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sduErrorRatio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "residualBER")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          residualBER().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trafficHandlingPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trafficHandlingPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "transferDelay")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          transferDelay().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateUplink")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateUplink().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateDownlink")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateDownlink().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceStatisticsDescriptor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceStatisticsDescriptor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "signallingIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          signallingIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateDownlinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateDownlinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateDownlinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateDownlinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateUplinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateUplinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateUplinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateUplinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateDownlinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateDownlinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateDownlinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateDownlinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateUplinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateUplinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateUplinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateUplinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.QoSV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.QoSV");
  }
}

void QoSV::encode_text(Text_Buf& text_buf) const
{
field_reliabilityClass.encode_text(text_buf);
field_delayClass.encode_text(text_buf);
field_spare1.encode_text(text_buf);
field_precedenceClass.encode_text(text_buf);
field_spare2.encode_text(text_buf);
field_peakThroughput.encode_text(text_buf);
field_meanThroughput.encode_text(text_buf);
field_spare3.encode_text(text_buf);
field_deliverErroneusSDU.encode_text(text_buf);
field_deliveryOrder.encode_text(text_buf);
field_trafficClass.encode_text(text_buf);
field_maxSDUSize.encode_text(text_buf);
field_maxBitrateUplink.encode_text(text_buf);
field_maxBitrateDownlink.encode_text(text_buf);
field_sduErrorRatio.encode_text(text_buf);
field_residualBER.encode_text(text_buf);
field_trafficHandlingPriority.encode_text(text_buf);
field_transferDelay.encode_text(text_buf);
field_guaranteedBitRateUplink.encode_text(text_buf);
field_guaranteedBitRateDownlink.encode_text(text_buf);
field_sourceStatisticsDescriptor.encode_text(text_buf);
field_signallingIndication.encode_text(text_buf);
field_spare4.encode_text(text_buf);
field_maxBitrateDownlinkExt.encode_text(text_buf);
field_guaranteedBitRateDownlinkExt.encode_text(text_buf);
field_maxBitrateUplinkExt.encode_text(text_buf);
field_guaranteedBitRateUplinkExt.encode_text(text_buf);
field_maxBitrateDownlinkExt2.encode_text(text_buf);
field_guaranteedBitRateDownlinkExt2.encode_text(text_buf);
field_maxBitrateUplinkExt2.encode_text(text_buf);
field_guaranteedBitRateUplinkExt2.encode_text(text_buf);
}

void QoSV::decode_text(Text_Buf& text_buf)
{
field_reliabilityClass.decode_text(text_buf);
field_delayClass.decode_text(text_buf);
field_spare1.decode_text(text_buf);
field_precedenceClass.decode_text(text_buf);
field_spare2.decode_text(text_buf);
field_peakThroughput.decode_text(text_buf);
field_meanThroughput.decode_text(text_buf);
field_spare3.decode_text(text_buf);
field_deliverErroneusSDU.decode_text(text_buf);
field_deliveryOrder.decode_text(text_buf);
field_trafficClass.decode_text(text_buf);
field_maxSDUSize.decode_text(text_buf);
field_maxBitrateUplink.decode_text(text_buf);
field_maxBitrateDownlink.decode_text(text_buf);
field_sduErrorRatio.decode_text(text_buf);
field_residualBER.decode_text(text_buf);
field_trafficHandlingPriority.decode_text(text_buf);
field_transferDelay.decode_text(text_buf);
field_guaranteedBitRateUplink.decode_text(text_buf);
field_guaranteedBitRateDownlink.decode_text(text_buf);
field_sourceStatisticsDescriptor.decode_text(text_buf);
field_signallingIndication.decode_text(text_buf);
field_spare4.decode_text(text_buf);
field_maxBitrateDownlinkExt.decode_text(text_buf);
field_guaranteedBitRateDownlinkExt.decode_text(text_buf);
field_maxBitrateUplinkExt.decode_text(text_buf);
field_guaranteedBitRateUplinkExt.decode_text(text_buf);
field_maxBitrateDownlinkExt2.decode_text(text_buf);
field_guaranteedBitRateDownlinkExt2.decode_text(text_buf);
field_maxBitrateUplinkExt2.decode_text(text_buf);
field_guaranteedBitRateUplinkExt2.decode_text(text_buf);
}

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

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

int QoSV::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_reliabilityClass.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_delayClass.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare1.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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_precedenceClass.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_peakThroughput.RAW_decode(General__Types::BIT4_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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_meanThroughput.RAW_decode(General__Types::BIT5_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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_spare3.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_deliverErroneusSDU = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_deliverErroneusSDU().RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_deliverErroneusSDU = 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_deliverErroneusSDU=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_deliveryOrder = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_deliveryOrder().RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_deliveryOrder = 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_deliveryOrder=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_trafficClass = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_trafficClass().RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_trafficClass = 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_trafficClass=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_maxSDUSize = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxSDUSize().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_maxSDUSize = 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_maxSDUSize=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_maxBitrateUplink = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateUplink().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_maxBitrateUplink = 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_maxBitrateUplink=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_maxBitrateDownlink = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateDownlink().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_maxBitrateDownlink = 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_maxBitrateDownlink=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_sduErrorRatio = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_sduErrorRatio().RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_sduErrorRatio = 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_sduErrorRatio=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_residualBER = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_residualBER().RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_residualBER = 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_residualBER=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_trafficHandlingPriority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_trafficHandlingPriority().RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_trafficHandlingPriority = 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_trafficHandlingPriority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_transferDelay = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, General__Types::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_transferDelay().RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_transferDelay = 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_transferDelay=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_guaranteedBitRateUplink = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_guaranteedBitRateUplink().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_guaranteedBitRateUplink = 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_guaranteedBitRateUplink=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_guaranteedBitRateDownlink = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_guaranteedBitRateDownlink().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_guaranteedBitRateDownlink = 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_guaranteedBitRateDownlink=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_sourceStatisticsDescriptor = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_sourceStatisticsDescriptor().RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_sourceStatisticsDescriptor = 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_sourceStatisticsDescriptor=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_signallingIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_signallingIndication().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_signallingIndication = 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_signallingIndication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_spare4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_spare4().RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_spare4 = 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_spare4=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_maxBitrateDownlinkExt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateDownlinkExt().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_maxBitrateDownlinkExt = 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_maxBitrateDownlinkExt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_guaranteedBitRateDownlinkExt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_guaranteedBitRateDownlinkExt().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_guaranteedBitRateDownlinkExt = 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_guaranteedBitRateDownlinkExt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_maxBitrateUplinkExt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateUplinkExt().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_maxBitrateUplinkExt = 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_maxBitrateUplinkExt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(26)) {
    field_guaranteedBitRateUplinkExt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_guaranteedBitRateUplinkExt().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_26_force_omit);
  if (decoded_field_length < 1) {
  field_guaranteedBitRateUplinkExt = 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_guaranteedBitRateUplinkExt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(27)) {
    field_maxBitrateDownlinkExt2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateDownlinkExt2().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_27_force_omit);
  if (decoded_field_length < 1) {
  field_maxBitrateDownlinkExt2 = 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_maxBitrateDownlinkExt2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(28)) {
    field_guaranteedBitRateDownlinkExt2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_28_force_omit(28, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_guaranteedBitRateDownlinkExt2().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_28_force_omit);
  if (decoded_field_length < 1) {
  field_guaranteedBitRateDownlinkExt2 = 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_guaranteedBitRateDownlinkExt2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(29)) {
    field_maxBitrateUplinkExt2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_29_force_omit(29, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_maxBitrateUplinkExt2().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_29_force_omit);
  if (decoded_field_length < 1) {
  field_maxBitrateUplinkExt2 = 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_maxBitrateUplinkExt2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(30)) {
    field_guaranteedBitRateUplinkExt2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_30_force_omit(30, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_guaranteedBitRateUplinkExt2().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_30_force_omit);
  if (decoded_field_length < 1) {
  field_guaranteedBitRateUplinkExt2 = 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_guaranteedBitRateUplinkExt2=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int QoSV::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 = 31;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(31);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT2_descr_.raw);
  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::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT5_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT3_descr_.raw);
  if (field_deliverErroneusSDU.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::BIT3_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_deliveryOrder.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::BIT2_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_trafficClass.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::BIT3_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_maxSDUSize.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_maxBitrateUplink.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_maxBitrateDownlink.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_sduErrorRatio.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, General__Types::BIT4_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_residualBER.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, General__Types::BIT4_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_trafficHandlingPriority.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, General__Types::BIT2_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_transferDelay.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, General__Types::BIT6_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_guaranteedBitRateUplink.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_guaranteedBitRateDownlink.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_sourceStatisticsDescriptor.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, General__Types::BIT4_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_signallingIndication.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_spare4.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, General__Types::BIT3_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_maxBitrateDownlinkExt.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_guaranteedBitRateDownlinkExt.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_maxBitrateUplinkExt.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_guaranteedBitRateUplinkExt.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_maxBitrateDownlinkExt2.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  if (field_guaranteedBitRateDownlinkExt2.ispresent()) {
  myleaf.body.node.nodes[28] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 28, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[28] = NULL;
  if (field_maxBitrateUplinkExt2.ispresent()) {
  myleaf.body.node.nodes[29] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 29, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[29] = NULL;
  if (field_guaranteedBitRateUplinkExt2.ispresent()) {
  myleaf.body.node.nodes[30] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 30, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[30] = NULL;
  encoded_length += field_reliabilityClass.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_delayClass.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare1.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_precedenceClass.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_peakThroughput.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_meanThroughput.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_spare3.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[7]);
  if (field_deliverErroneusSDU.ispresent()) {
  encoded_length += field_deliverErroneusSDU().RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_deliveryOrder.ispresent()) {
  encoded_length += field_deliveryOrder().RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_trafficClass.ispresent()) {
  encoded_length += field_trafficClass().RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_maxSDUSize.ispresent()) {
  encoded_length += field_maxSDUSize().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_maxBitrateUplink.ispresent()) {
  encoded_length += field_maxBitrateUplink().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_maxBitrateDownlink.ispresent()) {
  encoded_length += field_maxBitrateDownlink().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_sduErrorRatio.ispresent()) {
  encoded_length += field_sduErrorRatio().RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_residualBER.ispresent()) {
  encoded_length += field_residualBER().RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_trafficHandlingPriority.ispresent()) {
  encoded_length += field_trafficHandlingPriority().RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_transferDelay.ispresent()) {
  encoded_length += field_transferDelay().RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_guaranteedBitRateUplink.ispresent()) {
  encoded_length += field_guaranteedBitRateUplink().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_guaranteedBitRateDownlink.ispresent()) {
  encoded_length += field_guaranteedBitRateDownlink().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_sourceStatisticsDescriptor.ispresent()) {
  encoded_length += field_sourceStatisticsDescriptor().RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_signallingIndication.ispresent()) {
  encoded_length += field_signallingIndication().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_spare4.ispresent()) {
  encoded_length += field_spare4().RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_maxBitrateDownlinkExt.ispresent()) {
  encoded_length += field_maxBitrateDownlinkExt().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_guaranteedBitRateDownlinkExt.ispresent()) {
  encoded_length += field_guaranteedBitRateDownlinkExt().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_maxBitrateUplinkExt.ispresent()) {
  encoded_length += field_maxBitrateUplinkExt().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_guaranteedBitRateUplinkExt.ispresent()) {
  encoded_length += field_guaranteedBitRateUplinkExt().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_maxBitrateDownlinkExt2.ispresent()) {
  encoded_length += field_maxBitrateDownlinkExt2().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_guaranteedBitRateDownlinkExt2.ispresent()) {
  encoded_length += field_guaranteedBitRateDownlinkExt2().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[28]);
  }
  if (field_maxBitrateUplinkExt2.ispresent()) {
  encoded_length += field_maxBitrateUplinkExt2().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[29]);
  }
  if (field_guaranteedBitRateUplinkExt2.ispresent()) {
  encoded_length += field_guaranteedBitRateUplinkExt2().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[30]);
  }
  return myleaf.length = encoded_length;
}

struct QoSV_template::single_value_struct {
BITSTRING_template field_reliabilityClass;
BITSTRING_template field_delayClass;
BITSTRING_template field_spare1;
BITSTRING_template field_precedenceClass;
BITSTRING_template field_spare2;
BITSTRING_template field_peakThroughput;
BITSTRING_template field_meanThroughput;
BITSTRING_template field_spare3;
BITSTRING_template field_deliverErroneusSDU;
BITSTRING_template field_deliveryOrder;
BITSTRING_template field_trafficClass;
OCTETSTRING_template field_maxSDUSize;
OCTETSTRING_template field_maxBitrateUplink;
OCTETSTRING_template field_maxBitrateDownlink;
BITSTRING_template field_sduErrorRatio;
BITSTRING_template field_residualBER;
BITSTRING_template field_trafficHandlingPriority;
BITSTRING_template field_transferDelay;
OCTETSTRING_template field_guaranteedBitRateUplink;
OCTETSTRING_template field_guaranteedBitRateDownlink;
BITSTRING_template field_sourceStatisticsDescriptor;
BITSTRING_template field_signallingIndication;
BITSTRING_template field_spare4;
OCTETSTRING_template field_maxBitrateDownlinkExt;
OCTETSTRING_template field_guaranteedBitRateDownlinkExt;
OCTETSTRING_template field_maxBitrateUplinkExt;
OCTETSTRING_template field_guaranteedBitRateUplinkExt;
OCTETSTRING_template field_maxBitrateDownlinkExt2;
OCTETSTRING_template field_guaranteedBitRateDownlinkExt2;
OCTETSTRING_template field_maxBitrateUplinkExt2;
OCTETSTRING_template field_guaranteedBitRateUplinkExt2;
};

void QoSV_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_reliabilityClass = ANY_VALUE;
single_value->field_delayClass = ANY_VALUE;
single_value->field_spare1 = ANY_VALUE;
single_value->field_precedenceClass = ANY_VALUE;
single_value->field_spare2 = ANY_VALUE;
single_value->field_peakThroughput = ANY_VALUE;
single_value->field_meanThroughput = ANY_VALUE;
single_value->field_spare3 = ANY_VALUE;
single_value->field_deliverErroneusSDU = ANY_OR_OMIT;
single_value->field_deliveryOrder = ANY_OR_OMIT;
single_value->field_trafficClass = ANY_OR_OMIT;
single_value->field_maxSDUSize = ANY_OR_OMIT;
single_value->field_maxBitrateUplink = ANY_OR_OMIT;
single_value->field_maxBitrateDownlink = ANY_OR_OMIT;
single_value->field_sduErrorRatio = ANY_OR_OMIT;
single_value->field_residualBER = ANY_OR_OMIT;
single_value->field_trafficHandlingPriority = ANY_OR_OMIT;
single_value->field_transferDelay = ANY_OR_OMIT;
single_value->field_guaranteedBitRateUplink = ANY_OR_OMIT;
single_value->field_guaranteedBitRateDownlink = ANY_OR_OMIT;
single_value->field_sourceStatisticsDescriptor = ANY_OR_OMIT;
single_value->field_signallingIndication = ANY_OR_OMIT;
single_value->field_spare4 = ANY_OR_OMIT;
single_value->field_maxBitrateDownlinkExt = ANY_OR_OMIT;
single_value->field_guaranteedBitRateDownlinkExt = ANY_OR_OMIT;
single_value->field_maxBitrateUplinkExt = ANY_OR_OMIT;
single_value->field_guaranteedBitRateUplinkExt = ANY_OR_OMIT;
single_value->field_maxBitrateDownlinkExt2 = ANY_OR_OMIT;
single_value->field_guaranteedBitRateDownlinkExt2 = ANY_OR_OMIT;
single_value->field_maxBitrateUplinkExt2 = ANY_OR_OMIT;
single_value->field_guaranteedBitRateUplinkExt2 = ANY_OR_OMIT;
}
}
}

void QoSV_template::copy_value(const QoSV& other_value)
{
single_value = new single_value_struct;
if (other_value.reliabilityClass().is_bound()) {
  single_value->field_reliabilityClass = other_value.reliabilityClass();
} else {
  single_value->field_reliabilityClass.clean_up();
}
if (other_value.delayClass().is_bound()) {
  single_value->field_delayClass = other_value.delayClass();
} else {
  single_value->field_delayClass.clean_up();
}
if (other_value.spare1().is_bound()) {
  single_value->field_spare1 = other_value.spare1();
} else {
  single_value->field_spare1.clean_up();
}
if (other_value.precedenceClass().is_bound()) {
  single_value->field_precedenceClass = other_value.precedenceClass();
} else {
  single_value->field_precedenceClass.clean_up();
}
if (other_value.spare2().is_bound()) {
  single_value->field_spare2 = other_value.spare2();
} else {
  single_value->field_spare2.clean_up();
}
if (other_value.peakThroughput().is_bound()) {
  single_value->field_peakThroughput = other_value.peakThroughput();
} else {
  single_value->field_peakThroughput.clean_up();
}
if (other_value.meanThroughput().is_bound()) {
  single_value->field_meanThroughput = other_value.meanThroughput();
} else {
  single_value->field_meanThroughput.clean_up();
}
if (other_value.spare3().is_bound()) {
  single_value->field_spare3 = other_value.spare3();
} else {
  single_value->field_spare3.clean_up();
}
if (other_value.deliverErroneusSDU().is_bound()) {
  if (other_value.deliverErroneusSDU().ispresent()) single_value->field_deliverErroneusSDU = other_value.deliverErroneusSDU()();
  else single_value->field_deliverErroneusSDU = OMIT_VALUE;
} else {
  single_value->field_deliverErroneusSDU.clean_up();
}
if (other_value.deliveryOrder().is_bound()) {
  if (other_value.deliveryOrder().ispresent()) single_value->field_deliveryOrder = other_value.deliveryOrder()();
  else single_value->field_deliveryOrder = OMIT_VALUE;
} else {
  single_value->field_deliveryOrder.clean_up();
}
if (other_value.trafficClass().is_bound()) {
  if (other_value.trafficClass().ispresent()) single_value->field_trafficClass = other_value.trafficClass()();
  else single_value->field_trafficClass = OMIT_VALUE;
} else {
  single_value->field_trafficClass.clean_up();
}
if (other_value.maxSDUSize().is_bound()) {
  if (other_value.maxSDUSize().ispresent()) single_value->field_maxSDUSize = other_value.maxSDUSize()();
  else single_value->field_maxSDUSize = OMIT_VALUE;
} else {
  single_value->field_maxSDUSize.clean_up();
}
if (other_value.maxBitrateUplink().is_bound()) {
  if (other_value.maxBitrateUplink().ispresent()) single_value->field_maxBitrateUplink = other_value.maxBitrateUplink()();
  else single_value->field_maxBitrateUplink = OMIT_VALUE;
} else {
  single_value->field_maxBitrateUplink.clean_up();
}
if (other_value.maxBitrateDownlink().is_bound()) {
  if (other_value.maxBitrateDownlink().ispresent()) single_value->field_maxBitrateDownlink = other_value.maxBitrateDownlink()();
  else single_value->field_maxBitrateDownlink = OMIT_VALUE;
} else {
  single_value->field_maxBitrateDownlink.clean_up();
}
if (other_value.sduErrorRatio().is_bound()) {
  if (other_value.sduErrorRatio().ispresent()) single_value->field_sduErrorRatio = other_value.sduErrorRatio()();
  else single_value->field_sduErrorRatio = OMIT_VALUE;
} else {
  single_value->field_sduErrorRatio.clean_up();
}
if (other_value.residualBER().is_bound()) {
  if (other_value.residualBER().ispresent()) single_value->field_residualBER = other_value.residualBER()();
  else single_value->field_residualBER = OMIT_VALUE;
} else {
  single_value->field_residualBER.clean_up();
}
if (other_value.trafficHandlingPriority().is_bound()) {
  if (other_value.trafficHandlingPriority().ispresent()) single_value->field_trafficHandlingPriority = other_value.trafficHandlingPriority()();
  else single_value->field_trafficHandlingPriority = OMIT_VALUE;
} else {
  single_value->field_trafficHandlingPriority.clean_up();
}
if (other_value.transferDelay().is_bound()) {
  if (other_value.transferDelay().ispresent()) single_value->field_transferDelay = other_value.transferDelay()();
  else single_value->field_transferDelay = OMIT_VALUE;
} else {
  single_value->field_transferDelay.clean_up();
}
if (other_value.guaranteedBitRateUplink().is_bound()) {
  if (other_value.guaranteedBitRateUplink().ispresent()) single_value->field_guaranteedBitRateUplink = other_value.guaranteedBitRateUplink()();
  else single_value->field_guaranteedBitRateUplink = OMIT_VALUE;
} else {
  single_value->field_guaranteedBitRateUplink.clean_up();
}
if (other_value.guaranteedBitRateDownlink().is_bound()) {
  if (other_value.guaranteedBitRateDownlink().ispresent()) single_value->field_guaranteedBitRateDownlink = other_value.guaranteedBitRateDownlink()();
  else single_value->field_guaranteedBitRateDownlink = OMIT_VALUE;
} else {
  single_value->field_guaranteedBitRateDownlink.clean_up();
}
if (other_value.sourceStatisticsDescriptor().is_bound()) {
  if (other_value.sourceStatisticsDescriptor().ispresent()) single_value->field_sourceStatisticsDescriptor = other_value.sourceStatisticsDescriptor()();
  else single_value->field_sourceStatisticsDescriptor = OMIT_VALUE;
} else {
  single_value->field_sourceStatisticsDescriptor.clean_up();
}
if (other_value.signallingIndication().is_bound()) {
  if (other_value.signallingIndication().ispresent()) single_value->field_signallingIndication = other_value.signallingIndication()();
  else single_value->field_signallingIndication = OMIT_VALUE;
} else {
  single_value->field_signallingIndication.clean_up();
}
if (other_value.spare4().is_bound()) {
  if (other_value.spare4().ispresent()) single_value->field_spare4 = other_value.spare4()();
  else single_value->field_spare4 = OMIT_VALUE;
} else {
  single_value->field_spare4.clean_up();
}
if (other_value.maxBitrateDownlinkExt().is_bound()) {
  if (other_value.maxBitrateDownlinkExt().ispresent()) single_value->field_maxBitrateDownlinkExt = other_value.maxBitrateDownlinkExt()();
  else single_value->field_maxBitrateDownlinkExt = OMIT_VALUE;
} else {
  single_value->field_maxBitrateDownlinkExt.clean_up();
}
if (other_value.guaranteedBitRateDownlinkExt().is_bound()) {
  if (other_value.guaranteedBitRateDownlinkExt().ispresent()) single_value->field_guaranteedBitRateDownlinkExt = other_value.guaranteedBitRateDownlinkExt()();
  else single_value->field_guaranteedBitRateDownlinkExt = OMIT_VALUE;
} else {
  single_value->field_guaranteedBitRateDownlinkExt.clean_up();
}
if (other_value.maxBitrateUplinkExt().is_bound()) {
  if (other_value.maxBitrateUplinkExt().ispresent()) single_value->field_maxBitrateUplinkExt = other_value.maxBitrateUplinkExt()();
  else single_value->field_maxBitrateUplinkExt = OMIT_VALUE;
} else {
  single_value->field_maxBitrateUplinkExt.clean_up();
}
if (other_value.guaranteedBitRateUplinkExt().is_bound()) {
  if (other_value.guaranteedBitRateUplinkExt().ispresent()) single_value->field_guaranteedBitRateUplinkExt = other_value.guaranteedBitRateUplinkExt()();
  else single_value->field_guaranteedBitRateUplinkExt = OMIT_VALUE;
} else {
  single_value->field_guaranteedBitRateUplinkExt.clean_up();
}
if (other_value.maxBitrateDownlinkExt2().is_bound()) {
  if (other_value.maxBitrateDownlinkExt2().ispresent()) single_value->field_maxBitrateDownlinkExt2 = other_value.maxBitrateDownlinkExt2()();
  else single_value->field_maxBitrateDownlinkExt2 = OMIT_VALUE;
} else {
  single_value->field_maxBitrateDownlinkExt2.clean_up();
}
if (other_value.guaranteedBitRateDownlinkExt2().is_bound()) {
  if (other_value.guaranteedBitRateDownlinkExt2().ispresent()) single_value->field_guaranteedBitRateDownlinkExt2 = other_value.guaranteedBitRateDownlinkExt2()();
  else single_value->field_guaranteedBitRateDownlinkExt2 = OMIT_VALUE;
} else {
  single_value->field_guaranteedBitRateDownlinkExt2.clean_up();
}
if (other_value.maxBitrateUplinkExt2().is_bound()) {
  if (other_value.maxBitrateUplinkExt2().ispresent()) single_value->field_maxBitrateUplinkExt2 = other_value.maxBitrateUplinkExt2()();
  else single_value->field_maxBitrateUplinkExt2 = OMIT_VALUE;
} else {
  single_value->field_maxBitrateUplinkExt2.clean_up();
}
if (other_value.guaranteedBitRateUplinkExt2().is_bound()) {
  if (other_value.guaranteedBitRateUplinkExt2().ispresent()) single_value->field_guaranteedBitRateUplinkExt2 = other_value.guaranteedBitRateUplinkExt2()();
  else single_value->field_guaranteedBitRateUplinkExt2 = OMIT_VALUE;
} else {
  single_value->field_guaranteedBitRateUplinkExt2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void QoSV_template::copy_template(const QoSV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.reliabilityClass().get_selection()) {
single_value->field_reliabilityClass = other_value.reliabilityClass();
} else {
single_value->field_reliabilityClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.delayClass().get_selection()) {
single_value->field_delayClass = other_value.delayClass();
} else {
single_value->field_delayClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare1().get_selection()) {
single_value->field_spare1 = other_value.spare1();
} else {
single_value->field_spare1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.precedenceClass().get_selection()) {
single_value->field_precedenceClass = other_value.precedenceClass();
} else {
single_value->field_precedenceClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2().get_selection()) {
single_value->field_spare2 = other_value.spare2();
} else {
single_value->field_spare2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.peakThroughput().get_selection()) {
single_value->field_peakThroughput = other_value.peakThroughput();
} else {
single_value->field_peakThroughput.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.meanThroughput().get_selection()) {
single_value->field_meanThroughput = other_value.meanThroughput();
} else {
single_value->field_meanThroughput.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare3().get_selection()) {
single_value->field_spare3 = other_value.spare3();
} else {
single_value->field_spare3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deliverErroneusSDU().get_selection()) {
single_value->field_deliverErroneusSDU = other_value.deliverErroneusSDU();
} else {
single_value->field_deliverErroneusSDU.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deliveryOrder().get_selection()) {
single_value->field_deliveryOrder = other_value.deliveryOrder();
} else {
single_value->field_deliveryOrder.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.trafficClass().get_selection()) {
single_value->field_trafficClass = other_value.trafficClass();
} else {
single_value->field_trafficClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxSDUSize().get_selection()) {
single_value->field_maxSDUSize = other_value.maxSDUSize();
} else {
single_value->field_maxSDUSize.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxBitrateUplink().get_selection()) {
single_value->field_maxBitrateUplink = other_value.maxBitrateUplink();
} else {
single_value->field_maxBitrateUplink.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.sduErrorRatio().get_selection()) {
single_value->field_sduErrorRatio = other_value.sduErrorRatio();
} else {
single_value->field_sduErrorRatio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.residualBER().get_selection()) {
single_value->field_residualBER = other_value.residualBER();
} else {
single_value->field_residualBER.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.trafficHandlingPriority().get_selection()) {
single_value->field_trafficHandlingPriority = other_value.trafficHandlingPriority();
} else {
single_value->field_trafficHandlingPriority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.transferDelay().get_selection()) {
single_value->field_transferDelay = other_value.transferDelay();
} else {
single_value->field_transferDelay.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.guaranteedBitRateUplink().get_selection()) {
single_value->field_guaranteedBitRateUplink = other_value.guaranteedBitRateUplink();
} else {
single_value->field_guaranteedBitRateUplink.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.guaranteedBitRateDownlink().get_selection()) {
single_value->field_guaranteedBitRateDownlink = other_value.guaranteedBitRateDownlink();
} else {
single_value->field_guaranteedBitRateDownlink.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceStatisticsDescriptor().get_selection()) {
single_value->field_sourceStatisticsDescriptor = other_value.sourceStatisticsDescriptor();
} else {
single_value->field_sourceStatisticsDescriptor.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.signallingIndication().get_selection()) {
single_value->field_signallingIndication = other_value.signallingIndication();
} else {
single_value->field_signallingIndication.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare4().get_selection()) {
single_value->field_spare4 = other_value.spare4();
} else {
single_value->field_spare4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxBitrateDownlinkExt().get_selection()) {
single_value->field_maxBitrateDownlinkExt = other_value.maxBitrateDownlinkExt();
} else {
single_value->field_maxBitrateDownlinkExt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.guaranteedBitRateDownlinkExt().get_selection()) {
single_value->field_guaranteedBitRateDownlinkExt = other_value.guaranteedBitRateDownlinkExt();
} else {
single_value->field_guaranteedBitRateDownlinkExt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxBitrateUplinkExt().get_selection()) {
single_value->field_maxBitrateUplinkExt = other_value.maxBitrateUplinkExt();
} else {
single_value->field_maxBitrateUplinkExt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.guaranteedBitRateUplinkExt().get_selection()) {
single_value->field_guaranteedBitRateUplinkExt = other_value.guaranteedBitRateUplinkExt();
} else {
single_value->field_guaranteedBitRateUplinkExt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxBitrateDownlinkExt2().get_selection()) {
single_value->field_maxBitrateDownlinkExt2 = other_value.maxBitrateDownlinkExt2();
} else {
single_value->field_maxBitrateDownlinkExt2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.guaranteedBitRateDownlinkExt2().get_selection()) {
single_value->field_guaranteedBitRateDownlinkExt2 = other_value.guaranteedBitRateDownlinkExt2();
} else {
single_value->field_guaranteedBitRateDownlinkExt2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maxBitrateUplinkExt2().get_selection()) {
single_value->field_maxBitrateUplinkExt2 = other_value.maxBitrateUplinkExt2();
} else {
single_value->field_maxBitrateUplinkExt2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.guaranteedBitRateUplinkExt2().get_selection()) {
single_value->field_guaranteedBitRateUplinkExt2 = other_value.guaranteedBitRateUplinkExt2();
} else {
single_value->field_guaranteedBitRateUplinkExt2.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 QoSV_template[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 QoSV_template(*other_value.implication_.precondition);
implication_.implied_template = new QoSV_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.QoSV.");
break;
}
set_selection(other_value);
}

QoSV_template::QoSV_template()
{
}

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

QoSV_template::QoSV_template(const QoSV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean QoSV_template::match(const QoSV& 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.reliabilityClass().is_bound()) return FALSE;
if(!single_value->field_reliabilityClass.match(other_value.reliabilityClass(), legacy))return FALSE;
if(!other_value.delayClass().is_bound()) return FALSE;
if(!single_value->field_delayClass.match(other_value.delayClass(), legacy))return FALSE;
if(!other_value.spare1().is_bound()) return FALSE;
if(!single_value->field_spare1.match(other_value.spare1(), legacy))return FALSE;
if(!other_value.precedenceClass().is_bound()) return FALSE;
if(!single_value->field_precedenceClass.match(other_value.precedenceClass(), legacy))return FALSE;
if(!other_value.spare2().is_bound()) return FALSE;
if(!single_value->field_spare2.match(other_value.spare2(), legacy))return FALSE;
if(!other_value.peakThroughput().is_bound()) return FALSE;
if(!single_value->field_peakThroughput.match(other_value.peakThroughput(), legacy))return FALSE;
if(!other_value.meanThroughput().is_bound()) return FALSE;
if(!single_value->field_meanThroughput.match(other_value.meanThroughput(), legacy))return FALSE;
if(!other_value.spare3().is_bound()) return FALSE;
if(!single_value->field_spare3.match(other_value.spare3(), legacy))return FALSE;
if(!other_value.deliverErroneusSDU().is_bound()) return FALSE;
if((other_value.deliverErroneusSDU().ispresent() ? !single_value->field_deliverErroneusSDU.match((const BITSTRING&)other_value.deliverErroneusSDU(), legacy) : !single_value->field_deliverErroneusSDU.match_omit(legacy)))return FALSE;
if(!other_value.deliveryOrder().is_bound()) return FALSE;
if((other_value.deliveryOrder().ispresent() ? !single_value->field_deliveryOrder.match((const BITSTRING&)other_value.deliveryOrder(), legacy) : !single_value->field_deliveryOrder.match_omit(legacy)))return FALSE;
if(!other_value.trafficClass().is_bound()) return FALSE;
if((other_value.trafficClass().ispresent() ? !single_value->field_trafficClass.match((const BITSTRING&)other_value.trafficClass(), legacy) : !single_value->field_trafficClass.match_omit(legacy)))return FALSE;
if(!other_value.maxSDUSize().is_bound()) return FALSE;
if((other_value.maxSDUSize().ispresent() ? !single_value->field_maxSDUSize.match((const OCTETSTRING&)other_value.maxSDUSize(), legacy) : !single_value->field_maxSDUSize.match_omit(legacy)))return FALSE;
if(!other_value.maxBitrateUplink().is_bound()) return FALSE;
if((other_value.maxBitrateUplink().ispresent() ? !single_value->field_maxBitrateUplink.match((const OCTETSTRING&)other_value.maxBitrateUplink(), legacy) : !single_value->field_maxBitrateUplink.match_omit(legacy)))return FALSE;
if(!other_value.maxBitrateDownlink().is_bound()) return FALSE;
if((other_value.maxBitrateDownlink().ispresent() ? !single_value->field_maxBitrateDownlink.match((const OCTETSTRING&)other_value.maxBitrateDownlink(), legacy) : !single_value->field_maxBitrateDownlink.match_omit(legacy)))return FALSE;
if(!other_value.sduErrorRatio().is_bound()) return FALSE;
if((other_value.sduErrorRatio().ispresent() ? !single_value->field_sduErrorRatio.match((const BITSTRING&)other_value.sduErrorRatio(), legacy) : !single_value->field_sduErrorRatio.match_omit(legacy)))return FALSE;
if(!other_value.residualBER().is_bound()) return FALSE;
if((other_value.residualBER().ispresent() ? !single_value->field_residualBER.match((const BITSTRING&)other_value.residualBER(), legacy) : !single_value->field_residualBER.match_omit(legacy)))return FALSE;
if(!other_value.trafficHandlingPriority().is_bound()) return FALSE;
if((other_value.trafficHandlingPriority().ispresent() ? !single_value->field_trafficHandlingPriority.match((const BITSTRING&)other_value.trafficHandlingPriority(), legacy) : !single_value->field_trafficHandlingPriority.match_omit(legacy)))return FALSE;
if(!other_value.transferDelay().is_bound()) return FALSE;
if((other_value.transferDelay().ispresent() ? !single_value->field_transferDelay.match((const BITSTRING&)other_value.transferDelay(), legacy) : !single_value->field_transferDelay.match_omit(legacy)))return FALSE;
if(!other_value.guaranteedBitRateUplink().is_bound()) return FALSE;
if((other_value.guaranteedBitRateUplink().ispresent() ? !single_value->field_guaranteedBitRateUplink.match((const OCTETSTRING&)other_value.guaranteedBitRateUplink(), legacy) : !single_value->field_guaranteedBitRateUplink.match_omit(legacy)))return FALSE;
if(!other_value.guaranteedBitRateDownlink().is_bound()) return FALSE;
if((other_value.guaranteedBitRateDownlink().ispresent() ? !single_value->field_guaranteedBitRateDownlink.match((const OCTETSTRING&)other_value.guaranteedBitRateDownlink(), legacy) : !single_value->field_guaranteedBitRateDownlink.match_omit(legacy)))return FALSE;
if(!other_value.sourceStatisticsDescriptor().is_bound()) return FALSE;
if((other_value.sourceStatisticsDescriptor().ispresent() ? !single_value->field_sourceStatisticsDescriptor.match((const BITSTRING&)other_value.sourceStatisticsDescriptor(), legacy) : !single_value->field_sourceStatisticsDescriptor.match_omit(legacy)))return FALSE;
if(!other_value.signallingIndication().is_bound()) return FALSE;
if((other_value.signallingIndication().ispresent() ? !single_value->field_signallingIndication.match((const BITSTRING&)other_value.signallingIndication(), legacy) : !single_value->field_signallingIndication.match_omit(legacy)))return FALSE;
if(!other_value.spare4().is_bound()) return FALSE;
if((other_value.spare4().ispresent() ? !single_value->field_spare4.match((const BITSTRING&)other_value.spare4(), legacy) : !single_value->field_spare4.match_omit(legacy)))return FALSE;
if(!other_value.maxBitrateDownlinkExt().is_bound()) return FALSE;
if((other_value.maxBitrateDownlinkExt().ispresent() ? !single_value->field_maxBitrateDownlinkExt.match((const OCTETSTRING&)other_value.maxBitrateDownlinkExt(), legacy) : !single_value->field_maxBitrateDownlinkExt.match_omit(legacy)))return FALSE;
if(!other_value.guaranteedBitRateDownlinkExt().is_bound()) return FALSE;
if((other_value.guaranteedBitRateDownlinkExt().ispresent() ? !single_value->field_guaranteedBitRateDownlinkExt.match((const OCTETSTRING&)other_value.guaranteedBitRateDownlinkExt(), legacy) : !single_value->field_guaranteedBitRateDownlinkExt.match_omit(legacy)))return FALSE;
if(!other_value.maxBitrateUplinkExt().is_bound()) return FALSE;
if((other_value.maxBitrateUplinkExt().ispresent() ? !single_value->field_maxBitrateUplinkExt.match((const OCTETSTRING&)other_value.maxBitrateUplinkExt(), legacy) : !single_value->field_maxBitrateUplinkExt.match_omit(legacy)))return FALSE;
if(!other_value.guaranteedBitRateUplinkExt().is_bound()) return FALSE;
if((other_value.guaranteedBitRateUplinkExt().ispresent() ? !single_value->field_guaranteedBitRateUplinkExt.match((const OCTETSTRING&)other_value.guaranteedBitRateUplinkExt(), legacy) : !single_value->field_guaranteedBitRateUplinkExt.match_omit(legacy)))return FALSE;
if(!other_value.maxBitrateDownlinkExt2().is_bound()) return FALSE;
if((other_value.maxBitrateDownlinkExt2().ispresent() ? !single_value->field_maxBitrateDownlinkExt2.match((const OCTETSTRING&)other_value.maxBitrateDownlinkExt2(), legacy) : !single_value->field_maxBitrateDownlinkExt2.match_omit(legacy)))return FALSE;
if(!other_value.guaranteedBitRateDownlinkExt2().is_bound()) return FALSE;
if((other_value.guaranteedBitRateDownlinkExt2().ispresent() ? !single_value->field_guaranteedBitRateDownlinkExt2.match((const OCTETSTRING&)other_value.guaranteedBitRateDownlinkExt2(), legacy) : !single_value->field_guaranteedBitRateDownlinkExt2.match_omit(legacy)))return FALSE;
if(!other_value.maxBitrateUplinkExt2().is_bound()) return FALSE;
if((other_value.maxBitrateUplinkExt2().ispresent() ? !single_value->field_maxBitrateUplinkExt2.match((const OCTETSTRING&)other_value.maxBitrateUplinkExt2(), legacy) : !single_value->field_maxBitrateUplinkExt2.match_omit(legacy)))return FALSE;
if(!other_value.guaranteedBitRateUplinkExt2().is_bound()) return FALSE;
if((other_value.guaranteedBitRateUplinkExt2().ispresent() ? !single_value->field_guaranteedBitRateUplinkExt2.match((const OCTETSTRING&)other_value.guaranteedBitRateUplinkExt2(), legacy) : !single_value->field_guaranteedBitRateUplinkExt2.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.QoSV.");
}
return FALSE;
}

boolean QoSV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_reliabilityClass.is_bound()
 || single_value->field_delayClass.is_bound()
 || single_value->field_spare1.is_bound()
 || single_value->field_precedenceClass.is_bound()
 || single_value->field_spare2.is_bound()
 || single_value->field_peakThroughput.is_bound()
 || single_value->field_meanThroughput.is_bound()
 || single_value->field_spare3.is_bound()
 || (single_value->field_deliverErroneusSDU.is_omit() || single_value->field_deliverErroneusSDU.is_bound())
 || (single_value->field_deliveryOrder.is_omit() || single_value->field_deliveryOrder.is_bound())
 || (single_value->field_trafficClass.is_omit() || single_value->field_trafficClass.is_bound())
 || (single_value->field_maxSDUSize.is_omit() || single_value->field_maxSDUSize.is_bound())
 || (single_value->field_maxBitrateUplink.is_omit() || single_value->field_maxBitrateUplink.is_bound())
 || (single_value->field_maxBitrateDownlink.is_omit() || single_value->field_maxBitrateDownlink.is_bound())
 || (single_value->field_sduErrorRatio.is_omit() || single_value->field_sduErrorRatio.is_bound())
 || (single_value->field_residualBER.is_omit() || single_value->field_residualBER.is_bound())
 || (single_value->field_trafficHandlingPriority.is_omit() || single_value->field_trafficHandlingPriority.is_bound())
 || (single_value->field_transferDelay.is_omit() || single_value->field_transferDelay.is_bound())
 || (single_value->field_guaranteedBitRateUplink.is_omit() || single_value->field_guaranteedBitRateUplink.is_bound())
 || (single_value->field_guaranteedBitRateDownlink.is_omit() || single_value->field_guaranteedBitRateDownlink.is_bound())
 || (single_value->field_sourceStatisticsDescriptor.is_omit() || single_value->field_sourceStatisticsDescriptor.is_bound())
 || (single_value->field_signallingIndication.is_omit() || single_value->field_signallingIndication.is_bound())
 || (single_value->field_spare4.is_omit() || single_value->field_spare4.is_bound())
 || (single_value->field_maxBitrateDownlinkExt.is_omit() || single_value->field_maxBitrateDownlinkExt.is_bound())
 || (single_value->field_guaranteedBitRateDownlinkExt.is_omit() || single_value->field_guaranteedBitRateDownlinkExt.is_bound())
 || (single_value->field_maxBitrateUplinkExt.is_omit() || single_value->field_maxBitrateUplinkExt.is_bound())
 || (single_value->field_guaranteedBitRateUplinkExt.is_omit() || single_value->field_guaranteedBitRateUplinkExt.is_bound())
 || (single_value->field_maxBitrateDownlinkExt2.is_omit() || single_value->field_maxBitrateDownlinkExt2.is_bound())
 || (single_value->field_guaranteedBitRateDownlinkExt2.is_omit() || single_value->field_guaranteedBitRateDownlinkExt2.is_bound())
 || (single_value->field_maxBitrateUplinkExt2.is_omit() || single_value->field_maxBitrateUplinkExt2.is_bound())
 || (single_value->field_guaranteedBitRateUplinkExt2.is_omit() || single_value->field_guaranteedBitRateUplinkExt2.is_bound());
}

boolean QoSV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_reliabilityClass.is_value()
 && single_value->field_delayClass.is_value()
 && single_value->field_spare1.is_value()
 && single_value->field_precedenceClass.is_value()
 && single_value->field_spare2.is_value()
 && single_value->field_peakThroughput.is_value()
 && single_value->field_meanThroughput.is_value()
 && single_value->field_spare3.is_value()
 && (single_value->field_deliverErroneusSDU.is_omit() || single_value->field_deliverErroneusSDU.is_value())
 && (single_value->field_deliveryOrder.is_omit() || single_value->field_deliveryOrder.is_value())
 && (single_value->field_trafficClass.is_omit() || single_value->field_trafficClass.is_value())
 && (single_value->field_maxSDUSize.is_omit() || single_value->field_maxSDUSize.is_value())
 && (single_value->field_maxBitrateUplink.is_omit() || single_value->field_maxBitrateUplink.is_value())
 && (single_value->field_maxBitrateDownlink.is_omit() || single_value->field_maxBitrateDownlink.is_value())
 && (single_value->field_sduErrorRatio.is_omit() || single_value->field_sduErrorRatio.is_value())
 && (single_value->field_residualBER.is_omit() || single_value->field_residualBER.is_value())
 && (single_value->field_trafficHandlingPriority.is_omit() || single_value->field_trafficHandlingPriority.is_value())
 && (single_value->field_transferDelay.is_omit() || single_value->field_transferDelay.is_value())
 && (single_value->field_guaranteedBitRateUplink.is_omit() || single_value->field_guaranteedBitRateUplink.is_value())
 && (single_value->field_guaranteedBitRateDownlink.is_omit() || single_value->field_guaranteedBitRateDownlink.is_value())
 && (single_value->field_sourceStatisticsDescriptor.is_omit() || single_value->field_sourceStatisticsDescriptor.is_value())
 && (single_value->field_signallingIndication.is_omit() || single_value->field_signallingIndication.is_value())
 && (single_value->field_spare4.is_omit() || single_value->field_spare4.is_value())
 && (single_value->field_maxBitrateDownlinkExt.is_omit() || single_value->field_maxBitrateDownlinkExt.is_value())
 && (single_value->field_guaranteedBitRateDownlinkExt.is_omit() || single_value->field_guaranteedBitRateDownlinkExt.is_value())
 && (single_value->field_maxBitrateUplinkExt.is_omit() || single_value->field_maxBitrateUplinkExt.is_value())
 && (single_value->field_guaranteedBitRateUplinkExt.is_omit() || single_value->field_guaranteedBitRateUplinkExt.is_value())
 && (single_value->field_maxBitrateDownlinkExt2.is_omit() || single_value->field_maxBitrateDownlinkExt2.is_value())
 && (single_value->field_guaranteedBitRateDownlinkExt2.is_omit() || single_value->field_guaranteedBitRateDownlinkExt2.is_value())
 && (single_value->field_maxBitrateUplinkExt2.is_omit() || single_value->field_maxBitrateUplinkExt2.is_value())
 && (single_value->field_guaranteedBitRateUplinkExt2.is_omit() || single_value->field_guaranteedBitRateUplinkExt2.is_value());
}

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

QoSV QoSV_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.QoSV.");
QoSV ret_val;
if (single_value->field_reliabilityClass.is_bound()) {
ret_val.reliabilityClass() = single_value->field_reliabilityClass.valueof();
}
if (single_value->field_delayClass.is_bound()) {
ret_val.delayClass() = single_value->field_delayClass.valueof();
}
if (single_value->field_spare1.is_bound()) {
ret_val.spare1() = single_value->field_spare1.valueof();
}
if (single_value->field_precedenceClass.is_bound()) {
ret_val.precedenceClass() = single_value->field_precedenceClass.valueof();
}
if (single_value->field_spare2.is_bound()) {
ret_val.spare2() = single_value->field_spare2.valueof();
}
if (single_value->field_peakThroughput.is_bound()) {
ret_val.peakThroughput() = single_value->field_peakThroughput.valueof();
}
if (single_value->field_meanThroughput.is_bound()) {
ret_val.meanThroughput() = single_value->field_meanThroughput.valueof();
}
if (single_value->field_spare3.is_bound()) {
ret_val.spare3() = single_value->field_spare3.valueof();
}
if (single_value->field_deliverErroneusSDU.is_omit()) ret_val.deliverErroneusSDU() = OMIT_VALUE;
else if (single_value->field_deliverErroneusSDU.is_bound()) {
ret_val.deliverErroneusSDU() = single_value->field_deliverErroneusSDU.valueof();
}
if (single_value->field_deliveryOrder.is_omit()) ret_val.deliveryOrder() = OMIT_VALUE;
else if (single_value->field_deliveryOrder.is_bound()) {
ret_val.deliveryOrder() = single_value->field_deliveryOrder.valueof();
}
if (single_value->field_trafficClass.is_omit()) ret_val.trafficClass() = OMIT_VALUE;
else if (single_value->field_trafficClass.is_bound()) {
ret_val.trafficClass() = single_value->field_trafficClass.valueof();
}
if (single_value->field_maxSDUSize.is_omit()) ret_val.maxSDUSize() = OMIT_VALUE;
else if (single_value->field_maxSDUSize.is_bound()) {
ret_val.maxSDUSize() = single_value->field_maxSDUSize.valueof();
}
if (single_value->field_maxBitrateUplink.is_omit()) ret_val.maxBitrateUplink() = OMIT_VALUE;
else if (single_value->field_maxBitrateUplink.is_bound()) {
ret_val.maxBitrateUplink() = single_value->field_maxBitrateUplink.valueof();
}
if (single_value->field_maxBitrateDownlink.is_omit()) ret_val.maxBitrateDownlink() = OMIT_VALUE;
else if (single_value->field_maxBitrateDownlink.is_bound()) {
ret_val.maxBitrateDownlink() = single_value->field_maxBitrateDownlink.valueof();
}
if (single_value->field_sduErrorRatio.is_omit()) ret_val.sduErrorRatio() = OMIT_VALUE;
else if (single_value->field_sduErrorRatio.is_bound()) {
ret_val.sduErrorRatio() = single_value->field_sduErrorRatio.valueof();
}
if (single_value->field_residualBER.is_omit()) ret_val.residualBER() = OMIT_VALUE;
else if (single_value->field_residualBER.is_bound()) {
ret_val.residualBER() = single_value->field_residualBER.valueof();
}
if (single_value->field_trafficHandlingPriority.is_omit()) ret_val.trafficHandlingPriority() = OMIT_VALUE;
else if (single_value->field_trafficHandlingPriority.is_bound()) {
ret_val.trafficHandlingPriority() = single_value->field_trafficHandlingPriority.valueof();
}
if (single_value->field_transferDelay.is_omit()) ret_val.transferDelay() = OMIT_VALUE;
else if (single_value->field_transferDelay.is_bound()) {
ret_val.transferDelay() = single_value->field_transferDelay.valueof();
}
if (single_value->field_guaranteedBitRateUplink.is_omit()) ret_val.guaranteedBitRateUplink() = OMIT_VALUE;
else if (single_value->field_guaranteedBitRateUplink.is_bound()) {
ret_val.guaranteedBitRateUplink() = single_value->field_guaranteedBitRateUplink.valueof();
}
if (single_value->field_guaranteedBitRateDownlink.is_omit()) ret_val.guaranteedBitRateDownlink() = OMIT_VALUE;
else if (single_value->field_guaranteedBitRateDownlink.is_bound()) {
ret_val.guaranteedBitRateDownlink() = single_value->field_guaranteedBitRateDownlink.valueof();
}
if (single_value->field_sourceStatisticsDescriptor.is_omit()) ret_val.sourceStatisticsDescriptor() = OMIT_VALUE;
else if (single_value->field_sourceStatisticsDescriptor.is_bound()) {
ret_val.sourceStatisticsDescriptor() = single_value->field_sourceStatisticsDescriptor.valueof();
}
if (single_value->field_signallingIndication.is_omit()) ret_val.signallingIndication() = OMIT_VALUE;
else if (single_value->field_signallingIndication.is_bound()) {
ret_val.signallingIndication() = single_value->field_signallingIndication.valueof();
}
if (single_value->field_spare4.is_omit()) ret_val.spare4() = OMIT_VALUE;
else if (single_value->field_spare4.is_bound()) {
ret_val.spare4() = single_value->field_spare4.valueof();
}
if (single_value->field_maxBitrateDownlinkExt.is_omit()) ret_val.maxBitrateDownlinkExt() = OMIT_VALUE;
else if (single_value->field_maxBitrateDownlinkExt.is_bound()) {
ret_val.maxBitrateDownlinkExt() = single_value->field_maxBitrateDownlinkExt.valueof();
}
if (single_value->field_guaranteedBitRateDownlinkExt.is_omit()) ret_val.guaranteedBitRateDownlinkExt() = OMIT_VALUE;
else if (single_value->field_guaranteedBitRateDownlinkExt.is_bound()) {
ret_val.guaranteedBitRateDownlinkExt() = single_value->field_guaranteedBitRateDownlinkExt.valueof();
}
if (single_value->field_maxBitrateUplinkExt.is_omit()) ret_val.maxBitrateUplinkExt() = OMIT_VALUE;
else if (single_value->field_maxBitrateUplinkExt.is_bound()) {
ret_val.maxBitrateUplinkExt() = single_value->field_maxBitrateUplinkExt.valueof();
}
if (single_value->field_guaranteedBitRateUplinkExt.is_omit()) ret_val.guaranteedBitRateUplinkExt() = OMIT_VALUE;
else if (single_value->field_guaranteedBitRateUplinkExt.is_bound()) {
ret_val.guaranteedBitRateUplinkExt() = single_value->field_guaranteedBitRateUplinkExt.valueof();
}
if (single_value->field_maxBitrateDownlinkExt2.is_omit()) ret_val.maxBitrateDownlinkExt2() = OMIT_VALUE;
else if (single_value->field_maxBitrateDownlinkExt2.is_bound()) {
ret_val.maxBitrateDownlinkExt2() = single_value->field_maxBitrateDownlinkExt2.valueof();
}
if (single_value->field_guaranteedBitRateDownlinkExt2.is_omit()) ret_val.guaranteedBitRateDownlinkExt2() = OMIT_VALUE;
else if (single_value->field_guaranteedBitRateDownlinkExt2.is_bound()) {
ret_val.guaranteedBitRateDownlinkExt2() = single_value->field_guaranteedBitRateDownlinkExt2.valueof();
}
if (single_value->field_maxBitrateUplinkExt2.is_omit()) ret_val.maxBitrateUplinkExt2() = OMIT_VALUE;
else if (single_value->field_maxBitrateUplinkExt2.is_bound()) {
ret_val.maxBitrateUplinkExt2() = single_value->field_maxBitrateUplinkExt2.valueof();
}
if (single_value->field_guaranteedBitRateUplinkExt2.is_omit()) ret_val.guaranteedBitRateUplinkExt2() = OMIT_VALUE;
else if (single_value->field_guaranteedBitRateUplinkExt2.is_bound()) {
ret_val.guaranteedBitRateUplinkExt2() = single_value->field_guaranteedBitRateUplinkExt2.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& QoSV_template::reliabilityClass()
{
set_specific();
return single_value->field_reliabilityClass;
}

const BITSTRING_template& QoSV_template::reliabilityClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reliabilityClass of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_reliabilityClass;
}

BITSTRING_template& QoSV_template::delayClass()
{
set_specific();
return single_value->field_delayClass;
}

const BITSTRING_template& QoSV_template::delayClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field delayClass of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_delayClass;
}

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

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

BITSTRING_template& QoSV_template::precedenceClass()
{
set_specific();
return single_value->field_precedenceClass;
}

const BITSTRING_template& QoSV_template::precedenceClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field precedenceClass of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_precedenceClass;
}

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

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

BITSTRING_template& QoSV_template::peakThroughput()
{
set_specific();
return single_value->field_peakThroughput;
}

const BITSTRING_template& QoSV_template::peakThroughput() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field peakThroughput of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_peakThroughput;
}

BITSTRING_template& QoSV_template::meanThroughput()
{
set_specific();
return single_value->field_meanThroughput;
}

const BITSTRING_template& QoSV_template::meanThroughput() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field meanThroughput of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_meanThroughput;
}

BITSTRING_template& QoSV_template::spare3()
{
set_specific();
return single_value->field_spare3;
}

const BITSTRING_template& QoSV_template::spare3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare3 of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_spare3;
}

BITSTRING_template& QoSV_template::deliverErroneusSDU()
{
set_specific();
return single_value->field_deliverErroneusSDU;
}

const BITSTRING_template& QoSV_template::deliverErroneusSDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deliverErroneusSDU of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_deliverErroneusSDU;
}

BITSTRING_template& QoSV_template::deliveryOrder()
{
set_specific();
return single_value->field_deliveryOrder;
}

const BITSTRING_template& QoSV_template::deliveryOrder() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deliveryOrder of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_deliveryOrder;
}

BITSTRING_template& QoSV_template::trafficClass()
{
set_specific();
return single_value->field_trafficClass;
}

const BITSTRING_template& QoSV_template::trafficClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field trafficClass of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_trafficClass;
}

OCTETSTRING_template& QoSV_template::maxSDUSize()
{
set_specific();
return single_value->field_maxSDUSize;
}

const OCTETSTRING_template& QoSV_template::maxSDUSize() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxSDUSize of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_maxSDUSize;
}

OCTETSTRING_template& QoSV_template::maxBitrateUplink()
{
set_specific();
return single_value->field_maxBitrateUplink;
}

const OCTETSTRING_template& QoSV_template::maxBitrateUplink() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxBitrateUplink of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_maxBitrateUplink;
}

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

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

BITSTRING_template& QoSV_template::sduErrorRatio()
{
set_specific();
return single_value->field_sduErrorRatio;
}

const BITSTRING_template& QoSV_template::sduErrorRatio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sduErrorRatio of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_sduErrorRatio;
}

BITSTRING_template& QoSV_template::residualBER()
{
set_specific();
return single_value->field_residualBER;
}

const BITSTRING_template& QoSV_template::residualBER() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field residualBER of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_residualBER;
}

BITSTRING_template& QoSV_template::trafficHandlingPriority()
{
set_specific();
return single_value->field_trafficHandlingPriority;
}

const BITSTRING_template& QoSV_template::trafficHandlingPriority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field trafficHandlingPriority of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_trafficHandlingPriority;
}

BITSTRING_template& QoSV_template::transferDelay()
{
set_specific();
return single_value->field_transferDelay;
}

const BITSTRING_template& QoSV_template::transferDelay() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field transferDelay of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_transferDelay;
}

OCTETSTRING_template& QoSV_template::guaranteedBitRateUplink()
{
set_specific();
return single_value->field_guaranteedBitRateUplink;
}

const OCTETSTRING_template& QoSV_template::guaranteedBitRateUplink() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field guaranteedBitRateUplink of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_guaranteedBitRateUplink;
}

OCTETSTRING_template& QoSV_template::guaranteedBitRateDownlink()
{
set_specific();
return single_value->field_guaranteedBitRateDownlink;
}

const OCTETSTRING_template& QoSV_template::guaranteedBitRateDownlink() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field guaranteedBitRateDownlink of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_guaranteedBitRateDownlink;
}

BITSTRING_template& QoSV_template::sourceStatisticsDescriptor()
{
set_specific();
return single_value->field_sourceStatisticsDescriptor;
}

const BITSTRING_template& QoSV_template::sourceStatisticsDescriptor() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceStatisticsDescriptor of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_sourceStatisticsDescriptor;
}

BITSTRING_template& QoSV_template::signallingIndication()
{
set_specific();
return single_value->field_signallingIndication;
}

const BITSTRING_template& QoSV_template::signallingIndication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field signallingIndication of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_signallingIndication;
}

BITSTRING_template& QoSV_template::spare4()
{
set_specific();
return single_value->field_spare4;
}

const BITSTRING_template& QoSV_template::spare4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare4 of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_spare4;
}

OCTETSTRING_template& QoSV_template::maxBitrateDownlinkExt()
{
set_specific();
return single_value->field_maxBitrateDownlinkExt;
}

const OCTETSTRING_template& QoSV_template::maxBitrateDownlinkExt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxBitrateDownlinkExt of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_maxBitrateDownlinkExt;
}

OCTETSTRING_template& QoSV_template::guaranteedBitRateDownlinkExt()
{
set_specific();
return single_value->field_guaranteedBitRateDownlinkExt;
}

const OCTETSTRING_template& QoSV_template::guaranteedBitRateDownlinkExt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field guaranteedBitRateDownlinkExt of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_guaranteedBitRateDownlinkExt;
}

OCTETSTRING_template& QoSV_template::maxBitrateUplinkExt()
{
set_specific();
return single_value->field_maxBitrateUplinkExt;
}

const OCTETSTRING_template& QoSV_template::maxBitrateUplinkExt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxBitrateUplinkExt of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_maxBitrateUplinkExt;
}

OCTETSTRING_template& QoSV_template::guaranteedBitRateUplinkExt()
{
set_specific();
return single_value->field_guaranteedBitRateUplinkExt;
}

const OCTETSTRING_template& QoSV_template::guaranteedBitRateUplinkExt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field guaranteedBitRateUplinkExt of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_guaranteedBitRateUplinkExt;
}

OCTETSTRING_template& QoSV_template::maxBitrateDownlinkExt2()
{
set_specific();
return single_value->field_maxBitrateDownlinkExt2;
}

const OCTETSTRING_template& QoSV_template::maxBitrateDownlinkExt2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxBitrateDownlinkExt2 of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_maxBitrateDownlinkExt2;
}

OCTETSTRING_template& QoSV_template::guaranteedBitRateDownlinkExt2()
{
set_specific();
return single_value->field_guaranteedBitRateDownlinkExt2;
}

const OCTETSTRING_template& QoSV_template::guaranteedBitRateDownlinkExt2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field guaranteedBitRateDownlinkExt2 of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_guaranteedBitRateDownlinkExt2;
}

OCTETSTRING_template& QoSV_template::maxBitrateUplinkExt2()
{
set_specific();
return single_value->field_maxBitrateUplinkExt2;
}

const OCTETSTRING_template& QoSV_template::maxBitrateUplinkExt2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maxBitrateUplinkExt2 of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_maxBitrateUplinkExt2;
}

OCTETSTRING_template& QoSV_template::guaranteedBitRateUplinkExt2()
{
set_specific();
return single_value->field_guaranteedBitRateUplinkExt2;
}

const OCTETSTRING_template& QoSV_template::guaranteedBitRateUplinkExt2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field guaranteedBitRateUplinkExt2 of a non-specific template of type @MobileL3_GMM_SM_Types.QoSV.");
return single_value->field_guaranteedBitRateUplinkExt2;
}

int QoSV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.QoSV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 8;
      if (single_value->field_deliverErroneusSDU.is_present()) ret_val++;
      if (single_value->field_deliveryOrder.is_present()) ret_val++;
      if (single_value->field_trafficClass.is_present()) ret_val++;
      if (single_value->field_maxSDUSize.is_present()) ret_val++;
      if (single_value->field_maxBitrateUplink.is_present()) ret_val++;
      if (single_value->field_maxBitrateDownlink.is_present()) ret_val++;
      if (single_value->field_sduErrorRatio.is_present()) ret_val++;
      if (single_value->field_residualBER.is_present()) ret_val++;
      if (single_value->field_trafficHandlingPriority.is_present()) ret_val++;
      if (single_value->field_transferDelay.is_present()) ret_val++;
      if (single_value->field_guaranteedBitRateUplink.is_present()) ret_val++;
      if (single_value->field_guaranteedBitRateDownlink.is_present()) ret_val++;
      if (single_value->field_sourceStatisticsDescriptor.is_present()) ret_val++;
      if (single_value->field_signallingIndication.is_present()) ret_val++;
      if (single_value->field_spare4.is_present()) ret_val++;
      if (single_value->field_maxBitrateDownlinkExt.is_present()) ret_val++;
      if (single_value->field_guaranteedBitRateDownlinkExt.is_present()) ret_val++;
      if (single_value->field_maxBitrateUplinkExt.is_present()) ret_val++;
      if (single_value->field_guaranteedBitRateUplinkExt.is_present()) ret_val++;
      if (single_value->field_maxBitrateDownlinkExt2.is_present()) ret_val++;
      if (single_value->field_guaranteedBitRateDownlinkExt2.is_present()) ret_val++;
      if (single_value->field_maxBitrateUplinkExt2.is_present()) ret_val++;
      if (single_value->field_guaranteedBitRateUplinkExt2.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.QoSV 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.QoSV 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.QoSV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.QoSV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.QoSV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.QoSV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.QoSV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.QoSV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.QoSV.");
  }
  return 0;
}

void QoSV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ reliabilityClass := ");
single_value->field_reliabilityClass.log();
TTCN_Logger::log_event_str(", delayClass := ");
single_value->field_delayClass.log();
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log();
TTCN_Logger::log_event_str(", precedenceClass := ");
single_value->field_precedenceClass.log();
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log();
TTCN_Logger::log_event_str(", peakThroughput := ");
single_value->field_peakThroughput.log();
TTCN_Logger::log_event_str(", meanThroughput := ");
single_value->field_meanThroughput.log();
TTCN_Logger::log_event_str(", spare3 := ");
single_value->field_spare3.log();
TTCN_Logger::log_event_str(", deliverErroneusSDU := ");
single_value->field_deliverErroneusSDU.log();
TTCN_Logger::log_event_str(", deliveryOrder := ");
single_value->field_deliveryOrder.log();
TTCN_Logger::log_event_str(", trafficClass := ");
single_value->field_trafficClass.log();
TTCN_Logger::log_event_str(", maxSDUSize := ");
single_value->field_maxSDUSize.log();
TTCN_Logger::log_event_str(", maxBitrateUplink := ");
single_value->field_maxBitrateUplink.log();
TTCN_Logger::log_event_str(", maxBitrateDownlink := ");
single_value->field_maxBitrateDownlink.log();
TTCN_Logger::log_event_str(", sduErrorRatio := ");
single_value->field_sduErrorRatio.log();
TTCN_Logger::log_event_str(", residualBER := ");
single_value->field_residualBER.log();
TTCN_Logger::log_event_str(", trafficHandlingPriority := ");
single_value->field_trafficHandlingPriority.log();
TTCN_Logger::log_event_str(", transferDelay := ");
single_value->field_transferDelay.log();
TTCN_Logger::log_event_str(", guaranteedBitRateUplink := ");
single_value->field_guaranteedBitRateUplink.log();
TTCN_Logger::log_event_str(", guaranteedBitRateDownlink := ");
single_value->field_guaranteedBitRateDownlink.log();
TTCN_Logger::log_event_str(", sourceStatisticsDescriptor := ");
single_value->field_sourceStatisticsDescriptor.log();
TTCN_Logger::log_event_str(", signallingIndication := ");
single_value->field_signallingIndication.log();
TTCN_Logger::log_event_str(", spare4 := ");
single_value->field_spare4.log();
TTCN_Logger::log_event_str(", maxBitrateDownlinkExt := ");
single_value->field_maxBitrateDownlinkExt.log();
TTCN_Logger::log_event_str(", guaranteedBitRateDownlinkExt := ");
single_value->field_guaranteedBitRateDownlinkExt.log();
TTCN_Logger::log_event_str(", maxBitrateUplinkExt := ");
single_value->field_maxBitrateUplinkExt.log();
TTCN_Logger::log_event_str(", guaranteedBitRateUplinkExt := ");
single_value->field_guaranteedBitRateUplinkExt.log();
TTCN_Logger::log_event_str(", maxBitrateDownlinkExt2 := ");
single_value->field_maxBitrateDownlinkExt2.log();
TTCN_Logger::log_event_str(", guaranteedBitRateDownlinkExt2 := ");
single_value->field_guaranteedBitRateDownlinkExt2.log();
TTCN_Logger::log_event_str(", maxBitrateUplinkExt2 := ");
single_value->field_maxBitrateUplinkExt2.log();
TTCN_Logger::log_event_str(", guaranteedBitRateUplinkExt2 := ");
single_value->field_guaranteedBitRateUplinkExt2.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 QoSV_template::log_match(const QoSV& 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_reliabilityClass.match(match_value.reliabilityClass(), legacy)){
TTCN_Logger::log_logmatch_info(".reliabilityClass");
single_value->field_reliabilityClass.log_match(match_value.reliabilityClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_delayClass.match(match_value.delayClass(), legacy)){
TTCN_Logger::log_logmatch_info(".delayClass");
single_value->field_delayClass.log_match(match_value.delayClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare1.match(match_value.spare1(), legacy)){
TTCN_Logger::log_logmatch_info(".spare1");
single_value->field_spare1.log_match(match_value.spare1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_precedenceClass.match(match_value.precedenceClass(), legacy)){
TTCN_Logger::log_logmatch_info(".precedenceClass");
single_value->field_precedenceClass.log_match(match_value.precedenceClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare2.match(match_value.spare2(), legacy)){
TTCN_Logger::log_logmatch_info(".spare2");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_peakThroughput.match(match_value.peakThroughput(), legacy)){
TTCN_Logger::log_logmatch_info(".peakThroughput");
single_value->field_peakThroughput.log_match(match_value.peakThroughput(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_meanThroughput.match(match_value.meanThroughput(), legacy)){
TTCN_Logger::log_logmatch_info(".meanThroughput");
single_value->field_meanThroughput.log_match(match_value.meanThroughput(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare3.match(match_value.spare3(), legacy)){
TTCN_Logger::log_logmatch_info(".spare3");
single_value->field_spare3.log_match(match_value.spare3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.deliverErroneusSDU().ispresent()){
if(!single_value->field_deliverErroneusSDU.match(match_value.deliverErroneusSDU(), legacy)){
TTCN_Logger::log_logmatch_info(".deliverErroneusSDU");
single_value->field_deliverErroneusSDU.log_match(match_value.deliverErroneusSDU(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deliverErroneusSDU.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deliverErroneusSDU := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deliverErroneusSDU.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deliveryOrder().ispresent()){
if(!single_value->field_deliveryOrder.match(match_value.deliveryOrder(), legacy)){
TTCN_Logger::log_logmatch_info(".deliveryOrder");
single_value->field_deliveryOrder.log_match(match_value.deliveryOrder(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deliveryOrder.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deliveryOrder := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deliveryOrder.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.trafficClass().ispresent()){
if(!single_value->field_trafficClass.match(match_value.trafficClass(), legacy)){
TTCN_Logger::log_logmatch_info(".trafficClass");
single_value->field_trafficClass.log_match(match_value.trafficClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_trafficClass.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".trafficClass := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_trafficClass.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.maxSDUSize().ispresent()){
if(!single_value->field_maxSDUSize.match(match_value.maxSDUSize(), legacy)){
TTCN_Logger::log_logmatch_info(".maxSDUSize");
single_value->field_maxSDUSize.log_match(match_value.maxSDUSize(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_maxSDUSize.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxSDUSize := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxSDUSize.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.maxBitrateUplink().ispresent()){
if(!single_value->field_maxBitrateUplink.match(match_value.maxBitrateUplink(), legacy)){
TTCN_Logger::log_logmatch_info(".maxBitrateUplink");
single_value->field_maxBitrateUplink.log_match(match_value.maxBitrateUplink(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_maxBitrateUplink.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxBitrateUplink := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxBitrateUplink.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.maxBitrateDownlink().ispresent()){
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);
}
} else {
if (!single_value->field_maxBitrateDownlink.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxBitrateDownlink := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxBitrateDownlink.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sduErrorRatio().ispresent()){
if(!single_value->field_sduErrorRatio.match(match_value.sduErrorRatio(), legacy)){
TTCN_Logger::log_logmatch_info(".sduErrorRatio");
single_value->field_sduErrorRatio.log_match(match_value.sduErrorRatio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sduErrorRatio.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sduErrorRatio := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sduErrorRatio.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.residualBER().ispresent()){
if(!single_value->field_residualBER.match(match_value.residualBER(), legacy)){
TTCN_Logger::log_logmatch_info(".residualBER");
single_value->field_residualBER.log_match(match_value.residualBER(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_residualBER.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".residualBER := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_residualBER.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.trafficHandlingPriority().ispresent()){
if(!single_value->field_trafficHandlingPriority.match(match_value.trafficHandlingPriority(), legacy)){
TTCN_Logger::log_logmatch_info(".trafficHandlingPriority");
single_value->field_trafficHandlingPriority.log_match(match_value.trafficHandlingPriority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_trafficHandlingPriority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".trafficHandlingPriority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_trafficHandlingPriority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.transferDelay().ispresent()){
if(!single_value->field_transferDelay.match(match_value.transferDelay(), legacy)){
TTCN_Logger::log_logmatch_info(".transferDelay");
single_value->field_transferDelay.log_match(match_value.transferDelay(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_transferDelay.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".transferDelay := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_transferDelay.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.guaranteedBitRateUplink().ispresent()){
if(!single_value->field_guaranteedBitRateUplink.match(match_value.guaranteedBitRateUplink(), legacy)){
TTCN_Logger::log_logmatch_info(".guaranteedBitRateUplink");
single_value->field_guaranteedBitRateUplink.log_match(match_value.guaranteedBitRateUplink(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_guaranteedBitRateUplink.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".guaranteedBitRateUplink := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_guaranteedBitRateUplink.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.guaranteedBitRateDownlink().ispresent()){
if(!single_value->field_guaranteedBitRateDownlink.match(match_value.guaranteedBitRateDownlink(), legacy)){
TTCN_Logger::log_logmatch_info(".guaranteedBitRateDownlink");
single_value->field_guaranteedBitRateDownlink.log_match(match_value.guaranteedBitRateDownlink(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_guaranteedBitRateDownlink.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".guaranteedBitRateDownlink := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_guaranteedBitRateDownlink.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sourceStatisticsDescriptor().ispresent()){
if(!single_value->field_sourceStatisticsDescriptor.match(match_value.sourceStatisticsDescriptor(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceStatisticsDescriptor");
single_value->field_sourceStatisticsDescriptor.log_match(match_value.sourceStatisticsDescriptor(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sourceStatisticsDescriptor.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sourceStatisticsDescriptor := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sourceStatisticsDescriptor.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.signallingIndication().ispresent()){
if(!single_value->field_signallingIndication.match(match_value.signallingIndication(), legacy)){
TTCN_Logger::log_logmatch_info(".signallingIndication");
single_value->field_signallingIndication.log_match(match_value.signallingIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_signallingIndication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".signallingIndication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_signallingIndication.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.spare4().ispresent()){
if(!single_value->field_spare4.match(match_value.spare4(), legacy)){
TTCN_Logger::log_logmatch_info(".spare4");
single_value->field_spare4.log_match(match_value.spare4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_spare4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".spare4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_spare4.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.maxBitrateDownlinkExt().ispresent()){
if(!single_value->field_maxBitrateDownlinkExt.match(match_value.maxBitrateDownlinkExt(), legacy)){
TTCN_Logger::log_logmatch_info(".maxBitrateDownlinkExt");
single_value->field_maxBitrateDownlinkExt.log_match(match_value.maxBitrateDownlinkExt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_maxBitrateDownlinkExt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxBitrateDownlinkExt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxBitrateDownlinkExt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.guaranteedBitRateDownlinkExt().ispresent()){
if(!single_value->field_guaranteedBitRateDownlinkExt.match(match_value.guaranteedBitRateDownlinkExt(), legacy)){
TTCN_Logger::log_logmatch_info(".guaranteedBitRateDownlinkExt");
single_value->field_guaranteedBitRateDownlinkExt.log_match(match_value.guaranteedBitRateDownlinkExt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_guaranteedBitRateDownlinkExt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".guaranteedBitRateDownlinkExt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_guaranteedBitRateDownlinkExt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.maxBitrateUplinkExt().ispresent()){
if(!single_value->field_maxBitrateUplinkExt.match(match_value.maxBitrateUplinkExt(), legacy)){
TTCN_Logger::log_logmatch_info(".maxBitrateUplinkExt");
single_value->field_maxBitrateUplinkExt.log_match(match_value.maxBitrateUplinkExt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_maxBitrateUplinkExt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxBitrateUplinkExt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxBitrateUplinkExt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.guaranteedBitRateUplinkExt().ispresent()){
if(!single_value->field_guaranteedBitRateUplinkExt.match(match_value.guaranteedBitRateUplinkExt(), legacy)){
TTCN_Logger::log_logmatch_info(".guaranteedBitRateUplinkExt");
single_value->field_guaranteedBitRateUplinkExt.log_match(match_value.guaranteedBitRateUplinkExt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_guaranteedBitRateUplinkExt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".guaranteedBitRateUplinkExt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_guaranteedBitRateUplinkExt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.maxBitrateDownlinkExt2().ispresent()){
if(!single_value->field_maxBitrateDownlinkExt2.match(match_value.maxBitrateDownlinkExt2(), legacy)){
TTCN_Logger::log_logmatch_info(".maxBitrateDownlinkExt2");
single_value->field_maxBitrateDownlinkExt2.log_match(match_value.maxBitrateDownlinkExt2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_maxBitrateDownlinkExt2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxBitrateDownlinkExt2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxBitrateDownlinkExt2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.guaranteedBitRateDownlinkExt2().ispresent()){
if(!single_value->field_guaranteedBitRateDownlinkExt2.match(match_value.guaranteedBitRateDownlinkExt2(), legacy)){
TTCN_Logger::log_logmatch_info(".guaranteedBitRateDownlinkExt2");
single_value->field_guaranteedBitRateDownlinkExt2.log_match(match_value.guaranteedBitRateDownlinkExt2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_guaranteedBitRateDownlinkExt2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".guaranteedBitRateDownlinkExt2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_guaranteedBitRateDownlinkExt2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.maxBitrateUplinkExt2().ispresent()){
if(!single_value->field_maxBitrateUplinkExt2.match(match_value.maxBitrateUplinkExt2(), legacy)){
TTCN_Logger::log_logmatch_info(".maxBitrateUplinkExt2");
single_value->field_maxBitrateUplinkExt2.log_match(match_value.maxBitrateUplinkExt2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_maxBitrateUplinkExt2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".maxBitrateUplinkExt2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_maxBitrateUplinkExt2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.guaranteedBitRateUplinkExt2().ispresent()){
if(!single_value->field_guaranteedBitRateUplinkExt2.match(match_value.guaranteedBitRateUplinkExt2(), legacy)){
TTCN_Logger::log_logmatch_info(".guaranteedBitRateUplinkExt2");
single_value->field_guaranteedBitRateUplinkExt2.log_match(match_value.guaranteedBitRateUplinkExt2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_guaranteedBitRateUplinkExt2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".guaranteedBitRateUplinkExt2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_guaranteedBitRateUplinkExt2.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("{ reliabilityClass := ");
single_value->field_reliabilityClass.log_match(match_value.reliabilityClass(), legacy);
TTCN_Logger::log_event_str(", delayClass := ");
single_value->field_delayClass.log_match(match_value.delayClass(), legacy);
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log_match(match_value.spare1(), legacy);
TTCN_Logger::log_event_str(", precedenceClass := ");
single_value->field_precedenceClass.log_match(match_value.precedenceClass(), legacy);
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::log_event_str(", peakThroughput := ");
single_value->field_peakThroughput.log_match(match_value.peakThroughput(), legacy);
TTCN_Logger::log_event_str(", meanThroughput := ");
single_value->field_meanThroughput.log_match(match_value.meanThroughput(), legacy);
TTCN_Logger::log_event_str(", spare3 := ");
single_value->field_spare3.log_match(match_value.spare3(), legacy);
TTCN_Logger::log_event_str(", deliverErroneusSDU := ");
if (match_value.deliverErroneusSDU().ispresent()) {
single_value->field_deliverErroneusSDU.log_match(match_value.deliverErroneusSDU(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deliverErroneusSDU.log();
if (single_value->field_deliverErroneusSDU.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deliveryOrder := ");
if (match_value.deliveryOrder().ispresent()) {
single_value->field_deliveryOrder.log_match(match_value.deliveryOrder(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deliveryOrder.log();
if (single_value->field_deliveryOrder.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", trafficClass := ");
if (match_value.trafficClass().ispresent()) {
single_value->field_trafficClass.log_match(match_value.trafficClass(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_trafficClass.log();
if (single_value->field_trafficClass.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", maxSDUSize := ");
if (match_value.maxSDUSize().ispresent()) {
single_value->field_maxSDUSize.log_match(match_value.maxSDUSize(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxSDUSize.log();
if (single_value->field_maxSDUSize.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", maxBitrateUplink := ");
if (match_value.maxBitrateUplink().ispresent()) {
single_value->field_maxBitrateUplink.log_match(match_value.maxBitrateUplink(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxBitrateUplink.log();
if (single_value->field_maxBitrateUplink.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", maxBitrateDownlink := ");
if (match_value.maxBitrateDownlink().ispresent()) {
single_value->field_maxBitrateDownlink.log_match(match_value.maxBitrateDownlink(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxBitrateDownlink.log();
if (single_value->field_maxBitrateDownlink.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sduErrorRatio := ");
if (match_value.sduErrorRatio().ispresent()) {
single_value->field_sduErrorRatio.log_match(match_value.sduErrorRatio(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sduErrorRatio.log();
if (single_value->field_sduErrorRatio.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", residualBER := ");
if (match_value.residualBER().ispresent()) {
single_value->field_residualBER.log_match(match_value.residualBER(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_residualBER.log();
if (single_value->field_residualBER.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", trafficHandlingPriority := ");
if (match_value.trafficHandlingPriority().ispresent()) {
single_value->field_trafficHandlingPriority.log_match(match_value.trafficHandlingPriority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_trafficHandlingPriority.log();
if (single_value->field_trafficHandlingPriority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", transferDelay := ");
if (match_value.transferDelay().ispresent()) {
single_value->field_transferDelay.log_match(match_value.transferDelay(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_transferDelay.log();
if (single_value->field_transferDelay.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", guaranteedBitRateUplink := ");
if (match_value.guaranteedBitRateUplink().ispresent()) {
single_value->field_guaranteedBitRateUplink.log_match(match_value.guaranteedBitRateUplink(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_guaranteedBitRateUplink.log();
if (single_value->field_guaranteedBitRateUplink.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", guaranteedBitRateDownlink := ");
if (match_value.guaranteedBitRateDownlink().ispresent()) {
single_value->field_guaranteedBitRateDownlink.log_match(match_value.guaranteedBitRateDownlink(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_guaranteedBitRateDownlink.log();
if (single_value->field_guaranteedBitRateDownlink.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sourceStatisticsDescriptor := ");
if (match_value.sourceStatisticsDescriptor().ispresent()) {
single_value->field_sourceStatisticsDescriptor.log_match(match_value.sourceStatisticsDescriptor(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sourceStatisticsDescriptor.log();
if (single_value->field_sourceStatisticsDescriptor.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", signallingIndication := ");
if (match_value.signallingIndication().ispresent()) {
single_value->field_signallingIndication.log_match(match_value.signallingIndication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_signallingIndication.log();
if (single_value->field_signallingIndication.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", spare4 := ");
if (match_value.spare4().ispresent()) {
single_value->field_spare4.log_match(match_value.spare4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_spare4.log();
if (single_value->field_spare4.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", maxBitrateDownlinkExt := ");
if (match_value.maxBitrateDownlinkExt().ispresent()) {
single_value->field_maxBitrateDownlinkExt.log_match(match_value.maxBitrateDownlinkExt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxBitrateDownlinkExt.log();
if (single_value->field_maxBitrateDownlinkExt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", guaranteedBitRateDownlinkExt := ");
if (match_value.guaranteedBitRateDownlinkExt().ispresent()) {
single_value->field_guaranteedBitRateDownlinkExt.log_match(match_value.guaranteedBitRateDownlinkExt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_guaranteedBitRateDownlinkExt.log();
if (single_value->field_guaranteedBitRateDownlinkExt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", maxBitrateUplinkExt := ");
if (match_value.maxBitrateUplinkExt().ispresent()) {
single_value->field_maxBitrateUplinkExt.log_match(match_value.maxBitrateUplinkExt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxBitrateUplinkExt.log();
if (single_value->field_maxBitrateUplinkExt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", guaranteedBitRateUplinkExt := ");
if (match_value.guaranteedBitRateUplinkExt().ispresent()) {
single_value->field_guaranteedBitRateUplinkExt.log_match(match_value.guaranteedBitRateUplinkExt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_guaranteedBitRateUplinkExt.log();
if (single_value->field_guaranteedBitRateUplinkExt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", maxBitrateDownlinkExt2 := ");
if (match_value.maxBitrateDownlinkExt2().ispresent()) {
single_value->field_maxBitrateDownlinkExt2.log_match(match_value.maxBitrateDownlinkExt2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxBitrateDownlinkExt2.log();
if (single_value->field_maxBitrateDownlinkExt2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", guaranteedBitRateDownlinkExt2 := ");
if (match_value.guaranteedBitRateDownlinkExt2().ispresent()) {
single_value->field_guaranteedBitRateDownlinkExt2.log_match(match_value.guaranteedBitRateDownlinkExt2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_guaranteedBitRateDownlinkExt2.log();
if (single_value->field_guaranteedBitRateDownlinkExt2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", maxBitrateUplinkExt2 := ");
if (match_value.maxBitrateUplinkExt2().ispresent()) {
single_value->field_maxBitrateUplinkExt2.log_match(match_value.maxBitrateUplinkExt2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_maxBitrateUplinkExt2.log();
if (single_value->field_maxBitrateUplinkExt2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", guaranteedBitRateUplinkExt2 := ");
if (match_value.guaranteedBitRateUplinkExt2().ispresent()) {
single_value->field_guaranteedBitRateUplinkExt2.log_match(match_value.guaranteedBitRateUplinkExt2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_guaranteedBitRateUplinkExt2.log();
if (single_value->field_guaranteedBitRateUplinkExt2.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 QoSV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_reliabilityClass.encode_text(text_buf);
single_value->field_delayClass.encode_text(text_buf);
single_value->field_spare1.encode_text(text_buf);
single_value->field_precedenceClass.encode_text(text_buf);
single_value->field_spare2.encode_text(text_buf);
single_value->field_peakThroughput.encode_text(text_buf);
single_value->field_meanThroughput.encode_text(text_buf);
single_value->field_spare3.encode_text(text_buf);
single_value->field_deliverErroneusSDU.encode_text(text_buf);
single_value->field_deliveryOrder.encode_text(text_buf);
single_value->field_trafficClass.encode_text(text_buf);
single_value->field_maxSDUSize.encode_text(text_buf);
single_value->field_maxBitrateUplink.encode_text(text_buf);
single_value->field_maxBitrateDownlink.encode_text(text_buf);
single_value->field_sduErrorRatio.encode_text(text_buf);
single_value->field_residualBER.encode_text(text_buf);
single_value->field_trafficHandlingPriority.encode_text(text_buf);
single_value->field_transferDelay.encode_text(text_buf);
single_value->field_guaranteedBitRateUplink.encode_text(text_buf);
single_value->field_guaranteedBitRateDownlink.encode_text(text_buf);
single_value->field_sourceStatisticsDescriptor.encode_text(text_buf);
single_value->field_signallingIndication.encode_text(text_buf);
single_value->field_spare4.encode_text(text_buf);
single_value->field_maxBitrateDownlinkExt.encode_text(text_buf);
single_value->field_guaranteedBitRateDownlinkExt.encode_text(text_buf);
single_value->field_maxBitrateUplinkExt.encode_text(text_buf);
single_value->field_guaranteedBitRateUplinkExt.encode_text(text_buf);
single_value->field_maxBitrateDownlinkExt2.encode_text(text_buf);
single_value->field_guaranteedBitRateDownlinkExt2.encode_text(text_buf);
single_value->field_maxBitrateUplinkExt2.encode_text(text_buf);
single_value->field_guaranteedBitRateUplinkExt2.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.QoSV.");
}
}

void QoSV_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_reliabilityClass.decode_text(text_buf);
single_value->field_delayClass.decode_text(text_buf);
single_value->field_spare1.decode_text(text_buf);
single_value->field_precedenceClass.decode_text(text_buf);
single_value->field_spare2.decode_text(text_buf);
single_value->field_peakThroughput.decode_text(text_buf);
single_value->field_meanThroughput.decode_text(text_buf);
single_value->field_spare3.decode_text(text_buf);
single_value->field_deliverErroneusSDU.decode_text(text_buf);
single_value->field_deliveryOrder.decode_text(text_buf);
single_value->field_trafficClass.decode_text(text_buf);
single_value->field_maxSDUSize.decode_text(text_buf);
single_value->field_maxBitrateUplink.decode_text(text_buf);
single_value->field_maxBitrateDownlink.decode_text(text_buf);
single_value->field_sduErrorRatio.decode_text(text_buf);
single_value->field_residualBER.decode_text(text_buf);
single_value->field_trafficHandlingPriority.decode_text(text_buf);
single_value->field_transferDelay.decode_text(text_buf);
single_value->field_guaranteedBitRateUplink.decode_text(text_buf);
single_value->field_guaranteedBitRateDownlink.decode_text(text_buf);
single_value->field_sourceStatisticsDescriptor.decode_text(text_buf);
single_value->field_signallingIndication.decode_text(text_buf);
single_value->field_spare4.decode_text(text_buf);
single_value->field_maxBitrateDownlinkExt.decode_text(text_buf);
single_value->field_guaranteedBitRateDownlinkExt.decode_text(text_buf);
single_value->field_maxBitrateUplinkExt.decode_text(text_buf);
single_value->field_guaranteedBitRateUplinkExt.decode_text(text_buf);
single_value->field_maxBitrateDownlinkExt2.decode_text(text_buf);
single_value->field_guaranteedBitRateDownlinkExt2.decode_text(text_buf);
single_value->field_maxBitrateUplinkExt2.decode_text(text_buf);
single_value->field_guaranteedBitRateUplinkExt2.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 QoSV_template[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.QoSV.");
}
}

void QoSV_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: {
    QoSV_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 (31<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.QoSV has 31 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) reliabilityClass().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) delayClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) precedenceClass().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) peakThroughput().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) meanThroughput().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) deliverErroneusSDU().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) deliveryOrder().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) trafficClass().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) maxSDUSize().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) maxBitrateUplink().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlink().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) sduErrorRatio().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) residualBER().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) trafficHandlingPriority().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) transferDelay().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateUplink().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateDownlink().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) sourceStatisticsDescriptor().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) signallingIndication().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) spare4().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlinkExt().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateDownlinkExt().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) maxBitrateUplinkExt().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateUplinkExt().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) maxBitrateDownlinkExt2().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateDownlinkExt2().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) maxBitrateUplinkExt2().set_param(*param.get_elem(29));
    if (param.get_size()>30 && param.get_elem(30)->get_type()!=Module_Param::MP_NotUsed) guaranteedBitRateUplinkExt2().set_param(*param.get_elem(30));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reliabilityClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reliabilityClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "delayClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          delayClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "precedenceClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          precedenceClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "peakThroughput")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peakThroughput().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meanThroughput")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meanThroughput().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deliverErroneusSDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deliverErroneusSDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deliveryOrder")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deliveryOrder().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trafficClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trafficClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxSDUSize")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxSDUSize().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateUplink")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateUplink().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "sduErrorRatio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sduErrorRatio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "residualBER")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          residualBER().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trafficHandlingPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trafficHandlingPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "transferDelay")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          transferDelay().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateUplink")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateUplink().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateDownlink")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateDownlink().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceStatisticsDescriptor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceStatisticsDescriptor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "signallingIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          signallingIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateDownlinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateDownlinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateDownlinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateDownlinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateUplinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateUplinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateUplinkExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateUplinkExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateDownlinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateDownlinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateDownlinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateDownlinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maxBitrateUplinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maxBitrateUplinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "guaranteedBitRateUplinkExt2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          guaranteedBitRateUplinkExt2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.QoSV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    QoSV_template* precondition = new QoSV_template;
    precondition->set_param(*param.get_elem(0));
    QoSV_template* implied_template = new QoSV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = QoSV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.QoSV");
  }
  is_ifpresent = param.get_ifpresent();
}

void QoSV_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_reliabilityClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_delayClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_precedenceClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_peakThroughput.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_meanThroughput.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_spare3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_deliverErroneusSDU.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_deliveryOrder.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_trafficClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_maxSDUSize.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_maxBitrateUplink.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_maxBitrateDownlink.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_sduErrorRatio.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_residualBER.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_trafficHandlingPriority.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_transferDelay.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_guaranteedBitRateUplink.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_guaranteedBitRateDownlink.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_sourceStatisticsDescriptor.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_signallingIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_spare4.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_maxBitrateDownlinkExt.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_guaranteedBitRateDownlinkExt.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_maxBitrateUplinkExt.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_guaranteedBitRateUplinkExt.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_maxBitrateDownlinkExt2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_guaranteedBitRateDownlinkExt2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_maxBitrateUplinkExt2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
single_value->field_guaranteedBitRateUplinkExt2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSV");
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.QoSV");
}

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

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

QoSLV::QoSLV()
{
}

QoSLV::QoSLV(const INTEGER& par_lengthIndicator,
    const QoSV& par_qoSV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_qoSV(par_qoSV)
{
}

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

void QoSLV::clean_up()
{
field_lengthIndicator.clean_up();
field_qoSV.clean_up();
}

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

boolean QoSLV::operator==(const QoSLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_qoSV==other_value.field_qoSV;
}

boolean QoSLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_qoSV.is_bound());
}
boolean QoSLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_qoSV.is_value();
}
void QoSLV::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(", qoSV := ");
field_qoSV.log();
TTCN_Logger::log_event_str(" }");
}

void QoSLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (qoSV().is_bound()) qoSV().set_implicit_omit();
}

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

void QoSLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_qoSV.encode_text(text_buf);
}

void QoSLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_qoSV.decode_text(text_buf);
}

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

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

int QoSLV::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, QoSLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(QoSLV_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(QoSLV_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, QoSV_descr_.raw->forceomit);
  decoded_field_length = field_qoSV.RAW_decode(QoSV_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 QoSLV::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, QoSLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, QoSV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &QoSLV_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_qoSV.RAW_encode(QoSV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct QoSLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
QoSV_template field_qoSV;
};

void QoSLV_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_qoSV = ANY_VALUE;
}
}
}

void QoSLV_template::copy_value(const QoSLV& 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.qoSV().is_bound()) {
  single_value->field_qoSV = other_value.qoSV();
} else {
  single_value->field_qoSV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void QoSLV_template::copy_template(const QoSLV_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.qoSV().get_selection()) {
single_value->field_qoSV = other_value.qoSV();
} else {
single_value->field_qoSV.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 QoSLV_template[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 QoSLV_template(*other_value.implication_.precondition);
implication_.implied_template = new QoSLV_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.QoSLV.");
break;
}
set_selection(other_value);
}

QoSLV_template::QoSLV_template()
{
}

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

QoSLV_template::QoSLV_template(const QoSLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean QoSLV_template::match(const QoSLV& 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.qoSV().is_bound()) return FALSE;
if(!single_value->field_qoSV.match(other_value.qoSV(), 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.QoSLV.");
}
return FALSE;
}

boolean QoSLV_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_qoSV.is_bound();
}

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

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

QoSLV QoSLV_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.QoSLV.");
QoSLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_qoSV.is_bound()) {
ret_val.qoSV() = single_value->field_qoSV.valueof();
}
return ret_val;
}

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

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

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

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

QoSV_template& QoSLV_template::qoSV()
{
set_specific();
return single_value->field_qoSV;
}

const QoSV_template& QoSLV_template::qoSV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field qoSV of a non-specific template of type @MobileL3_GMM_SM_Types.QoSLV.");
return single_value->field_qoSV;
}

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

void QoSLV_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(", qoSV := ");
single_value->field_qoSV.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 QoSLV_template::log_match(const QoSLV& 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_qoSV.match(match_value.qoSV(), legacy)){
TTCN_Logger::log_logmatch_info(".qoSV");
single_value->field_qoSV.log_match(match_value.qoSV(), 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(", qoSV := ");
single_value->field_qoSV.log_match(match_value.qoSV(), 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 QoSLV_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_qoSV.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.QoSLV.");
}
}

void QoSLV_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_qoSV.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 QoSLV_template[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.QoSLV.");
}
}

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

void QoSLV_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.QoSLV");
single_value->field_qoSV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSLV");
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.QoSLV");
}

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

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

QoSTLV::QoSTLV()
{
}

QoSTLV::QoSTLV(const OCTETSTRING& par_elementIdentifier,
    const QoSLV& par_qoSLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_qoSLV(par_qoSLV)
{
}

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

void QoSTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_qoSLV.clean_up();
}

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

boolean QoSTLV::operator==(const QoSTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_qoSLV==other_value.field_qoSLV;
}

boolean QoSTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_qoSLV.is_bound());
}
boolean QoSTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_qoSLV.is_value();
}
void QoSTLV::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(", qoSLV := ");
field_qoSLV.log();
TTCN_Logger::log_event_str(" }");
}

void QoSTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (qoSLV().is_bound()) qoSLV().set_implicit_omit();
}

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

void QoSTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_qoSLV.encode_text(text_buf);
}

void QoSTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_qoSLV.decode_text(text_buf);
}

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

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

int QoSTLV::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, QoSLV_descr_.raw->forceomit);
  decoded_field_length = field_qoSLV.RAW_decode(QoSLV_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_15) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct QoSTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
QoSLV_template field_qoSLV;
};

void QoSTLV_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_qoSLV = ANY_VALUE;
}
}
}

void QoSTLV_template::copy_value(const QoSTLV& 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.qoSLV().is_bound()) {
  single_value->field_qoSLV = other_value.qoSLV();
} else {
  single_value->field_qoSLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void QoSTLV_template::copy_template(const QoSTLV_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.qoSLV().get_selection()) {
single_value->field_qoSLV = other_value.qoSLV();
} else {
single_value->field_qoSLV.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 QoSTLV_template[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 QoSTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new QoSTLV_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.QoSTLV.");
break;
}
set_selection(other_value);
}

QoSTLV_template::QoSTLV_template()
{
}

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

QoSTLV_template::QoSTLV_template(const QoSTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean QoSTLV_template::match(const QoSTLV& 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.qoSLV().is_bound()) return FALSE;
if(!single_value->field_qoSLV.match(other_value.qoSLV(), 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.QoSTLV.");
}
return FALSE;
}

boolean QoSTLV_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_qoSLV.is_bound();
}

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

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

QoSTLV QoSTLV_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.QoSTLV.");
QoSTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_qoSLV.is_bound()) {
ret_val.qoSLV() = single_value->field_qoSLV.valueof();
}
return ret_val;
}

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

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

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

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

QoSLV_template& QoSTLV_template::qoSLV()
{
set_specific();
return single_value->field_qoSLV;
}

const QoSLV_template& QoSTLV_template::qoSLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field qoSLV of a non-specific template of type @MobileL3_GMM_SM_Types.QoSTLV.");
return single_value->field_qoSLV;
}

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

void QoSTLV_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(", qoSLV := ");
single_value->field_qoSLV.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 QoSTLV_template::log_match(const QoSTLV& 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_qoSLV.match(match_value.qoSLV(), legacy)){
TTCN_Logger::log_logmatch_info(".qoSLV");
single_value->field_qoSLV.log_match(match_value.qoSLV(), 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(", qoSLV := ");
single_value->field_qoSLV.log_match(match_value.qoSLV(), 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 QoSTLV_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_qoSLV.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.QoSTLV.");
}
}

void QoSTLV_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_qoSLV.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 QoSTLV_template[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.QoSTLV.");
}
}

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

void QoSTLV_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.QoSTLV");
single_value->field_qoSLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.QoSTLV");
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.QoSTLV");
}

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

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

ReAttemptIndicatorV::ReAttemptIndicatorV()
{
}

ReAttemptIndicatorV::ReAttemptIndicatorV(const BITSTRING& par_rATCValue,
    const BITSTRING& par_ePLMNCValue,
    const BITSTRING& par_spare)
  :   field_rATCValue(par_rATCValue),
  field_ePLMNCValue(par_ePLMNCValue),
  field_spare(par_spare)
{
}

ReAttemptIndicatorV::ReAttemptIndicatorV(const ReAttemptIndicatorV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ReAttemptIndicatorV.");
if (other_value.rATCValue().is_bound()) field_rATCValue = other_value.rATCValue();
else field_rATCValue.clean_up();
if (other_value.ePLMNCValue().is_bound()) field_ePLMNCValue = other_value.ePLMNCValue();
else field_ePLMNCValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void ReAttemptIndicatorV::clean_up()
{
field_rATCValue.clean_up();
field_ePLMNCValue.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* ReAttemptIndicatorV::get_descriptor() const { return &ReAttemptIndicatorV_descr_; }
ReAttemptIndicatorV& ReAttemptIndicatorV::operator=(const ReAttemptIndicatorV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ReAttemptIndicatorV.");
  if (other_value.rATCValue().is_bound()) field_rATCValue = other_value.rATCValue();
  else field_rATCValue.clean_up();
  if (other_value.ePLMNCValue().is_bound()) field_ePLMNCValue = other_value.ePLMNCValue();
  else field_ePLMNCValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean ReAttemptIndicatorV::operator==(const ReAttemptIndicatorV& other_value) const
{
return field_rATCValue==other_value.field_rATCValue
  && field_ePLMNCValue==other_value.field_ePLMNCValue
  && field_spare==other_value.field_spare;
}

boolean ReAttemptIndicatorV::is_bound() const
{
return (field_rATCValue.is_bound())
  || (field_ePLMNCValue.is_bound())
  || (field_spare.is_bound());
}
boolean ReAttemptIndicatorV::is_value() const
{
return field_rATCValue.is_value()
  && field_ePLMNCValue.is_value()
  && field_spare.is_value();
}
void ReAttemptIndicatorV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rATCValue := ");
field_rATCValue.log();
TTCN_Logger::log_event_str(", ePLMNCValue := ");
field_ePLMNCValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void ReAttemptIndicatorV::set_implicit_omit()
{
if (rATCValue().is_bound()) rATCValue().set_implicit_omit();
if (ePLMNCValue().is_bound()) ePLMNCValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void ReAttemptIndicatorV::encode_text(Text_Buf& text_buf) const
{
field_rATCValue.encode_text(text_buf);
field_ePLMNCValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void ReAttemptIndicatorV::decode_text(Text_Buf& text_buf)
{
field_rATCValue.decode_text(text_buf);
field_ePLMNCValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int ReAttemptIndicatorV::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_rATCValue.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_ePLMNCValue.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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ReAttemptIndicatorV::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::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::BIT6_descr_.raw);
  encoded_length += field_rATCValue.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ePLMNCValue.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct ReAttemptIndicatorV_template::single_value_struct {
BITSTRING_template field_rATCValue;
BITSTRING_template field_ePLMNCValue;
BITSTRING_template field_spare;
};

void ReAttemptIndicatorV_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_rATCValue = ANY_VALUE;
single_value->field_ePLMNCValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void ReAttemptIndicatorV_template::copy_value(const ReAttemptIndicatorV& other_value)
{
single_value = new single_value_struct;
if (other_value.rATCValue().is_bound()) {
  single_value->field_rATCValue = other_value.rATCValue();
} else {
  single_value->field_rATCValue.clean_up();
}
if (other_value.ePLMNCValue().is_bound()) {
  single_value->field_ePLMNCValue = other_value.ePLMNCValue();
} else {
  single_value->field_ePLMNCValue.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 ReAttemptIndicatorV_template::copy_template(const ReAttemptIndicatorV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rATCValue().get_selection()) {
single_value->field_rATCValue = other_value.rATCValue();
} else {
single_value->field_rATCValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ePLMNCValue().get_selection()) {
single_value->field_ePLMNCValue = other_value.ePLMNCValue();
} else {
single_value->field_ePLMNCValue.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 ReAttemptIndicatorV_template[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 ReAttemptIndicatorV_template(*other_value.implication_.precondition);
implication_.implied_template = new ReAttemptIndicatorV_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.ReAttemptIndicatorV.");
break;
}
set_selection(other_value);
}

ReAttemptIndicatorV_template::ReAttemptIndicatorV_template()
{
}

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

ReAttemptIndicatorV_template::ReAttemptIndicatorV_template(const ReAttemptIndicatorV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ReAttemptIndicatorV_template::match(const ReAttemptIndicatorV& 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.rATCValue().is_bound()) return FALSE;
if(!single_value->field_rATCValue.match(other_value.rATCValue(), legacy))return FALSE;
if(!other_value.ePLMNCValue().is_bound()) return FALSE;
if(!single_value->field_ePLMNCValue.match(other_value.ePLMNCValue(), 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.ReAttemptIndicatorV.");
}
return FALSE;
}

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

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

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

ReAttemptIndicatorV ReAttemptIndicatorV_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.ReAttemptIndicatorV.");
ReAttemptIndicatorV ret_val;
if (single_value->field_rATCValue.is_bound()) {
ret_val.rATCValue() = single_value->field_rATCValue.valueof();
}
if (single_value->field_ePLMNCValue.is_bound()) {
ret_val.ePLMNCValue() = single_value->field_ePLMNCValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& ReAttemptIndicatorV_template::rATCValue()
{
set_specific();
return single_value->field_rATCValue;
}

const BITSTRING_template& ReAttemptIndicatorV_template::rATCValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rATCValue of a non-specific template of type @MobileL3_GMM_SM_Types.ReAttemptIndicatorV.");
return single_value->field_rATCValue;
}

BITSTRING_template& ReAttemptIndicatorV_template::ePLMNCValue()
{
set_specific();
return single_value->field_ePLMNCValue;
}

const BITSTRING_template& ReAttemptIndicatorV_template::ePLMNCValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ePLMNCValue of a non-specific template of type @MobileL3_GMM_SM_Types.ReAttemptIndicatorV.");
return single_value->field_ePLMNCValue;
}

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

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

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

void ReAttemptIndicatorV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rATCValue := ");
single_value->field_rATCValue.log();
TTCN_Logger::log_event_str(", ePLMNCValue := ");
single_value->field_ePLMNCValue.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 ReAttemptIndicatorV_template::log_match(const ReAttemptIndicatorV& 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_rATCValue.match(match_value.rATCValue(), legacy)){
TTCN_Logger::log_logmatch_info(".rATCValue");
single_value->field_rATCValue.log_match(match_value.rATCValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ePLMNCValue.match(match_value.ePLMNCValue(), legacy)){
TTCN_Logger::log_logmatch_info(".ePLMNCValue");
single_value->field_ePLMNCValue.log_match(match_value.ePLMNCValue(), 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("{ rATCValue := ");
single_value->field_rATCValue.log_match(match_value.rATCValue(), legacy);
TTCN_Logger::log_event_str(", ePLMNCValue := ");
single_value->field_ePLMNCValue.log_match(match_value.ePLMNCValue(), 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 ReAttemptIndicatorV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rATCValue.encode_text(text_buf);
single_value->field_ePLMNCValue.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.ReAttemptIndicatorV.");
}
}

void ReAttemptIndicatorV_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_rATCValue.decode_text(text_buf);
single_value->field_ePLMNCValue.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 ReAttemptIndicatorV_template[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.ReAttemptIndicatorV.");
}
}

void ReAttemptIndicatorV_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: {
    ReAttemptIndicatorV_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.ReAttemptIndicatorV 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) rATCValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ePLMNCValue().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(), "rATCValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rATCValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ePLMNCValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ePLMNCValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.ReAttemptIndicatorV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ReAttemptIndicatorV_template* precondition = new ReAttemptIndicatorV_template;
    precondition->set_param(*param.get_elem(0));
    ReAttemptIndicatorV_template* implied_template = new ReAttemptIndicatorV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ReAttemptIndicatorV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ReAttemptIndicatorV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ReAttemptIndicatorV_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_rATCValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ReAttemptIndicatorV");
single_value->field_ePLMNCValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ReAttemptIndicatorV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ReAttemptIndicatorV");
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.ReAttemptIndicatorV");
}

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

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

ReAttemptIndicatorLV::ReAttemptIndicatorLV()
{
}

ReAttemptIndicatorLV::ReAttemptIndicatorLV(const INTEGER& par_lengthIndicator,
    const ReAttemptIndicatorV& par_reAttemptIndicatorV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_reAttemptIndicatorV(par_reAttemptIndicatorV)
{
}

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

void ReAttemptIndicatorLV::clean_up()
{
field_lengthIndicator.clean_up();
field_reAttemptIndicatorV.clean_up();
}

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

boolean ReAttemptIndicatorLV::operator==(const ReAttemptIndicatorLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_reAttemptIndicatorV==other_value.field_reAttemptIndicatorV;
}

boolean ReAttemptIndicatorLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_reAttemptIndicatorV.is_bound());
}
boolean ReAttemptIndicatorLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_reAttemptIndicatorV.is_value();
}
void ReAttemptIndicatorLV::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(", reAttemptIndicatorV := ");
field_reAttemptIndicatorV.log();
TTCN_Logger::log_event_str(" }");
}

void ReAttemptIndicatorLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (reAttemptIndicatorV().is_bound()) reAttemptIndicatorV().set_implicit_omit();
}

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

void ReAttemptIndicatorLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_reAttemptIndicatorV.encode_text(text_buf);
}

void ReAttemptIndicatorLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_reAttemptIndicatorV.decode_text(text_buf);
}

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

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

int ReAttemptIndicatorLV::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, ReAttemptIndicatorLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(ReAttemptIndicatorLV_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(ReAttemptIndicatorLV_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, ReAttemptIndicatorV_descr_.raw->forceomit);
  decoded_field_length = field_reAttemptIndicatorV.RAW_decode(ReAttemptIndicatorV_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 ReAttemptIndicatorLV::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, ReAttemptIndicatorLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ReAttemptIndicatorV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &ReAttemptIndicatorLV_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_reAttemptIndicatorV.RAW_encode(ReAttemptIndicatorV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct ReAttemptIndicatorLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
ReAttemptIndicatorV_template field_reAttemptIndicatorV;
};

void ReAttemptIndicatorLV_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_reAttemptIndicatorV = ANY_VALUE;
}
}
}

void ReAttemptIndicatorLV_template::copy_value(const ReAttemptIndicatorLV& 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.reAttemptIndicatorV().is_bound()) {
  single_value->field_reAttemptIndicatorV = other_value.reAttemptIndicatorV();
} else {
  single_value->field_reAttemptIndicatorV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ReAttemptIndicatorLV_template::copy_template(const ReAttemptIndicatorLV_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.reAttemptIndicatorV().get_selection()) {
single_value->field_reAttemptIndicatorV = other_value.reAttemptIndicatorV();
} else {
single_value->field_reAttemptIndicatorV.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 ReAttemptIndicatorLV_template[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 ReAttemptIndicatorLV_template(*other_value.implication_.precondition);
implication_.implied_template = new ReAttemptIndicatorLV_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.ReAttemptIndicatorLV.");
break;
}
set_selection(other_value);
}

ReAttemptIndicatorLV_template::ReAttemptIndicatorLV_template()
{
}

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

ReAttemptIndicatorLV_template::ReAttemptIndicatorLV_template(const ReAttemptIndicatorLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ReAttemptIndicatorLV_template::match(const ReAttemptIndicatorLV& 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.reAttemptIndicatorV().is_bound()) return FALSE;
if(!single_value->field_reAttemptIndicatorV.match(other_value.reAttemptIndicatorV(), 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.ReAttemptIndicatorLV.");
}
return FALSE;
}

boolean ReAttemptIndicatorLV_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_reAttemptIndicatorV.is_bound();
}

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

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

ReAttemptIndicatorLV ReAttemptIndicatorLV_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.ReAttemptIndicatorLV.");
ReAttemptIndicatorLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_reAttemptIndicatorV.is_bound()) {
ret_val.reAttemptIndicatorV() = single_value->field_reAttemptIndicatorV.valueof();
}
return ret_val;
}

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

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

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

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

ReAttemptIndicatorV_template& ReAttemptIndicatorLV_template::reAttemptIndicatorV()
{
set_specific();
return single_value->field_reAttemptIndicatorV;
}

const ReAttemptIndicatorV_template& ReAttemptIndicatorLV_template::reAttemptIndicatorV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reAttemptIndicatorV of a non-specific template of type @MobileL3_GMM_SM_Types.ReAttemptIndicatorLV.");
return single_value->field_reAttemptIndicatorV;
}

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

void ReAttemptIndicatorLV_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(", reAttemptIndicatorV := ");
single_value->field_reAttemptIndicatorV.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 ReAttemptIndicatorLV_template::log_match(const ReAttemptIndicatorLV& 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_reAttemptIndicatorV.match(match_value.reAttemptIndicatorV(), legacy)){
TTCN_Logger::log_logmatch_info(".reAttemptIndicatorV");
single_value->field_reAttemptIndicatorV.log_match(match_value.reAttemptIndicatorV(), 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(", reAttemptIndicatorV := ");
single_value->field_reAttemptIndicatorV.log_match(match_value.reAttemptIndicatorV(), 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 ReAttemptIndicatorLV_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_reAttemptIndicatorV.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.ReAttemptIndicatorLV.");
}
}

void ReAttemptIndicatorLV_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_reAttemptIndicatorV.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 ReAttemptIndicatorLV_template[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.ReAttemptIndicatorLV.");
}
}

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

void ReAttemptIndicatorLV_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.ReAttemptIndicatorLV");
single_value->field_reAttemptIndicatorV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ReAttemptIndicatorLV");
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.ReAttemptIndicatorLV");
}

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

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

ReAttemptIndicatorTLV::ReAttemptIndicatorTLV()
{
}

ReAttemptIndicatorTLV::ReAttemptIndicatorTLV(const OCTETSTRING& par_elementIdentifier,
    const ReAttemptIndicatorLV& par_reAttemptIndicatorLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_reAttemptIndicatorLV(par_reAttemptIndicatorLV)
{
}

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

void ReAttemptIndicatorTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_reAttemptIndicatorLV.clean_up();
}

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

boolean ReAttemptIndicatorTLV::operator==(const ReAttemptIndicatorTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_reAttemptIndicatorLV==other_value.field_reAttemptIndicatorLV;
}

boolean ReAttemptIndicatorTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_reAttemptIndicatorLV.is_bound());
}
boolean ReAttemptIndicatorTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_reAttemptIndicatorLV.is_value();
}
void ReAttemptIndicatorTLV::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(", reAttemptIndicatorLV := ");
field_reAttemptIndicatorLV.log();
TTCN_Logger::log_event_str(" }");
}

void ReAttemptIndicatorTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (reAttemptIndicatorLV().is_bound()) reAttemptIndicatorLV().set_implicit_omit();
}

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

void ReAttemptIndicatorTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_reAttemptIndicatorLV.encode_text(text_buf);
}

void ReAttemptIndicatorTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_reAttemptIndicatorLV.decode_text(text_buf);
}

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

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

int ReAttemptIndicatorTLV::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, ReAttemptIndicatorLV_descr_.raw->forceomit);
  decoded_field_length = field_reAttemptIndicatorLV.RAW_decode(ReAttemptIndicatorLV_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_16) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct ReAttemptIndicatorTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
ReAttemptIndicatorLV_template field_reAttemptIndicatorLV;
};

void ReAttemptIndicatorTLV_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_reAttemptIndicatorLV = ANY_VALUE;
}
}
}

void ReAttemptIndicatorTLV_template::copy_value(const ReAttemptIndicatorTLV& 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.reAttemptIndicatorLV().is_bound()) {
  single_value->field_reAttemptIndicatorLV = other_value.reAttemptIndicatorLV();
} else {
  single_value->field_reAttemptIndicatorLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ReAttemptIndicatorTLV_template::copy_template(const ReAttemptIndicatorTLV_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.reAttemptIndicatorLV().get_selection()) {
single_value->field_reAttemptIndicatorLV = other_value.reAttemptIndicatorLV();
} else {
single_value->field_reAttemptIndicatorLV.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 ReAttemptIndicatorTLV_template[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 ReAttemptIndicatorTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new ReAttemptIndicatorTLV_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.ReAttemptIndicatorTLV.");
break;
}
set_selection(other_value);
}

ReAttemptIndicatorTLV_template::ReAttemptIndicatorTLV_template()
{
}

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

ReAttemptIndicatorTLV_template::ReAttemptIndicatorTLV_template(const ReAttemptIndicatorTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ReAttemptIndicatorTLV_template::match(const ReAttemptIndicatorTLV& 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.reAttemptIndicatorLV().is_bound()) return FALSE;
if(!single_value->field_reAttemptIndicatorLV.match(other_value.reAttemptIndicatorLV(), 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.ReAttemptIndicatorTLV.");
}
return FALSE;
}

boolean ReAttemptIndicatorTLV_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_reAttemptIndicatorLV.is_bound();
}

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

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

ReAttemptIndicatorTLV ReAttemptIndicatorTLV_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.ReAttemptIndicatorTLV.");
ReAttemptIndicatorTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_reAttemptIndicatorLV.is_bound()) {
ret_val.reAttemptIndicatorLV() = single_value->field_reAttemptIndicatorLV.valueof();
}
return ret_val;
}

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

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

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

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

ReAttemptIndicatorLV_template& ReAttemptIndicatorTLV_template::reAttemptIndicatorLV()
{
set_specific();
return single_value->field_reAttemptIndicatorLV;
}

const ReAttemptIndicatorLV_template& ReAttemptIndicatorTLV_template::reAttemptIndicatorLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reAttemptIndicatorLV of a non-specific template of type @MobileL3_GMM_SM_Types.ReAttemptIndicatorTLV.");
return single_value->field_reAttemptIndicatorLV;
}

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

void ReAttemptIndicatorTLV_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(", reAttemptIndicatorLV := ");
single_value->field_reAttemptIndicatorLV.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 ReAttemptIndicatorTLV_template::log_match(const ReAttemptIndicatorTLV& 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_reAttemptIndicatorLV.match(match_value.reAttemptIndicatorLV(), legacy)){
TTCN_Logger::log_logmatch_info(".reAttemptIndicatorLV");
single_value->field_reAttemptIndicatorLV.log_match(match_value.reAttemptIndicatorLV(), 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(", reAttemptIndicatorLV := ");
single_value->field_reAttemptIndicatorLV.log_match(match_value.reAttemptIndicatorLV(), 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 ReAttemptIndicatorTLV_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_reAttemptIndicatorLV.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.ReAttemptIndicatorTLV.");
}
}

void ReAttemptIndicatorTLV_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_reAttemptIndicatorLV.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 ReAttemptIndicatorTLV_template[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.ReAttemptIndicatorTLV.");
}
}

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

void ReAttemptIndicatorTLV_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.ReAttemptIndicatorTLV");
single_value->field_reAttemptIndicatorLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ReAttemptIndicatorTLV");
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.ReAttemptIndicatorTLV");
}

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

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

SMCause2LV::SMCause2LV()
{
}

SMCause2LV::SMCause2LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_sMCause2V)
  :   field_lengthIndicator(par_lengthIndicator),
  field_sMCause2V(par_sMCause2V)
{
}

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

void SMCause2LV::clean_up()
{
field_lengthIndicator.clean_up();
field_sMCause2V.clean_up();
}

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

boolean SMCause2LV::operator==(const SMCause2LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_sMCause2V==other_value.field_sMCause2V;
}

boolean SMCause2LV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_sMCause2V.is_bound());
}
boolean SMCause2LV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_sMCause2V.is_value();
}
void SMCause2LV::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(", sMCause2V := ");
field_sMCause2V.log();
TTCN_Logger::log_event_str(" }");
}

void SMCause2LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (sMCause2V().is_bound()) sMCause2V().set_implicit_omit();
}

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

void SMCause2LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_sMCause2V.encode_text(text_buf);
}

void SMCause2LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_sMCause2V.decode_text(text_buf);
}

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

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

int SMCause2LV::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, SMCause2LV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(SMCause2LV_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(SMCause2LV_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_sMCause2V.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 SMCause2LV::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, SMCause2LV_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 = &SMCause2LV_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_sMCause2V.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct SMCause2LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_sMCause2V;
};

void SMCause2LV_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_sMCause2V = ANY_VALUE;
}
}
}

void SMCause2LV_template::copy_value(const SMCause2LV& 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.sMCause2V().is_bound()) {
  single_value->field_sMCause2V = other_value.sMCause2V();
} else {
  single_value->field_sMCause2V.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SMCause2LV_template::copy_template(const SMCause2LV_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.sMCause2V().get_selection()) {
single_value->field_sMCause2V = other_value.sMCause2V();
} else {
single_value->field_sMCause2V.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 SMCause2LV_template[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 SMCause2LV_template(*other_value.implication_.precondition);
implication_.implied_template = new SMCause2LV_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.SMCause2LV.");
break;
}
set_selection(other_value);
}

SMCause2LV_template::SMCause2LV_template()
{
}

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

SMCause2LV_template::SMCause2LV_template(const SMCause2LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMCause2LV_template::match(const SMCause2LV& 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.sMCause2V().is_bound()) return FALSE;
if(!single_value->field_sMCause2V.match(other_value.sMCause2V(), 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.SMCause2LV.");
}
return FALSE;
}

boolean SMCause2LV_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_sMCause2V.is_bound();
}

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

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

SMCause2LV SMCause2LV_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.SMCause2LV.");
SMCause2LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_sMCause2V.is_bound()) {
ret_val.sMCause2V() = single_value->field_sMCause2V.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& SMCause2LV_template::sMCause2V()
{
set_specific();
return single_value->field_sMCause2V;
}

const OCTETSTRING_template& SMCause2LV_template::sMCause2V() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sMCause2V of a non-specific template of type @MobileL3_GMM_SM_Types.SMCause2LV.");
return single_value->field_sMCause2V;
}

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

void SMCause2LV_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(", sMCause2V := ");
single_value->field_sMCause2V.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 SMCause2LV_template::log_match(const SMCause2LV& 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_sMCause2V.match(match_value.sMCause2V(), legacy)){
TTCN_Logger::log_logmatch_info(".sMCause2V");
single_value->field_sMCause2V.log_match(match_value.sMCause2V(), 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(", sMCause2V := ");
single_value->field_sMCause2V.log_match(match_value.sMCause2V(), 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 SMCause2LV_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_sMCause2V.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.SMCause2LV.");
}
}

void SMCause2LV_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_sMCause2V.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 SMCause2LV_template[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.SMCause2LV.");
}
}

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

void SMCause2LV_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.SMCause2LV");
single_value->field_sMCause2V.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.SMCause2LV");
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.SMCause2LV");
}

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

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

SMCause2TLV::SMCause2TLV()
{
}

SMCause2TLV::SMCause2TLV(const OCTETSTRING& par_elementIdentifier,
    const SMCause2LV& par_sMCause2LV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_sMCause2LV(par_sMCause2LV)
{
}

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

void SMCause2TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_sMCause2LV.clean_up();
}

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

boolean SMCause2TLV::operator==(const SMCause2TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_sMCause2LV==other_value.field_sMCause2LV;
}

boolean SMCause2TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_sMCause2LV.is_bound());
}
boolean SMCause2TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_sMCause2LV.is_value();
}
void SMCause2TLV::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(", sMCause2LV := ");
field_sMCause2LV.log();
TTCN_Logger::log_event_str(" }");
}

void SMCause2TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (sMCause2LV().is_bound()) sMCause2LV().set_implicit_omit();
}

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

void SMCause2TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_sMCause2LV.encode_text(text_buf);
}

void SMCause2TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_sMCause2LV.decode_text(text_buf);
}

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

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

int SMCause2TLV::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, SMCause2LV_descr_.raw->forceomit);
  decoded_field_length = field_sMCause2LV.RAW_decode(SMCause2LV_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_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 SMCause2TLV::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, SMCause2LV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_sMCause2LV.RAW_encode(SMCause2LV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_17) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct SMCause2TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
SMCause2LV_template field_sMCause2LV;
};

void SMCause2TLV_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_sMCause2LV = ANY_VALUE;
}
}
}

void SMCause2TLV_template::copy_value(const SMCause2TLV& 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.sMCause2LV().is_bound()) {
  single_value->field_sMCause2LV = other_value.sMCause2LV();
} else {
  single_value->field_sMCause2LV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SMCause2TLV_template::copy_template(const SMCause2TLV_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.sMCause2LV().get_selection()) {
single_value->field_sMCause2LV = other_value.sMCause2LV();
} else {
single_value->field_sMCause2LV.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 SMCause2TLV_template[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 SMCause2TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new SMCause2TLV_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.SMCause2TLV.");
break;
}
set_selection(other_value);
}

SMCause2TLV_template::SMCause2TLV_template()
{
}

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

SMCause2TLV_template::SMCause2TLV_template(const SMCause2TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMCause2TLV_template::match(const SMCause2TLV& 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.sMCause2LV().is_bound()) return FALSE;
if(!single_value->field_sMCause2LV.match(other_value.sMCause2LV(), 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.SMCause2TLV.");
}
return FALSE;
}

boolean SMCause2TLV_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_sMCause2LV.is_bound();
}

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

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

SMCause2TLV SMCause2TLV_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.SMCause2TLV.");
SMCause2TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_sMCause2LV.is_bound()) {
ret_val.sMCause2LV() = single_value->field_sMCause2LV.valueof();
}
return ret_val;
}

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

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

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

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

SMCause2LV_template& SMCause2TLV_template::sMCause2LV()
{
set_specific();
return single_value->field_sMCause2LV;
}

const SMCause2LV_template& SMCause2TLV_template::sMCause2LV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sMCause2LV of a non-specific template of type @MobileL3_GMM_SM_Types.SMCause2TLV.");
return single_value->field_sMCause2LV;
}

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

void SMCause2TLV_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(", sMCause2LV := ");
single_value->field_sMCause2LV.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 SMCause2TLV_template::log_match(const SMCause2TLV& 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_sMCause2LV.match(match_value.sMCause2LV(), legacy)){
TTCN_Logger::log_logmatch_info(".sMCause2LV");
single_value->field_sMCause2LV.log_match(match_value.sMCause2LV(), 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(", sMCause2LV := ");
single_value->field_sMCause2LV.log_match(match_value.sMCause2LV(), 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 SMCause2TLV_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_sMCause2LV.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.SMCause2TLV.");
}
}

void SMCause2TLV_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_sMCause2LV.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 SMCause2TLV_template[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.SMCause2TLV.");
}
}

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

void SMCause2TLV_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.SMCause2TLV");
single_value->field_sMCause2LV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.SMCause2TLV");
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.SMCause2TLV");
}

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

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

LinkedTIV::LinkedTIV()
{
}

LinkedTIV::LinkedTIV(const BITSTRING& par_spare,
    const BITSTRING& par_tio,
    const BITSTRING& par_tiFlag,
    const OPTIONAL< TI__Extension >& par_tIExtension)
  :   field_spare(par_spare),
  field_tio(par_tio),
  field_tiFlag(par_tiFlag),
  field_tIExtension(par_tIExtension)
{
}

LinkedTIV::LinkedTIV(const LinkedTIV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.LinkedTIV.");
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.tio().is_bound()) field_tio = other_value.tio();
else field_tio.clean_up();
if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
else field_tiFlag.clean_up();
if (other_value.tIExtension().is_bound()) field_tIExtension = other_value.tIExtension();
else field_tIExtension.clean_up();
}

void LinkedTIV::clean_up()
{
field_spare.clean_up();
field_tio.clean_up();
field_tiFlag.clean_up();
field_tIExtension.clean_up();
}

const TTCN_Typedescriptor_t* LinkedTIV::get_descriptor() const { return &LinkedTIV_descr_; }
LinkedTIV& LinkedTIV::operator=(const LinkedTIV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.LinkedTIV.");
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.tio().is_bound()) field_tio = other_value.tio();
  else field_tio.clean_up();
  if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
  else field_tiFlag.clean_up();
  if (other_value.tIExtension().is_bound()) field_tIExtension = other_value.tIExtension();
  else field_tIExtension.clean_up();
}
return *this;
}

boolean LinkedTIV::operator==(const LinkedTIV& other_value) const
{
return field_spare==other_value.field_spare
  && field_tio==other_value.field_tio
  && field_tiFlag==other_value.field_tiFlag
  && field_tIExtension==other_value.field_tIExtension;
}

boolean LinkedTIV::is_bound() const
{
return (field_spare.is_bound())
  || (field_tio.is_bound())
  || (field_tiFlag.is_bound())
  || (OPTIONAL_OMIT == field_tIExtension.get_selection() || field_tIExtension.is_bound());
}
boolean LinkedTIV::is_value() const
{
return field_spare.is_value()
  && field_tio.is_value()
  && field_tiFlag.is_value()
  && (OPTIONAL_OMIT == field_tIExtension.get_selection() || field_tIExtension.is_value());
}
int LinkedTIV::size_of() const
{
  int ret_val = 3;
  if (field_tIExtension.ispresent()) ret_val++;
  return ret_val;
}

void LinkedTIV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", tio := ");
field_tio.log();
TTCN_Logger::log_event_str(", tiFlag := ");
field_tiFlag.log();
TTCN_Logger::log_event_str(", tIExtension := ");
field_tIExtension.log();
TTCN_Logger::log_event_str(" }");
}

void LinkedTIV::set_implicit_omit()
{
if (spare().is_bound()) spare().set_implicit_omit();
if (tio().is_bound()) tio().set_implicit_omit();
if (tiFlag().is_bound()) tiFlag().set_implicit_omit();
if (!tIExtension().is_bound()) tIExtension() = OMIT_VALUE;
else tIExtension().set_implicit_omit();
}

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

void LinkedTIV::encode_text(Text_Buf& text_buf) const
{
field_spare.encode_text(text_buf);
field_tio.encode_text(text_buf);
field_tiFlag.encode_text(text_buf);
field_tIExtension.encode_text(text_buf);
}

void LinkedTIV::decode_text(Text_Buf& text_buf)
{
field_spare.decode_text(text_buf);
field_tio.decode_text(text_buf);
field_tiFlag.decode_text(text_buf);
field_tIExtension.decode_text(text_buf);
}

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

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

int LinkedTIV::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_spare.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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_tio.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tiFlag.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());
  if (limit > 0 && field_tio ==  bs_14){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_tIExtension = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, LinkedTIV_tIExtension_descr_.raw->forceomit);
  decoded_field_length = field_tIExtension().RAW_decode(LinkedTIV_tIExtension_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_tIExtension = 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_tIExtension=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int LinkedTIV::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::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  if (field_tIExtension.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, LinkedTIV_tIExtension_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tio.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tiFlag.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  if (field_tIExtension.ispresent()) {
  encoded_length += field_tIExtension().RAW_encode(LinkedTIV_tIExtension_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_tIExtension.ispresent() && (field_tio !=  bs_14)) {
  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_14.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 LinkedTIV_template::single_value_struct {
BITSTRING_template field_spare;
BITSTRING_template field_tio;
BITSTRING_template field_tiFlag;
TI__Extension_template field_tIExtension;
};

void LinkedTIV_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_spare = ANY_VALUE;
single_value->field_tio = ANY_VALUE;
single_value->field_tiFlag = ANY_VALUE;
single_value->field_tIExtension = ANY_OR_OMIT;
}
}
}

void LinkedTIV_template::copy_value(const LinkedTIV& other_value)
{
single_value = new single_value_struct;
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.tio().is_bound()) {
  single_value->field_tio = other_value.tio();
} else {
  single_value->field_tio.clean_up();
}
if (other_value.tiFlag().is_bound()) {
  single_value->field_tiFlag = other_value.tiFlag();
} else {
  single_value->field_tiFlag.clean_up();
}
if (other_value.tIExtension().is_bound()) {
  if (other_value.tIExtension().ispresent()) single_value->field_tIExtension = other_value.tIExtension()();
  else single_value->field_tIExtension = OMIT_VALUE;
} else {
  single_value->field_tIExtension.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LinkedTIV_template::copy_template(const LinkedTIV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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.tio().get_selection()) {
single_value->field_tio = other_value.tio();
} else {
single_value->field_tio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiFlag().get_selection()) {
single_value->field_tiFlag = other_value.tiFlag();
} else {
single_value->field_tiFlag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tIExtension().get_selection()) {
single_value->field_tIExtension = other_value.tIExtension();
} else {
single_value->field_tIExtension.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 LinkedTIV_template[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 LinkedTIV_template(*other_value.implication_.precondition);
implication_.implied_template = new LinkedTIV_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.LinkedTIV.");
break;
}
set_selection(other_value);
}

LinkedTIV_template::LinkedTIV_template()
{
}

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

LinkedTIV_template::LinkedTIV_template(const LinkedTIV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LinkedTIV_template::match(const LinkedTIV& 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.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.tio().is_bound()) return FALSE;
if(!single_value->field_tio.match(other_value.tio(), legacy))return FALSE;
if(!other_value.tiFlag().is_bound()) return FALSE;
if(!single_value->field_tiFlag.match(other_value.tiFlag(), legacy))return FALSE;
if(!other_value.tIExtension().is_bound()) return FALSE;
if((other_value.tIExtension().ispresent() ? !single_value->field_tIExtension.match((const TI__Extension&)other_value.tIExtension(), legacy) : !single_value->field_tIExtension.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.LinkedTIV.");
}
return FALSE;
}

boolean LinkedTIV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_spare.is_bound()
 || single_value->field_tio.is_bound()
 || single_value->field_tiFlag.is_bound()
 || (single_value->field_tIExtension.is_omit() || single_value->field_tIExtension.is_bound());
}

boolean LinkedTIV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_spare.is_value()
 && single_value->field_tio.is_value()
 && single_value->field_tiFlag.is_value()
 && (single_value->field_tIExtension.is_omit() || single_value->field_tIExtension.is_value());
}

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

LinkedTIV LinkedTIV_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.LinkedTIV.");
LinkedTIV ret_val;
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_tio.is_bound()) {
ret_val.tio() = single_value->field_tio.valueof();
}
if (single_value->field_tiFlag.is_bound()) {
ret_val.tiFlag() = single_value->field_tiFlag.valueof();
}
if (single_value->field_tIExtension.is_omit()) ret_val.tIExtension() = OMIT_VALUE;
else if (single_value->field_tIExtension.is_bound()) {
ret_val.tIExtension() = single_value->field_tIExtension.valueof();
}
return ret_val;
}

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

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

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

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

BITSTRING_template& LinkedTIV_template::tio()
{
set_specific();
return single_value->field_tio;
}

const BITSTRING_template& LinkedTIV_template::tio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tio of a non-specific template of type @MobileL3_GMM_SM_Types.LinkedTIV.");
return single_value->field_tio;
}

BITSTRING_template& LinkedTIV_template::tiFlag()
{
set_specific();
return single_value->field_tiFlag;
}

const BITSTRING_template& LinkedTIV_template::tiFlag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiFlag of a non-specific template of type @MobileL3_GMM_SM_Types.LinkedTIV.");
return single_value->field_tiFlag;
}

TI__Extension_template& LinkedTIV_template::tIExtension()
{
set_specific();
return single_value->field_tIExtension;
}

const TI__Extension_template& LinkedTIV_template::tIExtension() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tIExtension of a non-specific template of type @MobileL3_GMM_SM_Types.LinkedTIV.");
return single_value->field_tIExtension;
}

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

void LinkedTIV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", tio := ");
single_value->field_tio.log();
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.log();
TTCN_Logger::log_event_str(", tIExtension := ");
single_value->field_tIExtension.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 LinkedTIV_template::log_match(const LinkedTIV& 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_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_tio.match(match_value.tio(), legacy)){
TTCN_Logger::log_logmatch_info(".tio");
single_value->field_tio.log_match(match_value.tio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiFlag.match(match_value.tiFlag(), legacy)){
TTCN_Logger::log_logmatch_info(".tiFlag");
single_value->field_tiFlag.log_match(match_value.tiFlag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tIExtension().ispresent()){
if(!single_value->field_tIExtension.match(match_value.tIExtension(), legacy)){
TTCN_Logger::log_logmatch_info(".tIExtension");
single_value->field_tIExtension.log_match(match_value.tIExtension(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tIExtension.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tIExtension := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tIExtension.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("{ spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", tio := ");
single_value->field_tio.log_match(match_value.tio(), legacy);
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.log_match(match_value.tiFlag(), legacy);
TTCN_Logger::log_event_str(", tIExtension := ");
if (match_value.tIExtension().ispresent()) {
single_value->field_tIExtension.log_match(match_value.tIExtension(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tIExtension.log();
if (single_value->field_tIExtension.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 LinkedTIV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_spare.encode_text(text_buf);
single_value->field_tio.encode_text(text_buf);
single_value->field_tiFlag.encode_text(text_buf);
single_value->field_tIExtension.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.LinkedTIV.");
}
}

void LinkedTIV_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_spare.decode_text(text_buf);
single_value->field_tio.decode_text(text_buf);
single_value->field_tiFlag.decode_text(text_buf);
single_value->field_tIExtension.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 LinkedTIV_template[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.LinkedTIV.");
}
}

void LinkedTIV_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: {
    LinkedTIV_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.LinkedTIV 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) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tio().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tiFlag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tIExtension().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(), "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(), "tio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiFlag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiFlag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tIExtension")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tIExtension().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.LinkedTIV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LinkedTIV_template* precondition = new LinkedTIV_template;
    precondition->set_param(*param.get_elem(0));
    LinkedTIV_template* implied_template = new LinkedTIV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LinkedTIV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.LinkedTIV");
  }
  is_ifpresent = param.get_ifpresent();
}

void LinkedTIV_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_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LinkedTIV");
single_value->field_tio.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LinkedTIV");
single_value->field_tiFlag.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LinkedTIV");
single_value->field_tIExtension.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LinkedTIV");
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.LinkedTIV");
}

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

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

TI__Extension::TI__Extension()
{
}

TI__Extension::TI__Extension(const BITSTRING& par_tI__Value,
    const BITSTRING& par_tI__ExtBit)
  :   field_tI__Value(par_tI__Value),
  field_tI__ExtBit(par_tI__ExtBit)
{
}

TI__Extension::TI__Extension(const TI__Extension& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.TI_Extension.");
if (other_value.tI__Value().is_bound()) field_tI__Value = other_value.tI__Value();
else field_tI__Value.clean_up();
if (other_value.tI__ExtBit().is_bound()) field_tI__ExtBit = other_value.tI__ExtBit();
else field_tI__ExtBit.clean_up();
}

void TI__Extension::clean_up()
{
field_tI__Value.clean_up();
field_tI__ExtBit.clean_up();
}

const TTCN_Typedescriptor_t* TI__Extension::get_descriptor() const { return &TI__Extension_descr_; }
TI__Extension& TI__Extension::operator=(const TI__Extension& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.TI_Extension.");
  if (other_value.tI__Value().is_bound()) field_tI__Value = other_value.tI__Value();
  else field_tI__Value.clean_up();
  if (other_value.tI__ExtBit().is_bound()) field_tI__ExtBit = other_value.tI__ExtBit();
  else field_tI__ExtBit.clean_up();
}
return *this;
}

boolean TI__Extension::operator==(const TI__Extension& other_value) const
{
return field_tI__Value==other_value.field_tI__Value
  && field_tI__ExtBit==other_value.field_tI__ExtBit;
}

boolean TI__Extension::is_bound() const
{
return (field_tI__Value.is_bound())
  || (field_tI__ExtBit.is_bound());
}
boolean TI__Extension::is_value() const
{
return field_tI__Value.is_value()
  && field_tI__ExtBit.is_value();
}
void TI__Extension::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tI_Value := ");
field_tI__Value.log();
TTCN_Logger::log_event_str(", tI_ExtBit := ");
field_tI__ExtBit.log();
TTCN_Logger::log_event_str(" }");
}

void TI__Extension::set_implicit_omit()
{
if (tI__Value().is_bound()) tI__Value().set_implicit_omit();
if (tI__ExtBit().is_bound()) tI__ExtBit().set_implicit_omit();
}

void TI__Extension::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.TI_Extension 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) tI__Value().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tI__ExtBit().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(), "tI_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tI__Value().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tI_ExtBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tI__ExtBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.TI_Extension: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.TI_Extension");
  }
}

void TI__Extension::encode_text(Text_Buf& text_buf) const
{
field_tI__Value.encode_text(text_buf);
field_tI__ExtBit.encode_text(text_buf);
}

void TI__Extension::decode_text(Text_Buf& text_buf)
{
field_tI__Value.decode_text(text_buf);
field_tI__ExtBit.decode_text(text_buf);
}

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

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

int TI__Extension::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_tI__Value.RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tI__ExtBit.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 TI__Extension::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_tI__Value.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tI__ExtBit.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct TI__Extension_template::single_value_struct {
BITSTRING_template field_tI__Value;
BITSTRING_template field_tI__ExtBit;
};

void TI__Extension_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_tI__Value = ANY_VALUE;
single_value->field_tI__ExtBit = ANY_VALUE;
}
}
}

void TI__Extension_template::copy_value(const TI__Extension& other_value)
{
single_value = new single_value_struct;
if (other_value.tI__Value().is_bound()) {
  single_value->field_tI__Value = other_value.tI__Value();
} else {
  single_value->field_tI__Value.clean_up();
}
if (other_value.tI__ExtBit().is_bound()) {
  single_value->field_tI__ExtBit = other_value.tI__ExtBit();
} else {
  single_value->field_tI__ExtBit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TI__Extension_template::copy_template(const TI__Extension_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tI__Value().get_selection()) {
single_value->field_tI__Value = other_value.tI__Value();
} else {
single_value->field_tI__Value.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tI__ExtBit().get_selection()) {
single_value->field_tI__ExtBit = other_value.tI__ExtBit();
} else {
single_value->field_tI__ExtBit.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 TI__Extension_template[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 TI__Extension_template(*other_value.implication_.precondition);
implication_.implied_template = new TI__Extension_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.TI_Extension.");
break;
}
set_selection(other_value);
}

TI__Extension_template::TI__Extension_template()
{
}

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

TI__Extension_template::TI__Extension_template(const TI__Extension& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TI__Extension_template::match(const TI__Extension& 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.tI__Value().is_bound()) return FALSE;
if(!single_value->field_tI__Value.match(other_value.tI__Value(), legacy))return FALSE;
if(!other_value.tI__ExtBit().is_bound()) return FALSE;
if(!single_value->field_tI__ExtBit.match(other_value.tI__ExtBit(), 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.TI_Extension.");
}
return FALSE;
}

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

boolean TI__Extension_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tI__Value.is_value()
 && single_value->field_tI__ExtBit.is_value();
}

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

TI__Extension TI__Extension_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.TI_Extension.");
TI__Extension ret_val;
if (single_value->field_tI__Value.is_bound()) {
ret_val.tI__Value() = single_value->field_tI__Value.valueof();
}
if (single_value->field_tI__ExtBit.is_bound()) {
ret_val.tI__ExtBit() = single_value->field_tI__ExtBit.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& TI__Extension_template::tI__Value()
{
set_specific();
return single_value->field_tI__Value;
}

const BITSTRING_template& TI__Extension_template::tI__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tI_Value of a non-specific template of type @MobileL3_GMM_SM_Types.TI_Extension.");
return single_value->field_tI__Value;
}

BITSTRING_template& TI__Extension_template::tI__ExtBit()
{
set_specific();
return single_value->field_tI__ExtBit;
}

const BITSTRING_template& TI__Extension_template::tI__ExtBit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tI_ExtBit of a non-specific template of type @MobileL3_GMM_SM_Types.TI_Extension.");
return single_value->field_tI__ExtBit;
}

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

void TI__Extension_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tI_Value := ");
single_value->field_tI__Value.log();
TTCN_Logger::log_event_str(", tI_ExtBit := ");
single_value->field_tI__ExtBit.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 TI__Extension_template::log_match(const TI__Extension& 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_tI__Value.match(match_value.tI__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".tI_Value");
single_value->field_tI__Value.log_match(match_value.tI__Value(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tI__ExtBit.match(match_value.tI__ExtBit(), legacy)){
TTCN_Logger::log_logmatch_info(".tI_ExtBit");
single_value->field_tI__ExtBit.log_match(match_value.tI__ExtBit(), 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("{ tI_Value := ");
single_value->field_tI__Value.log_match(match_value.tI__Value(), legacy);
TTCN_Logger::log_event_str(", tI_ExtBit := ");
single_value->field_tI__ExtBit.log_match(match_value.tI__ExtBit(), 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 TI__Extension_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tI__Value.encode_text(text_buf);
single_value->field_tI__ExtBit.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.TI_Extension.");
}
}

void TI__Extension_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_tI__Value.decode_text(text_buf);
single_value->field_tI__ExtBit.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 TI__Extension_template[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.TI_Extension.");
}
}

void TI__Extension_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: {
    TI__Extension_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.TI_Extension 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) tI__Value().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tI__ExtBit().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(), "tI_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tI__Value().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tI_ExtBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tI__ExtBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.TI_Extension: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TI__Extension_template* precondition = new TI__Extension_template;
    precondition->set_param(*param.get_elem(0));
    TI__Extension_template* implied_template = new TI__Extension_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TI__Extension_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.TI_Extension");
  }
  is_ifpresent = param.get_ifpresent();
}

void TI__Extension_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_tI__Value.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TI_Extension");
single_value->field_tI__ExtBit.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TI_Extension");
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.TI_Extension");
}

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

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

LinkedTILV::LinkedTILV()
{
}

LinkedTILV::LinkedTILV(const INTEGER& par_lengthIndicator,
    const LinkedTIV& par_valueField)
  :   field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

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

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

boolean LinkedTILV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_valueField.is_bound());
}
boolean LinkedTILV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_valueField.is_value();
}
void LinkedTILV::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 LinkedTILV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

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

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

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

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

int LinkedTILV::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, LinkedTILV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(LinkedTILV_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(LinkedTILV_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, LinkedTIV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(LinkedTIV_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 LinkedTILV::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, LinkedTILV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, LinkedTIV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &LinkedTILV_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(LinkedTIV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct LinkedTILV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
LinkedTIV_template field_valueField;
};

void LinkedTILV_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 LinkedTILV_template::copy_value(const LinkedTILV& 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 LinkedTILV_template::copy_template(const LinkedTILV_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 LinkedTILV_template[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 LinkedTILV_template(*other_value.implication_.precondition);
implication_.implied_template = new LinkedTILV_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.LinkedTILV.");
break;
}
set_selection(other_value);
}

LinkedTILV_template::LinkedTILV_template()
{
}

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

LinkedTILV_template::LinkedTILV_template(const LinkedTILV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LinkedTILV_template::match(const LinkedTILV& 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.LinkedTILV.");
}
return FALSE;
}

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

LinkedTILV LinkedTILV_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.LinkedTILV.");
LinkedTILV 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 LinkedTILV_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.LinkedTILV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LinkedTILV_template[list_length];
}

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

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

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

LinkedTIV_template& LinkedTILV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

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

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

void LinkedTILV_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 LinkedTILV_template::log_match(const LinkedTILV& 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 LinkedTILV_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.LinkedTILV.");
}
}

void LinkedTILV_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 LinkedTILV_template[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.LinkedTILV.");
}
}

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

void LinkedTILV_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.LinkedTILV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LinkedTILV");
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.LinkedTILV");
}

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

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

LinkedTITLV::LinkedTITLV()
{
}

LinkedTITLV::LinkedTITLV(const OCTETSTRING& par_elementIdentifier,
    const LinkedTILV& par_linkedTILV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_linkedTILV(par_linkedTILV)
{
}

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

void LinkedTITLV::clean_up()
{
field_elementIdentifier.clean_up();
field_linkedTILV.clean_up();
}

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

boolean LinkedTITLV::operator==(const LinkedTITLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_linkedTILV==other_value.field_linkedTILV;
}

boolean LinkedTITLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_linkedTILV.is_bound());
}
boolean LinkedTITLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_linkedTILV.is_value();
}
void LinkedTITLV::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(", linkedTILV := ");
field_linkedTILV.log();
TTCN_Logger::log_event_str(" }");
}

void LinkedTITLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (linkedTILV().is_bound()) linkedTILV().set_implicit_omit();
}

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

void LinkedTITLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_linkedTILV.encode_text(text_buf);
}

void LinkedTITLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_linkedTILV.decode_text(text_buf);
}

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

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

int LinkedTITLV::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, LinkedTILV_descr_.raw->forceomit);
  decoded_field_length = field_linkedTILV.RAW_decode(LinkedTILV_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 LinkedTITLV::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, LinkedTILV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_linkedTILV.RAW_encode(LinkedTILV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct LinkedTITLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
LinkedTILV_template field_linkedTILV;
};

void LinkedTITLV_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_linkedTILV = ANY_VALUE;
}
}
}

void LinkedTITLV_template::copy_value(const LinkedTITLV& 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.linkedTILV().is_bound()) {
  single_value->field_linkedTILV = other_value.linkedTILV();
} else {
  single_value->field_linkedTILV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LinkedTITLV_template::copy_template(const LinkedTITLV_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.linkedTILV().get_selection()) {
single_value->field_linkedTILV = other_value.linkedTILV();
} else {
single_value->field_linkedTILV.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 LinkedTITLV_template[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 LinkedTITLV_template(*other_value.implication_.precondition);
implication_.implied_template = new LinkedTITLV_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.LinkedTITLV.");
break;
}
set_selection(other_value);
}

LinkedTITLV_template::LinkedTITLV_template()
{
}

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

LinkedTITLV_template::LinkedTITLV_template(const LinkedTITLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LinkedTITLV_template::match(const LinkedTITLV& 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.linkedTILV().is_bound()) return FALSE;
if(!single_value->field_linkedTILV.match(other_value.linkedTILV(), 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.LinkedTITLV.");
}
return FALSE;
}

boolean LinkedTITLV_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_linkedTILV.is_bound();
}

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

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

LinkedTITLV LinkedTITLV_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.LinkedTITLV.");
LinkedTITLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_linkedTILV.is_bound()) {
ret_val.linkedTILV() = single_value->field_linkedTILV.valueof();
}
return ret_val;
}

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

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

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

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

LinkedTILV_template& LinkedTITLV_template::linkedTILV()
{
set_specific();
return single_value->field_linkedTILV;
}

const LinkedTILV_template& LinkedTITLV_template::linkedTILV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field linkedTILV of a non-specific template of type @MobileL3_GMM_SM_Types.LinkedTITLV.");
return single_value->field_linkedTILV;
}

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

void LinkedTITLV_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(", linkedTILV := ");
single_value->field_linkedTILV.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 LinkedTITLV_template::log_match(const LinkedTITLV& 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_linkedTILV.match(match_value.linkedTILV(), legacy)){
TTCN_Logger::log_logmatch_info(".linkedTILV");
single_value->field_linkedTILV.log_match(match_value.linkedTILV(), 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(", linkedTILV := ");
single_value->field_linkedTILV.log_match(match_value.linkedTILV(), 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 LinkedTITLV_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_linkedTILV.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.LinkedTITLV.");
}
}

void LinkedTITLV_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_linkedTILV.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 LinkedTITLV_template[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.LinkedTITLV.");
}
}

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

void LinkedTITLV_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.LinkedTITLV");
single_value->field_linkedTILV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LinkedTITLV");
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.LinkedTITLV");
}

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

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

LLC__SAPIV::LLC__SAPIV()
{
}

LLC__SAPIV::LLC__SAPIV(const BITSTRING& par_valueField,
    const BITSTRING& par_spare)
  :   field_valueField(par_valueField),
  field_spare(par_spare)
{
}

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

void LLC__SAPIV::clean_up()
{
field_valueField.clean_up();
field_spare.clean_up();
}

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

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

boolean LLC__SAPIV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_spare.is_bound());
}
boolean LLC__SAPIV::is_value() const
{
return field_valueField.is_value()
  && field_spare.is_value();
}
void LLC__SAPIV::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(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void LLC__SAPIV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void LLC__SAPIV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void LLC__SAPIV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int LLC__SAPIV::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_valueField.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 LLC__SAPIV::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_valueField.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 LLC__SAPIV_template::single_value_struct {
BITSTRING_template field_valueField;
BITSTRING_template field_spare;
};

void LLC__SAPIV_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_spare = ANY_VALUE;
}
}
}

void LLC__SAPIV_template::copy_value(const LLC__SAPIV& 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.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LLC__SAPIV_template::copy_template(const LLC__SAPIV_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.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 LLC__SAPIV_template[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 LLC__SAPIV_template(*other_value.implication_.precondition);
implication_.implied_template = new LLC__SAPIV_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.LLC_SAPIV.");
break;
}
set_selection(other_value);
}

LLC__SAPIV_template::LLC__SAPIV_template()
{
}

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

LLC__SAPIV_template::LLC__SAPIV_template(const LLC__SAPIV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LLC__SAPIV_template::match(const LLC__SAPIV& 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.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.LLC_SAPIV.");
}
return FALSE;
}

boolean LLC__SAPIV_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_spare.is_bound();
}

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

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

LLC__SAPIV LLC__SAPIV_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.LLC_SAPIV.");
LLC__SAPIV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& LLC__SAPIV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

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

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

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

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

void LLC__SAPIV_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(", 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 LLC__SAPIV_template::log_match(const LLC__SAPIV& 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_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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), 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 LLC__SAPIV_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_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.LLC_SAPIV.");
}
}

void LLC__SAPIV_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_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 LLC__SAPIV_template[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.LLC_SAPIV.");
}
}

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

void LLC__SAPIV_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.LLC_SAPIV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LLC_SAPIV");
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.LLC_SAPIV");
}

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

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

LLC__SAPITV::LLC__SAPITV()
{
}

LLC__SAPITV::LLC__SAPITV(const OCTETSTRING& par_elementIdentifier,
    const LLC__SAPIV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_valueField(par_valueField)
{
}

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

void LLC__SAPITV::clean_up()
{
field_elementIdentifier.clean_up();
field_valueField.clean_up();
}

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

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

boolean LLC__SAPITV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_valueField.is_bound());
}
boolean LLC__SAPITV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_valueField.is_value();
}
void LLC__SAPITV::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(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void LLC__SAPITV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

void LLC__SAPITV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void LLC__SAPITV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

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

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

int LLC__SAPITV::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, LLC__SAPIV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(LLC__SAPIV_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_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 LLC__SAPITV::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, LLC__SAPIV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_valueField.RAW_encode(LLC__SAPIV_descr_, *myleaf.body.node.nodes[1]);
  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 LLC__SAPITV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
LLC__SAPIV_template field_valueField;
};

void LLC__SAPITV_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_valueField = ANY_VALUE;
}
}
}

void LLC__SAPITV_template::copy_value(const LLC__SAPITV& 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.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LLC__SAPITV_template::copy_template(const LLC__SAPITV_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.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 LLC__SAPITV_template[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 LLC__SAPITV_template(*other_value.implication_.precondition);
implication_.implied_template = new LLC__SAPITV_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.LLC_SAPITV.");
break;
}
set_selection(other_value);
}

LLC__SAPITV_template::LLC__SAPITV_template()
{
}

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

LLC__SAPITV_template::LLC__SAPITV_template(const LLC__SAPITV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LLC__SAPITV_template::match(const LLC__SAPITV& 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.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.LLC_SAPITV.");
}
return FALSE;
}

boolean LLC__SAPITV_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_valueField.is_bound();
}

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

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

LLC__SAPITV LLC__SAPITV_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.LLC_SAPITV.");
LLC__SAPITV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

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

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

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

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

LLC__SAPIV_template& LLC__SAPITV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

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

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

void LLC__SAPITV_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(", 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 LLC__SAPITV_template::log_match(const LLC__SAPITV& 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_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(", 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 LLC__SAPITV_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_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.LLC_SAPITV.");
}
}

void LLC__SAPITV_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_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 LLC__SAPITV_template[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.LLC_SAPITV.");
}
}

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

void LLC__SAPITV_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.LLC_SAPITV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LLC_SAPITV");
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.LLC_SAPITV");
}

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

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

TearDownIndicatorV::TearDownIndicatorV()
{
}

TearDownIndicatorV::TearDownIndicatorV(const BITSTRING& par_tdi__flag,
    const BITSTRING& par_spare)
  :   field_tdi__flag(par_tdi__flag),
  field_spare(par_spare)
{
}

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

void TearDownIndicatorV::clean_up()
{
field_tdi__flag.clean_up();
field_spare.clean_up();
}

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

boolean TearDownIndicatorV::operator==(const TearDownIndicatorV& other_value) const
{
return field_tdi__flag==other_value.field_tdi__flag
  && field_spare==other_value.field_spare;
}

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

void TearDownIndicatorV::set_implicit_omit()
{
if (tdi__flag().is_bound()) tdi__flag().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void TearDownIndicatorV::encode_text(Text_Buf& text_buf) const
{
field_tdi__flag.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void TearDownIndicatorV::decode_text(Text_Buf& text_buf)
{
field_tdi__flag.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int TearDownIndicatorV::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_tdi__flag.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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_spare.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 TearDownIndicatorV::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::BIT1_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_tdi__flag.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct TearDownIndicatorV_template::single_value_struct {
BITSTRING_template field_tdi__flag;
BITSTRING_template field_spare;
};

void TearDownIndicatorV_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_tdi__flag = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void TearDownIndicatorV_template::copy_value(const TearDownIndicatorV& other_value)
{
single_value = new single_value_struct;
if (other_value.tdi__flag().is_bound()) {
  single_value->field_tdi__flag = other_value.tdi__flag();
} else {
  single_value->field_tdi__flag.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 TearDownIndicatorV_template::copy_template(const TearDownIndicatorV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tdi__flag().get_selection()) {
single_value->field_tdi__flag = other_value.tdi__flag();
} else {
single_value->field_tdi__flag.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 TearDownIndicatorV_template[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 TearDownIndicatorV_template(*other_value.implication_.precondition);
implication_.implied_template = new TearDownIndicatorV_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.TearDownIndicatorV.");
break;
}
set_selection(other_value);
}

TearDownIndicatorV_template::TearDownIndicatorV_template()
{
}

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

TearDownIndicatorV_template::TearDownIndicatorV_template(const TearDownIndicatorV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TearDownIndicatorV_template::match(const TearDownIndicatorV& 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.tdi__flag().is_bound()) return FALSE;
if(!single_value->field_tdi__flag.match(other_value.tdi__flag(), 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.TearDownIndicatorV.");
}
return FALSE;
}

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

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

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

TearDownIndicatorV TearDownIndicatorV_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.TearDownIndicatorV.");
TearDownIndicatorV ret_val;
if (single_value->field_tdi__flag.is_bound()) {
ret_val.tdi__flag() = single_value->field_tdi__flag.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& TearDownIndicatorV_template::tdi__flag()
{
set_specific();
return single_value->field_tdi__flag;
}

const BITSTRING_template& TearDownIndicatorV_template::tdi__flag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tdi_flag of a non-specific template of type @MobileL3_GMM_SM_Types.TearDownIndicatorV.");
return single_value->field_tdi__flag;
}

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

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

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

void TearDownIndicatorV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tdi_flag := ");
single_value->field_tdi__flag.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 TearDownIndicatorV_template::log_match(const TearDownIndicatorV& 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_tdi__flag.match(match_value.tdi__flag(), legacy)){
TTCN_Logger::log_logmatch_info(".tdi_flag");
single_value->field_tdi__flag.log_match(match_value.tdi__flag(), 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("{ tdi_flag := ");
single_value->field_tdi__flag.log_match(match_value.tdi__flag(), 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 TearDownIndicatorV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tdi__flag.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.TearDownIndicatorV.");
}
}

void TearDownIndicatorV_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_tdi__flag.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 TearDownIndicatorV_template[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.TearDownIndicatorV.");
}
}

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

void TearDownIndicatorV_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_tdi__flag.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TearDownIndicatorV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TearDownIndicatorV");
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.TearDownIndicatorV");
}

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

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

TearDownIndicatorTV::TearDownIndicatorTV()
{
}

TearDownIndicatorTV::TearDownIndicatorTV(const TearDownIndicatorV& par_tearDownIndicatorV,
    const BITSTRING& par_elementIdentifier)
  :   field_tearDownIndicatorV(par_tearDownIndicatorV),
  field_elementIdentifier(par_elementIdentifier)
{
}

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

void TearDownIndicatorTV::clean_up()
{
field_tearDownIndicatorV.clean_up();
field_elementIdentifier.clean_up();
}

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

boolean TearDownIndicatorTV::operator==(const TearDownIndicatorTV& other_value) const
{
return field_tearDownIndicatorV==other_value.field_tearDownIndicatorV
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

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

void TearDownIndicatorTV::set_implicit_omit()
{
if (tearDownIndicatorV().is_bound()) tearDownIndicatorV().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void TearDownIndicatorTV::encode_text(Text_Buf& text_buf) const
{
field_tearDownIndicatorV.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void TearDownIndicatorTV::decode_text(Text_Buf& text_buf)
{
field_tearDownIndicatorV.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

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

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

int TearDownIndicatorTV::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, TearDownIndicatorV_descr_.raw->forceomit);
  decoded_field_length = field_tearDownIndicatorV.RAW_decode(TearDownIndicatorV_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_1) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TearDownIndicatorTV::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, TearDownIndicatorV_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_tearDownIndicatorV.RAW_encode(TearDownIndicatorV_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_1) {
  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_1.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 TearDownIndicatorTV_template::single_value_struct {
TearDownIndicatorV_template field_tearDownIndicatorV;
BITSTRING_template field_elementIdentifier;
};

void TearDownIndicatorTV_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_tearDownIndicatorV = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void TearDownIndicatorTV_template::copy_value(const TearDownIndicatorTV& other_value)
{
single_value = new single_value_struct;
if (other_value.tearDownIndicatorV().is_bound()) {
  single_value->field_tearDownIndicatorV = other_value.tearDownIndicatorV();
} else {
  single_value->field_tearDownIndicatorV.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 TearDownIndicatorTV_template::copy_template(const TearDownIndicatorTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tearDownIndicatorV().get_selection()) {
single_value->field_tearDownIndicatorV = other_value.tearDownIndicatorV();
} else {
single_value->field_tearDownIndicatorV.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 TearDownIndicatorTV_template[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 TearDownIndicatorTV_template(*other_value.implication_.precondition);
implication_.implied_template = new TearDownIndicatorTV_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.TearDownIndicatorTV.");
break;
}
set_selection(other_value);
}

TearDownIndicatorTV_template::TearDownIndicatorTV_template()
{
}

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

TearDownIndicatorTV_template::TearDownIndicatorTV_template(const TearDownIndicatorTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TearDownIndicatorTV_template::match(const TearDownIndicatorTV& 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.tearDownIndicatorV().is_bound()) return FALSE;
if(!single_value->field_tearDownIndicatorV.match(other_value.tearDownIndicatorV(), 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.TearDownIndicatorTV.");
}
return FALSE;
}

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

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

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

TearDownIndicatorTV TearDownIndicatorTV_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.TearDownIndicatorTV.");
TearDownIndicatorTV ret_val;
if (single_value->field_tearDownIndicatorV.is_bound()) {
ret_val.tearDownIndicatorV() = single_value->field_tearDownIndicatorV.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

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

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

TearDownIndicatorV_template& TearDownIndicatorTV_template::tearDownIndicatorV()
{
set_specific();
return single_value->field_tearDownIndicatorV;
}

const TearDownIndicatorV_template& TearDownIndicatorTV_template::tearDownIndicatorV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tearDownIndicatorV of a non-specific template of type @MobileL3_GMM_SM_Types.TearDownIndicatorTV.");
return single_value->field_tearDownIndicatorV;
}

BITSTRING_template& TearDownIndicatorTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

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

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

void TearDownIndicatorTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tearDownIndicatorV := ");
single_value->field_tearDownIndicatorV.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 TearDownIndicatorTV_template::log_match(const TearDownIndicatorTV& 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_tearDownIndicatorV.match(match_value.tearDownIndicatorV(), legacy)){
TTCN_Logger::log_logmatch_info(".tearDownIndicatorV");
single_value->field_tearDownIndicatorV.log_match(match_value.tearDownIndicatorV(), 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("{ tearDownIndicatorV := ");
single_value->field_tearDownIndicatorV.log_match(match_value.tearDownIndicatorV(), 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 TearDownIndicatorTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tearDownIndicatorV.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.TearDownIndicatorTV.");
}
}

void TearDownIndicatorTV_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_tearDownIndicatorV.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 TearDownIndicatorTV_template[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.TearDownIndicatorTV.");
}
}

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

void TearDownIndicatorTV_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_tearDownIndicatorV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TearDownIndicatorTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TearDownIndicatorTV");
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.TearDownIndicatorTV");
}

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

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

PacketFlowIDV::PacketFlowIDV()
{
}

PacketFlowIDV::PacketFlowIDV(const BITSTRING& par_valueField,
    const BITSTRING& par_spare)
  :   field_valueField(par_valueField),
  field_spare(par_spare)
{
}

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

void PacketFlowIDV::clean_up()
{
field_valueField.clean_up();
field_spare.clean_up();
}

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

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

boolean PacketFlowIDV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_spare.is_bound());
}
boolean PacketFlowIDV::is_value() const
{
return field_valueField.is_value()
  && field_spare.is_value();
}
void PacketFlowIDV::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(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void PacketFlowIDV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void PacketFlowIDV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void PacketFlowIDV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

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

int PacketFlowIDV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_valueField.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PacketFlowIDV_template::single_value_struct {
BITSTRING_template field_valueField;
BITSTRING_template field_spare;
};

void PacketFlowIDV_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_spare = ANY_VALUE;
}
}
}

void PacketFlowIDV_template::copy_value(const PacketFlowIDV& 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.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PacketFlowIDV_template::copy_template(const PacketFlowIDV_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.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 PacketFlowIDV_template[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 PacketFlowIDV_template(*other_value.implication_.precondition);
implication_.implied_template = new PacketFlowIDV_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.PacketFlowIDV.");
break;
}
set_selection(other_value);
}

PacketFlowIDV_template::PacketFlowIDV_template()
{
}

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

PacketFlowIDV_template::PacketFlowIDV_template(const PacketFlowIDV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PacketFlowIDV_template::match(const PacketFlowIDV& 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.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.PacketFlowIDV.");
}
return FALSE;
}

boolean PacketFlowIDV_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_spare.is_bound();
}

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

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

PacketFlowIDV PacketFlowIDV_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.PacketFlowIDV.");
PacketFlowIDV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& PacketFlowIDV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

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

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

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

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

void PacketFlowIDV_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(", 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 PacketFlowIDV_template::log_match(const PacketFlowIDV& 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_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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), 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 PacketFlowIDV_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_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.PacketFlowIDV.");
}
}

void PacketFlowIDV_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_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 PacketFlowIDV_template[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.PacketFlowIDV.");
}
}

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

void PacketFlowIDV_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.PacketFlowIDV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFlowIDV");
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.PacketFlowIDV");
}

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

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

PacketFlowIDTLV::PacketFlowIDTLV()
{
}

PacketFlowIDTLV::PacketFlowIDTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const PacketFlowIDV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

PacketFlowIDTLV::PacketFlowIDTLV(const PacketFlowIDTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PacketFlowIDTLV.");
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 PacketFlowIDTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

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

boolean PacketFlowIDTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_valueField.is_bound());
}
boolean PacketFlowIDTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_valueField.is_value();
}
void PacketFlowIDTLV::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 PacketFlowIDTLV::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 PacketFlowIDTLV::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.PacketFlowIDTLV 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.PacketFlowIDTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PacketFlowIDTLV");
  }
}

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

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

int PacketFlowIDTLV::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, PacketFlowIDTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PacketFlowIDTLV_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(PacketFlowIDTLV_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, PacketFlowIDV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(PacketFlowIDV_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_19) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PacketFlowIDTLV::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, PacketFlowIDTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PacketFlowIDV_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 = &PacketFlowIDTLV_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(PacketFlowIDV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_19) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_19.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PacketFlowIDTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
PacketFlowIDV_template field_valueField;
};

void PacketFlowIDTLV_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 PacketFlowIDTLV_template::copy_value(const PacketFlowIDTLV& 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 PacketFlowIDTLV_template::copy_template(const PacketFlowIDTLV_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 PacketFlowIDTLV_template[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 PacketFlowIDTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new PacketFlowIDTLV_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.PacketFlowIDTLV.");
break;
}
set_selection(other_value);
}

PacketFlowIDTLV_template::PacketFlowIDTLV_template()
{
}

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

PacketFlowIDTLV_template::PacketFlowIDTLV_template(const PacketFlowIDTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PacketFlowIDTLV_template::match(const PacketFlowIDTLV& 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.PacketFlowIDTLV.");
}
return FALSE;
}

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

PacketFlowIDTLV PacketFlowIDTLV_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.PacketFlowIDTLV.");
PacketFlowIDTLV 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 PacketFlowIDTLV_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.PacketFlowIDTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PacketFlowIDTLV_template[list_length];
}

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

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

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

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

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

PacketFlowIDV_template& PacketFlowIDTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

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

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

void PacketFlowIDTLV_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 PacketFlowIDTLV_template::log_match(const PacketFlowIDTLV& 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 PacketFlowIDTLV_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.PacketFlowIDTLV.");
}
}

void PacketFlowIDTLV_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 PacketFlowIDTLV_template[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.PacketFlowIDTLV.");
}
}

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

void PacketFlowIDTLV_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.PacketFlowIDTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFlowIDTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PacketFlowIDTLV");
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.PacketFlowIDTLV");
}

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

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

void TrafficFlowTemplateV::copy_value(const TrafficFlowTemplateV& other_value)
{
switch (other_value.union_selection) {
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
field_trafficFlowTemplateV__CreateAddReplaceTFT = new TrafficFlowTemplateV__CreateAddReplaceTFT(*other_value.field_trafficFlowTemplateV__CreateAddReplaceTFT);
break;
case ALT_trafficFlowTemplateV__DeletePacketFilter:
field_trafficFlowTemplateV__DeletePacketFilter = new TrafficFlowTemplateV__DeletePacketFilter(*other_value.field_trafficFlowTemplateV__DeletePacketFilter);
break;
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation(*other_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TrafficFlowTemplateV::operator==(const TrafficFlowTemplateV& 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.TrafficFlowTemplateV.");
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.TrafficFlowTemplateV.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
return *field_trafficFlowTemplateV__CreateAddReplaceTFT == *other_value.field_trafficFlowTemplateV__CreateAddReplaceTFT;
case ALT_trafficFlowTemplateV__DeletePacketFilter:
return *field_trafficFlowTemplateV__DeletePacketFilter == *other_value.field_trafficFlowTemplateV__DeletePacketFilter;
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
return *field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation == *other_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
default:
return FALSE;
}
}

TrafficFlowTemplateV__CreateAddReplaceTFT& TrafficFlowTemplateV::trafficFlowTemplateV__CreateAddReplaceTFT()
{
if (union_selection != ALT_trafficFlowTemplateV__CreateAddReplaceTFT) {
clean_up();
field_trafficFlowTemplateV__CreateAddReplaceTFT = new TrafficFlowTemplateV__CreateAddReplaceTFT;
union_selection = ALT_trafficFlowTemplateV__CreateAddReplaceTFT;
}
return *field_trafficFlowTemplateV__CreateAddReplaceTFT;
}

const TrafficFlowTemplateV__CreateAddReplaceTFT& TrafficFlowTemplateV::trafficFlowTemplateV__CreateAddReplaceTFT() const
{
if (union_selection != ALT_trafficFlowTemplateV__CreateAddReplaceTFT) TTCN_error("Using non-selected field trafficFlowTemplateV_CreateAddReplaceTFT in a value of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
return *field_trafficFlowTemplateV__CreateAddReplaceTFT;
}

TrafficFlowTemplateV__DeletePacketFilter& TrafficFlowTemplateV::trafficFlowTemplateV__DeletePacketFilter()
{
if (union_selection != ALT_trafficFlowTemplateV__DeletePacketFilter) {
clean_up();
field_trafficFlowTemplateV__DeletePacketFilter = new TrafficFlowTemplateV__DeletePacketFilter;
union_selection = ALT_trafficFlowTemplateV__DeletePacketFilter;
}
return *field_trafficFlowTemplateV__DeletePacketFilter;
}

const TrafficFlowTemplateV__DeletePacketFilter& TrafficFlowTemplateV::trafficFlowTemplateV__DeletePacketFilter() const
{
if (union_selection != ALT_trafficFlowTemplateV__DeletePacketFilter) TTCN_error("Using non-selected field trafficFlowTemplateV_DeletePacketFilter in a value of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
return *field_trafficFlowTemplateV__DeletePacketFilter;
}

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& TrafficFlowTemplateV::trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation()
{
if (union_selection != ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation) {
clean_up();
field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
union_selection = ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
}
return *field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
}

const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation& TrafficFlowTemplateV::trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation() const
{
if (union_selection != ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation) TTCN_error("Using non-selected field trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation in a value of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
return *field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
}

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

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

boolean TrafficFlowTemplateV::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT: return field_trafficFlowTemplateV__CreateAddReplaceTFT->is_value();
case ALT_trafficFlowTemplateV__DeletePacketFilter: return field_trafficFlowTemplateV__DeletePacketFilter->is_value();
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation: return field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TrafficFlowTemplateV::clean_up()
{
switch (union_selection) {
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
  delete field_trafficFlowTemplateV__CreateAddReplaceTFT;
  break;
case ALT_trafficFlowTemplateV__DeletePacketFilter:
  delete field_trafficFlowTemplateV__DeletePacketFilter;
  break;
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
  delete field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TrafficFlowTemplateV::log() const
{
switch (union_selection) {
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_CreateAddReplaceTFT := ");
field_trafficFlowTemplateV__CreateAddReplaceTFT->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_trafficFlowTemplateV__DeletePacketFilter:
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_DeletePacketFilter := ");
field_trafficFlowTemplateV__DeletePacketFilter->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation := ");
field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TrafficFlowTemplateV::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, "trafficFlowTemplateV_CreateAddReplaceTFT")) {
    trafficFlowTemplateV__CreateAddReplaceTFT().set_param(*mp_last);
    if (!trafficFlowTemplateV__CreateAddReplaceTFT().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "trafficFlowTemplateV_DeletePacketFilter")) {
    trafficFlowTemplateV__DeletePacketFilter().set_param(*mp_last);
    if (!trafficFlowTemplateV__DeletePacketFilter().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation")) {
    trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation().set_param(*mp_last);
    if (!trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.", last_name);
}

void TrafficFlowTemplateV::set_implicit_omit()
{
switch (union_selection) {
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
field_trafficFlowTemplateV__CreateAddReplaceTFT->set_implicit_omit(); break;
case ALT_trafficFlowTemplateV__DeletePacketFilter:
field_trafficFlowTemplateV__DeletePacketFilter->set_implicit_omit(); break;
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->set_implicit_omit(); break;
default: break;
}
}

void TrafficFlowTemplateV::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
field_trafficFlowTemplateV__CreateAddReplaceTFT->encode_text(text_buf);
break;
case ALT_trafficFlowTemplateV__DeletePacketFilter:
field_trafficFlowTemplateV__DeletePacketFilter->encode_text(text_buf);
break;
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
}
}

void TrafficFlowTemplateV::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
trafficFlowTemplateV__CreateAddReplaceTFT().decode_text(text_buf);
break;
case ALT_trafficFlowTemplateV__DeletePacketFilter:
trafficFlowTemplateV__DeletePacketFilter().decode_text(text_buf);
break;
case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
}
}

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

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

int TrafficFlowTemplateV::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, TrafficFlowTemplateV__CreateAddReplaceTFT_descr_.raw->forceomit);
      decoded_length = trafficFlowTemplateV__CreateAddReplaceTFT().RAW_decode(TrafficFlowTemplateV__CreateAddReplaceTFT_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, TrafficFlowTemplateV__DeletePacketFilter_descr_.raw->forceomit);
      decoded_length = trafficFlowTemplateV__DeletePacketFilter().RAW_decode(TrafficFlowTemplateV__DeletePacketFilter_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, TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_descr_.raw->forceomit);
      decoded_length = trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation().RAW_decode(TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_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, TrafficFlowTemplateV__CreateAddReplaceTFT_descr_.raw->forceomit);
      decoded_length = trafficFlowTemplateV__CreateAddReplaceTFT().RAW_decode(TrafficFlowTemplateV__CreateAddReplaceTFT_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, TrafficFlowTemplateV__DeletePacketFilter_descr_.raw->forceomit);
      decoded_length = trafficFlowTemplateV__DeletePacketFilter().RAW_decode(TrafficFlowTemplateV__DeletePacketFilter_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, TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_descr_.raw->forceomit);
      decoded_length = trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation().RAW_decode(TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int TrafficFlowTemplateV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, TrafficFlowTemplateV__CreateAddReplaceTFT_descr_.raw);
    encoded_length = field_trafficFlowTemplateV__CreateAddReplaceTFT->RAW_encode(TrafficFlowTemplateV__CreateAddReplaceTFT_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &TrafficFlowTemplateV__CreateAddReplaceTFT_descr_;
    break;
  case ALT_trafficFlowTemplateV__DeletePacketFilter:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, TrafficFlowTemplateV__DeletePacketFilter_descr_.raw);
    encoded_length = field_trafficFlowTemplateV__DeletePacketFilter->RAW_encode(TrafficFlowTemplateV__DeletePacketFilter_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &TrafficFlowTemplateV__DeletePacketFilter_descr_;
    break;
  case ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_descr_.raw);
    encoded_length = field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->RAW_encode(TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TrafficFlowTemplateV_template::copy_value(const TrafficFlowTemplateV& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT = new TrafficFlowTemplateV__CreateAddReplaceTFT_template(other_value.trafficFlowTemplateV__CreateAddReplaceTFT());
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
single_value.field_trafficFlowTemplateV__DeletePacketFilter = new TrafficFlowTemplateV__DeletePacketFilter_template(other_value.trafficFlowTemplateV__DeletePacketFilter());
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template(other_value.trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
}
set_selection(SPECIFIC_VALUE);
}

void TrafficFlowTemplateV_template::copy_template(const TrafficFlowTemplateV_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 TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT = new TrafficFlowTemplateV__CreateAddReplaceTFT_template(*other_value.single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT);
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
single_value.field_trafficFlowTemplateV__DeletePacketFilter = new TrafficFlowTemplateV__DeletePacketFilter_template(*other_value.single_value.field_trafficFlowTemplateV__DeletePacketFilter);
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template(*other_value.single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
}
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_template[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_template(*other_value.implication_.precondition);
implication_.implied_template = new TrafficFlowTemplateV_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.TrafficFlowTemplateV.");
}
set_selection(other_value);
}

TrafficFlowTemplateV_template::TrafficFlowTemplateV_template()
{
}

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

TrafficFlowTemplateV_template::TrafficFlowTemplateV_template(const TrafficFlowTemplateV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void TrafficFlowTemplateV_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
delete single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT;
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
delete single_value.field_trafficFlowTemplateV__DeletePacketFilter;
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
delete single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
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;
}

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

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

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

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

boolean TrafficFlowTemplateV_template::match(const TrafficFlowTemplateV& 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:
{
TrafficFlowTemplateV::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TrafficFlowTemplateV::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
return single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->match(other_value.trafficFlowTemplateV__CreateAddReplaceTFT(), legacy);
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
return single_value.field_trafficFlowTemplateV__DeletePacketFilter->match(other_value.trafficFlowTemplateV__DeletePacketFilter(), legacy);
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
return single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->match(other_value.trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
}
}
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.TrafficFlowTemplateV.");
}
return FALSE;
}

boolean TrafficFlowTemplateV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
return single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->is_value();
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
return single_value.field_trafficFlowTemplateV__DeletePacketFilter->is_value();
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
return single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->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.TrafficFlowTemplateV.");
}
}

TrafficFlowTemplateV TrafficFlowTemplateV_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.TrafficFlowTemplateV.");
TrafficFlowTemplateV ret_val;
switch (single_value.union_selection) {
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
ret_val.trafficFlowTemplateV__CreateAddReplaceTFT() = single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->valueof();
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
ret_val.trafficFlowTemplateV__DeletePacketFilter() = single_value.field_trafficFlowTemplateV__DeletePacketFilter->valueof();
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
ret_val.trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation() = single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->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.TrafficFlowTemplateV.");
}
return ret_val;
}

TrafficFlowTemplateV_template& TrafficFlowTemplateV_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.TrafficFlowTemplateV.");
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.TrafficFlowTemplateV.");
return value_list.list_value[list_index];
}
void TrafficFlowTemplateV_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.TrafficFlowTemplateV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TrafficFlowTemplateV_template[list_length];
}

TrafficFlowTemplateV__CreateAddReplaceTFT_template& TrafficFlowTemplateV_template::trafficFlowTemplateV__CreateAddReplaceTFT()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT = new TrafficFlowTemplateV__CreateAddReplaceTFT_template(ANY_VALUE);
else single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT = new TrafficFlowTemplateV__CreateAddReplaceTFT_template;
single_value.union_selection = TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT;
}

const TrafficFlowTemplateV__CreateAddReplaceTFT_template& TrafficFlowTemplateV_template::trafficFlowTemplateV__CreateAddReplaceTFT() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field trafficFlowTemplateV_CreateAddReplaceTFT in a non-specific template of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
if (single_value.union_selection != TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT) TTCN_error("Accessing non-selected field trafficFlowTemplateV_CreateAddReplaceTFT in a template of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
return *single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT;
}

TrafficFlowTemplateV__DeletePacketFilter_template& TrafficFlowTemplateV_template::trafficFlowTemplateV__DeletePacketFilter()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_trafficFlowTemplateV__DeletePacketFilter = new TrafficFlowTemplateV__DeletePacketFilter_template(ANY_VALUE);
else single_value.field_trafficFlowTemplateV__DeletePacketFilter = new TrafficFlowTemplateV__DeletePacketFilter_template;
single_value.union_selection = TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_trafficFlowTemplateV__DeletePacketFilter;
}

const TrafficFlowTemplateV__DeletePacketFilter_template& TrafficFlowTemplateV_template::trafficFlowTemplateV__DeletePacketFilter() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field trafficFlowTemplateV_DeletePacketFilter in a non-specific template of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
if (single_value.union_selection != TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter) TTCN_error("Accessing non-selected field trafficFlowTemplateV_DeletePacketFilter in a template of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
return *single_value.field_trafficFlowTemplateV__DeletePacketFilter;
}

TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template& TrafficFlowTemplateV_template::trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template(ANY_VALUE);
else single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template;
single_value.union_selection = TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
}

const TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template& TrafficFlowTemplateV_template::trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation in a non-specific template of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
if (single_value.union_selection != TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation) TTCN_error("Accessing non-selected field trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation in a template of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
return *single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation;
}

boolean TrafficFlowTemplateV_template::ischosen(TrafficFlowTemplateV::union_selection_type checked_selection) const
{
if (checked_selection == TrafficFlowTemplateV::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TrafficFlowTemplateV::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.TrafficFlowTemplateV.");
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.TrafficFlowTemplateV 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 TrafficFlowTemplateV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_CreateAddReplaceTFT := ");
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->log();
TTCN_Logger::log_event_str(" }");
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_DeletePacketFilter := ");
single_value.field_trafficFlowTemplateV__DeletePacketFilter->log();
TTCN_Logger::log_event_str(" }");
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation := ");
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->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 TrafficFlowTemplateV_template::log_match(const TrafficFlowTemplateV& 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 TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".trafficFlowTemplateV_CreateAddReplaceTFT");
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->log_match(match_value.trafficFlowTemplateV__CreateAddReplaceTFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_CreateAddReplaceTFT := ");
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->log_match(match_value.trafficFlowTemplateV__CreateAddReplaceTFT(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".trafficFlowTemplateV_DeletePacketFilter");
single_value.field_trafficFlowTemplateV__DeletePacketFilter->log_match(match_value.trafficFlowTemplateV__DeletePacketFilter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_DeletePacketFilter := ");
single_value.field_trafficFlowTemplateV__DeletePacketFilter->log_match(match_value.trafficFlowTemplateV__DeletePacketFilter(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation");
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->log_match(match_value.trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation := ");
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->log_match(match_value.trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation(), 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 TrafficFlowTemplateV_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 TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->encode_text(text_buf);
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
single_value.field_trafficFlowTemplateV__DeletePacketFilter->encode_text(text_buf);
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->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.TrafficFlowTemplateV.");
}
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.TrafficFlowTemplateV.");
}
}

void TrafficFlowTemplateV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TrafficFlowTemplateV::UNBOUND_VALUE;
TrafficFlowTemplateV::union_selection_type new_selection = (TrafficFlowTemplateV::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT = new TrafficFlowTemplateV__CreateAddReplaceTFT_template;
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->decode_text(text_buf);
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
single_value.field_trafficFlowTemplateV__DeletePacketFilter = new TrafficFlowTemplateV__DeletePacketFilter_template;
single_value.field_trafficFlowTemplateV__DeletePacketFilter->decode_text(text_buf);
break;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation = new TrafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation_template;
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.");
}
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 TrafficFlowTemplateV_template[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.TrafficFlowTemplateV.");
}
}

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

boolean TrafficFlowTemplateV_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 TrafficFlowTemplateV_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.TrafficFlowTemplateV'");
    }
    if (strcmp("trafficFlowTemplateV_CreateAddReplaceTFT", param_field) == 0) {
      trafficFlowTemplateV__CreateAddReplaceTFT().set_param(param);
      return;
    } else if (strcmp("trafficFlowTemplateV_DeletePacketFilter", param_field) == 0) {
      trafficFlowTemplateV__DeletePacketFilter().set_param(param);
      return;
    } else if (strcmp("trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation", param_field) == 0) {
      trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_GMM_SM_Types.TrafficFlowTemplateV'", 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: {
    TrafficFlowTemplateV_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.TrafficFlowTemplateV");
    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, "trafficFlowTemplateV_CreateAddReplaceTFT")) {
      trafficFlowTemplateV__CreateAddReplaceTFT().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "trafficFlowTemplateV_DeletePacketFilter")) {
      trafficFlowTemplateV__DeletePacketFilter().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation")) {
      trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_GMM_SM_Types.TrafficFlowTemplateV.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TrafficFlowTemplateV_template* precondition = new TrafficFlowTemplateV_template;
    precondition->set_param(*m_p->get_elem(0));
    TrafficFlowTemplateV_template* implied_template = new TrafficFlowTemplateV_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TrafficFlowTemplateV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrafficFlowTemplateV_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 TrafficFlowTemplateV::ALT_trafficFlowTemplateV__CreateAddReplaceTFT:
single_value.field_trafficFlowTemplateV__CreateAddReplaceTFT->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV");
return;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__DeletePacketFilter:
single_value.field_trafficFlowTemplateV__DeletePacketFilter->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV");
return;
case TrafficFlowTemplateV::ALT_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation:
single_value.field_trafficFlowTemplateV__Delete__Existing__TFT__or__No__TFT__Operation->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.TrafficFlowTemplateV");
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.TrafficFlowTemplateV.");
}
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");
}


const PacketFilter PacketFilterList__CreateAddReplaceTFT::UNBOUND_ELEM;
PacketFilterList__CreateAddReplaceTFT::PacketFilterList__CreateAddReplaceTFT()
{
val_ptr = NULL;
}

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

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

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

void PacketFilterList__CreateAddReplaceTFT::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__CreateAddReplaceTFT& PacketFilterList__CreateAddReplaceTFT::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__CreateAddReplaceTFT& PacketFilterList__CreateAddReplaceTFT::operator=(const PacketFilterList__CreateAddReplaceTFT& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean PacketFilterList__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
return val_ptr->n_elements == 0 ;
}

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

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

PacketFilter& PacketFilterList__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
return (*this)[(int)index_value];
}

const PacketFilter& PacketFilterList__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
if (index_value < 0) TTCN_error("Accessing an element of type @MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT 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_CreateAddReplaceTFT: 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 PacketFilter& PacketFilterList__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
return (*this)[(int)index_value];
}

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

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

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

PacketFilterList__CreateAddReplaceTFT PacketFilterList__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
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__CreateAddReplaceTFT 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 PacketFilter(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

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

PacketFilterList__CreateAddReplaceTFT PacketFilterList__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT","element");
PacketFilterList__CreateAddReplaceTFT 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 PacketFilter(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

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

PacketFilterList__CreateAddReplaceTFT PacketFilterList__CreateAddReplaceTFT::replace(int index, int len, const PacketFilterList__CreateAddReplaceTFT_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__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
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 = (PacketFilter**)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 PacketFilter(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (PacketFilter**)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_CreateAddReplaceTFT: %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 = (PacketFilter**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

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

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

void PacketFilterList__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
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__CreateAddReplaceTFT::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_CreateAddReplaceTFT.");
val_ptr->value_elements = (PacketFilter**)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 PacketFilter;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void PacketFilterList__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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PacketFilterList__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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PacketFilterList__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 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__CreateAddReplaceTFT::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__CreateAddReplaceTFT_template::copy_value(const PacketFilterList__CreateAddReplaceTFT& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (PacketFilter_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 PacketFilter_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new PacketFilter_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void PacketFilterList__CreateAddReplaceTFT_template::copy_template(const PacketFilterList__CreateAddReplaceTFT_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 = (PacketFilter_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 PacketFilter_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new PacketFilter_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__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 PacketFilterList__CreateAddReplaceTFT_template(*other_value.implication_.precondition);
implication_.implied_template = new PacketFilterList__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.PacketFilterList_CreateAddReplaceTFT.");
break;
}
set_selection(other_value);
}

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

PacketFilterList__CreateAddReplaceTFT_template::PacketFilterList__CreateAddReplaceTFT_template()
{
}

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

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

PacketFilterList__CreateAddReplaceTFT_template::PacketFilterList__CreateAddReplaceTFT_template(const PacketFilterList__CreateAddReplaceTFT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void PacketFilterList__CreateAddReplaceTFT_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__CreateAddReplaceTFT_template& PacketFilterList__CreateAddReplaceTFT_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

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

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

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

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

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

PacketFilter_template& PacketFilterList__CreateAddReplaceTFT_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_CreateAddReplaceTFT.");
return (*this)[(int)index_value];
}

const PacketFilter_template& PacketFilterList__CreateAddReplaceTFT_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_CreateAddReplaceTFT 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_CreateAddReplaceTFT.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT: 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 PacketFilter_template& PacketFilterList__CreateAddReplaceTFT_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_CreateAddReplaceTFT.");
return (*this)[(int)index_value];
}

void PacketFilterList__CreateAddReplaceTFT_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_CreateAddReplaceTFT.");
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 = (PacketFilter_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 PacketFilter_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 PacketFilter_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 = (PacketFilter_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

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

boolean PacketFilterList__CreateAddReplaceTFT_template::match(const PacketFilterList__CreateAddReplaceTFT& 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_CreateAddReplaceTFT.");
}
return FALSE;
}

boolean PacketFilterList__CreateAddReplaceTFT_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__CreateAddReplaceTFT PacketFilterList__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.PacketFilterList_CreateAddReplaceTFT.");
PacketFilterList__CreateAddReplaceTFT 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__CreateAddReplaceTFT PacketFilterList__CreateAddReplaceTFT_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__CreateAddReplaceTFT PacketFilterList__CreateAddReplaceTFT_template::replace(int index, int len, const PacketFilterList__CreateAddReplaceTFT_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__CreateAddReplaceTFT PacketFilterList__CreateAddReplaceTFT_template::replace(int index, int len, const PacketFilterList__CreateAddReplaceTFT& 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__CreateAddReplaceTFT_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__CreateAddReplaceTFT_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT.");
}
set_selection(template_type);
}

PacketFilterList__CreateAddReplaceTFT_template& PacketFilterList__CreateAddReplaceTFT_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_CreateAddReplaceTFT.");
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_CreateAddReplaceTFT.");
return value_list.list_value[list_index];
}

void PacketFilterList__CreateAddReplaceTFT_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__CreateAddReplaceTFT_template::log_match(const PacketFilterList__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 && 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__CreateAddReplaceTFT_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_CreateAddReplaceTFT.");
}
}

void PacketFilterList__CreateAddReplaceTFT_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_CreateAddReplaceTFT.");
single_value.value_elements = (PacketFilter_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 PacketFilter_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__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 for a template of type @MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT.");
}
}

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

boolean PacketFilterList__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 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__CreateAddReplaceTFT_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__CreateAddReplaceTFT_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__CreateAddReplaceTFT_template* precondition = new PacketFilterList__CreateAddReplaceTFT_template;
    precondition->set_param(*param.get_elem(0));
    PacketFilterList__CreateAddReplaceTFT_template* implied_template = new PacketFilterList__CreateAddReplaceTFT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PacketFilterList__CreateAddReplaceTFT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@MobileL3_GMM_SM_Types.PacketFilterList_CreateAddReplaceTFT");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void PacketFilterList__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;
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_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.PacketFilterList_CreateAddReplaceTFT");
}

boolean PacketFilterList__CreateAddReplaceTFT_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__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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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_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;}
  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;}
  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::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;}
  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;}
  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_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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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_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;}
  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;}
  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::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;}
  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;}
  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_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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;
}


} /* end of namespace */
