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

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

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

/* Including header files */

#include "MobileL3_SMS_Types.hh"

namespace MobileL3__SMS__Types {

/* Member functions of C++ classes */

void RPDU__SGSN__MS::copy_value(const RPDU__SGSN__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_rP__DATA__SGSN__MS:
field_rP__DATA__SGSN__MS = new RP__DATA__SGSN__MS(*other_value.field_rP__DATA__SGSN__MS);
break;
case ALT_rP__ACK__SGSN__MS:
field_rP__ACK__SGSN__MS = new RP__ACK__SGSN__MS(*other_value.field_rP__ACK__SGSN__MS);
break;
case ALT_rP__ERROR__SGSN__MS:
field_rP__ERROR__SGSN__MS = new RP__ERROR__SGSN__MS(*other_value.field_rP__ERROR__SGSN__MS);
break;
case ALT_rP__SMMA:
field_rP__SMMA = new RP__SMMA(*other_value.field_rP__SMMA);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean RPDU__SGSN__MS::operator==(const RPDU__SGSN__MS& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rP__DATA__SGSN__MS:
return *field_rP__DATA__SGSN__MS == *other_value.field_rP__DATA__SGSN__MS;
case ALT_rP__ACK__SGSN__MS:
return *field_rP__ACK__SGSN__MS == *other_value.field_rP__ACK__SGSN__MS;
case ALT_rP__ERROR__SGSN__MS:
return *field_rP__ERROR__SGSN__MS == *other_value.field_rP__ERROR__SGSN__MS;
case ALT_rP__SMMA:
return *field_rP__SMMA == *other_value.field_rP__SMMA;
default:
return FALSE;
}
}

RP__DATA__SGSN__MS& RPDU__SGSN__MS::rP__DATA__SGSN__MS()
{
if (union_selection != ALT_rP__DATA__SGSN__MS) {
clean_up();
field_rP__DATA__SGSN__MS = new RP__DATA__SGSN__MS;
union_selection = ALT_rP__DATA__SGSN__MS;
}
return *field_rP__DATA__SGSN__MS;
}

const RP__DATA__SGSN__MS& RPDU__SGSN__MS::rP__DATA__SGSN__MS() const
{
if (union_selection != ALT_rP__DATA__SGSN__MS) TTCN_error("Using non-selected field rP_DATA_SGSN_MS in a value of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *field_rP__DATA__SGSN__MS;
}

RP__ACK__SGSN__MS& RPDU__SGSN__MS::rP__ACK__SGSN__MS()
{
if (union_selection != ALT_rP__ACK__SGSN__MS) {
clean_up();
field_rP__ACK__SGSN__MS = new RP__ACK__SGSN__MS;
union_selection = ALT_rP__ACK__SGSN__MS;
}
return *field_rP__ACK__SGSN__MS;
}

const RP__ACK__SGSN__MS& RPDU__SGSN__MS::rP__ACK__SGSN__MS() const
{
if (union_selection != ALT_rP__ACK__SGSN__MS) TTCN_error("Using non-selected field rP_ACK_SGSN_MS in a value of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *field_rP__ACK__SGSN__MS;
}

RP__ERROR__SGSN__MS& RPDU__SGSN__MS::rP__ERROR__SGSN__MS()
{
if (union_selection != ALT_rP__ERROR__SGSN__MS) {
clean_up();
field_rP__ERROR__SGSN__MS = new RP__ERROR__SGSN__MS;
union_selection = ALT_rP__ERROR__SGSN__MS;
}
return *field_rP__ERROR__SGSN__MS;
}

const RP__ERROR__SGSN__MS& RPDU__SGSN__MS::rP__ERROR__SGSN__MS() const
{
if (union_selection != ALT_rP__ERROR__SGSN__MS) TTCN_error("Using non-selected field rP_ERROR_SGSN_MS in a value of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *field_rP__ERROR__SGSN__MS;
}

RP__SMMA& RPDU__SGSN__MS::rP__SMMA()
{
if (union_selection != ALT_rP__SMMA) {
clean_up();
field_rP__SMMA = new RP__SMMA;
union_selection = ALT_rP__SMMA;
}
return *field_rP__SMMA;
}

const RP__SMMA& RPDU__SGSN__MS::rP__SMMA() const
{
if (union_selection != ALT_rP__SMMA) TTCN_error("Using non-selected field rP_SMMA in a value of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *field_rP__SMMA;
}

boolean RPDU__SGSN__MS::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_SMS_Types.RPDU_SGSN_MS.");
return union_selection == checked_selection;
}

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

boolean RPDU__SGSN__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rP__DATA__SGSN__MS: return field_rP__DATA__SGSN__MS->is_value();
case ALT_rP__ACK__SGSN__MS: return field_rP__ACK__SGSN__MS->is_value();
case ALT_rP__ERROR__SGSN__MS: return field_rP__ERROR__SGSN__MS->is_value();
case ALT_rP__SMMA: return field_rP__SMMA->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void RPDU__SGSN__MS::clean_up()
{
switch (union_selection) {
case ALT_rP__DATA__SGSN__MS:
  delete field_rP__DATA__SGSN__MS;
  break;
case ALT_rP__ACK__SGSN__MS:
  delete field_rP__ACK__SGSN__MS;
  break;
case ALT_rP__ERROR__SGSN__MS:
  delete field_rP__ERROR__SGSN__MS;
  break;
case ALT_rP__SMMA:
  delete field_rP__SMMA;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void RPDU__SGSN__MS::log() const
{
switch (union_selection) {
case ALT_rP__DATA__SGSN__MS:
TTCN_Logger::log_event_str("{ rP_DATA_SGSN_MS := ");
field_rP__DATA__SGSN__MS->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rP__ACK__SGSN__MS:
TTCN_Logger::log_event_str("{ rP_ACK_SGSN_MS := ");
field_rP__ACK__SGSN__MS->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rP__ERROR__SGSN__MS:
TTCN_Logger::log_event_str("{ rP_ERROR_SGSN_MS := ");
field_rP__ERROR__SGSN__MS->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rP__SMMA:
TTCN_Logger::log_event_str("{ rP_SMMA := ");
field_rP__SMMA->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void RPDU__SGSN__MS::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, "rP_DATA_SGSN_MS")) {
    rP__DATA__SGSN__MS().set_param(*mp_last);
    if (!rP__DATA__SGSN__MS().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rP_ACK_SGSN_MS")) {
    rP__ACK__SGSN__MS().set_param(*mp_last);
    if (!rP__ACK__SGSN__MS().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rP_ERROR_SGSN_MS")) {
    rP__ERROR__SGSN__MS().set_param(*mp_last);
    if (!rP__ERROR__SGSN__MS().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rP_SMMA")) {
    rP__SMMA().set_param(*mp_last);
    if (!rP__SMMA().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.RPDU_SGSN_MS.", last_name);
}

void RPDU__SGSN__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_rP__DATA__SGSN__MS:
field_rP__DATA__SGSN__MS->set_implicit_omit(); break;
case ALT_rP__ACK__SGSN__MS:
field_rP__ACK__SGSN__MS->set_implicit_omit(); break;
case ALT_rP__ERROR__SGSN__MS:
field_rP__ERROR__SGSN__MS->set_implicit_omit(); break;
case ALT_rP__SMMA:
field_rP__SMMA->set_implicit_omit(); break;
default: break;
}
}

void RPDU__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rP__DATA__SGSN__MS:
field_rP__DATA__SGSN__MS->encode_text(text_buf);
break;
case ALT_rP__ACK__SGSN__MS:
field_rP__ACK__SGSN__MS->encode_text(text_buf);
break;
case ALT_rP__ERROR__SGSN__MS:
field_rP__ERROR__SGSN__MS->encode_text(text_buf);
break;
case ALT_rP__SMMA:
field_rP__SMMA->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
}

void RPDU__SGSN__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rP__DATA__SGSN__MS:
rP__DATA__SGSN__MS().decode_text(text_buf);
break;
case ALT_rP__ACK__SGSN__MS:
rP__ACK__SGSN__MS().decode_text(text_buf);
break;
case ALT_rP__ERROR__SGSN__MS:
rP__ERROR__SGSN__MS().decode_text(text_buf);
break;
case ALT_rP__SMMA:
rP__SMMA().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
}

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

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

int RPDU__SGSN__MS::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int 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, RP__DATA__SGSN__MS_descr_.raw->forceomit);
      decoded_length = rP__DATA__SGSN__MS().RAW_decode(RP__DATA__SGSN__MS_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, RP__ACK__SGSN__MS_descr_.raw->forceomit);
      decoded_length = rP__ACK__SGSN__MS().RAW_decode(RP__ACK__SGSN__MS_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, RP__ERROR__SGSN__MS_descr_.raw->forceomit);
      decoded_length = rP__ERROR__SGSN__MS().RAW_decode(RP__ERROR__SGSN__MS_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, RP__SMMA_descr_.raw->forceomit);
      decoded_length = rP__SMMA().RAW_decode(RP__SMMA_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 {
    boolean already_failed = FALSE;
    BITSTRING temporal_0;
    int decoded_0_length;
    already_failed = FALSE;
    if (!already_failed) {
      p_buf.set_pos_bit(starting_pos + 0);
      decoded_0_length = temporal_0.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_5) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, RP__DATA__SGSN__MS_descr_.raw->forceomit);
          decoded_length = rP__DATA__SGSN__MS().RAW_decode(RP__DATA__SGSN__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rP__DATA__SGSN__MS).rP__MTI() ==  bs_5) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_7) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(1, force_omit, RP__ACK__SGSN__MS_descr_.raw->forceomit);
          decoded_length = rP__ACK__SGSN__MS().RAW_decode(RP__ACK__SGSN__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rP__ACK__SGSN__MS).rP__MTI() ==  bs_7) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_8) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(2, force_omit, RP__ERROR__SGSN__MS_descr_.raw->forceomit);
          decoded_length = rP__ERROR__SGSN__MS().RAW_decode(RP__ERROR__SGSN__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rP__ERROR__SGSN__MS).rP__MTI() ==  bs_8) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_9) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(3, force_omit, RP__SMMA_descr_.raw->forceomit);
          decoded_length = rP__SMMA().RAW_decode(RP__SMMA_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rP__SMMA).rP__MTI() ==  bs_9) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int RPDU__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  memset(myleaf.body.node.nodes, 0, 4 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_rP__DATA__SGSN__MS:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RP__DATA__SGSN__MS_descr_.raw);
    encoded_length = field_rP__DATA__SGSN__MS->RAW_encode(RP__DATA__SGSN__MS_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RP__DATA__SGSN__MS_descr_;
    if ((*field_rP__DATA__SGSN__MS).rP__MTI() !=  bs_5) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_5.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);
  }
    }
    break;
  case ALT_rP__ACK__SGSN__MS:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RP__ACK__SGSN__MS_descr_.raw);
    encoded_length = field_rP__ACK__SGSN__MS->RAW_encode(RP__ACK__SGSN__MS_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RP__ACK__SGSN__MS_descr_;
    if ((*field_rP__ACK__SGSN__MS).rP__MTI() !=  bs_7) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_7.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);
  }
    }
    break;
  case ALT_rP__ERROR__SGSN__MS:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, RP__ERROR__SGSN__MS_descr_.raw);
    encoded_length = field_rP__ERROR__SGSN__MS->RAW_encode(RP__ERROR__SGSN__MS_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &RP__ERROR__SGSN__MS_descr_;
    if ((*field_rP__ERROR__SGSN__MS).rP__MTI() !=  bs_8) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_8.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);
  }
    }
    break;
  case ALT_rP__SMMA:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, RP__SMMA_descr_.raw);
    encoded_length = field_rP__SMMA->RAW_encode(RP__SMMA_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &RP__SMMA_descr_;
    if ((*field_rP__SMMA).rP__MTI() !=  bs_9) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_9.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);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void RPDU__SGSN__MS_template::copy_value(const RPDU__SGSN__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
single_value.field_rP__DATA__SGSN__MS = new RP__DATA__SGSN__MS_template(other_value.rP__DATA__SGSN__MS());
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
single_value.field_rP__ACK__SGSN__MS = new RP__ACK__SGSN__MS_template(other_value.rP__ACK__SGSN__MS());
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
single_value.field_rP__ERROR__SGSN__MS = new RP__ERROR__SGSN__MS_template(other_value.rP__ERROR__SGSN__MS());
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
single_value.field_rP__SMMA = new RP__SMMA_template(other_value.rP__SMMA());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void RPDU__SGSN__MS_template::copy_template(const RPDU__SGSN__MS_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 RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
single_value.field_rP__DATA__SGSN__MS = new RP__DATA__SGSN__MS_template(*other_value.single_value.field_rP__DATA__SGSN__MS);
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
single_value.field_rP__ACK__SGSN__MS = new RP__ACK__SGSN__MS_template(*other_value.single_value.field_rP__ACK__SGSN__MS);
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
single_value.field_rP__ERROR__SGSN__MS = new RP__ERROR__SGSN__MS_template(*other_value.single_value.field_rP__ERROR__SGSN__MS);
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
single_value.field_rP__SMMA = new RP__SMMA_template(*other_value.single_value.field_rP__SMMA);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
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 RPDU__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RPDU__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new RPDU__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
set_selection(other_value);
}

RPDU__SGSN__MS_template::RPDU__SGSN__MS_template()
{
}

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

RPDU__SGSN__MS_template::RPDU__SGSN__MS_template(const RPDU__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void RPDU__SGSN__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
delete single_value.field_rP__DATA__SGSN__MS;
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
delete single_value.field_rP__ACK__SGSN__MS;
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
delete single_value.field_rP__ERROR__SGSN__MS;
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
delete single_value.field_rP__SMMA;
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;
}

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

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

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

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

boolean RPDU__SGSN__MS_template::match(const RPDU__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
RPDU__SGSN__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == RPDU__SGSN__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
return single_value.field_rP__DATA__SGSN__MS->match(other_value.rP__DATA__SGSN__MS(), legacy);
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
return single_value.field_rP__ACK__SGSN__MS->match(other_value.rP__ACK__SGSN__MS(), legacy);
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
return single_value.field_rP__ERROR__SGSN__MS->match(other_value.rP__ERROR__SGSN__MS(), legacy);
case RPDU__SGSN__MS::ALT_rP__SMMA:
return single_value.field_rP__SMMA->match(other_value.rP__SMMA(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
}
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_SMS_Types.RPDU_SGSN_MS.");
}
return FALSE;
}

boolean RPDU__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
return single_value.field_rP__DATA__SGSN__MS->is_value();
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
return single_value.field_rP__ACK__SGSN__MS->is_value();
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
return single_value.field_rP__ERROR__SGSN__MS->is_value();
case RPDU__SGSN__MS::ALT_rP__SMMA:
return single_value.field_rP__SMMA->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_SMS_Types.RPDU_SGSN_MS.");
}
}

RPDU__SGSN__MS RPDU__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
RPDU__SGSN__MS ret_val;
switch (single_value.union_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
ret_val.rP__DATA__SGSN__MS() = single_value.field_rP__DATA__SGSN__MS->valueof();
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
ret_val.rP__ACK__SGSN__MS() = single_value.field_rP__ACK__SGSN__MS->valueof();
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
ret_val.rP__ERROR__SGSN__MS() = single_value.field_rP__ERROR__SGSN__MS->valueof();
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
ret_val.rP__SMMA() = single_value.field_rP__SMMA->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
return ret_val;
}

RPDU__SGSN__MS_template& RPDU__SGSN__MS_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_SMS_Types.RPDU_SGSN_MS.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return value_list.list_value[list_index];
}
void RPDU__SGSN__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RPDU__SGSN__MS_template[list_length];
}

RP__DATA__SGSN__MS_template& RPDU__SGSN__MS_template::rP__DATA__SGSN__MS()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rP__DATA__SGSN__MS = new RP__DATA__SGSN__MS_template(ANY_VALUE);
else single_value.field_rP__DATA__SGSN__MS = new RP__DATA__SGSN__MS_template;
single_value.union_selection = RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__DATA__SGSN__MS;
}

const RP__DATA__SGSN__MS_template& RPDU__SGSN__MS_template::rP__DATA__SGSN__MS() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rP_DATA_SGSN_MS in a non-specific template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
if (single_value.union_selection != RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS) TTCN_error("Accessing non-selected field rP_DATA_SGSN_MS in a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *single_value.field_rP__DATA__SGSN__MS;
}

RP__ACK__SGSN__MS_template& RPDU__SGSN__MS_template::rP__ACK__SGSN__MS()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rP__ACK__SGSN__MS = new RP__ACK__SGSN__MS_template(ANY_VALUE);
else single_value.field_rP__ACK__SGSN__MS = new RP__ACK__SGSN__MS_template;
single_value.union_selection = RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__ACK__SGSN__MS;
}

const RP__ACK__SGSN__MS_template& RPDU__SGSN__MS_template::rP__ACK__SGSN__MS() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rP_ACK_SGSN_MS in a non-specific template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
if (single_value.union_selection != RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS) TTCN_error("Accessing non-selected field rP_ACK_SGSN_MS in a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *single_value.field_rP__ACK__SGSN__MS;
}

RP__ERROR__SGSN__MS_template& RPDU__SGSN__MS_template::rP__ERROR__SGSN__MS()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rP__ERROR__SGSN__MS = new RP__ERROR__SGSN__MS_template(ANY_VALUE);
else single_value.field_rP__ERROR__SGSN__MS = new RP__ERROR__SGSN__MS_template;
single_value.union_selection = RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__ERROR__SGSN__MS;
}

const RP__ERROR__SGSN__MS_template& RPDU__SGSN__MS_template::rP__ERROR__SGSN__MS() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rP_ERROR_SGSN_MS in a non-specific template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
if (single_value.union_selection != RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS) TTCN_error("Accessing non-selected field rP_ERROR_SGSN_MS in a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *single_value.field_rP__ERROR__SGSN__MS;
}

RP__SMMA_template& RPDU__SGSN__MS_template::rP__SMMA()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__SGSN__MS::ALT_rP__SMMA) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rP__SMMA = new RP__SMMA_template(ANY_VALUE);
else single_value.field_rP__SMMA = new RP__SMMA_template;
single_value.union_selection = RPDU__SGSN__MS::ALT_rP__SMMA;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__SMMA;
}

const RP__SMMA_template& RPDU__SGSN__MS_template::rP__SMMA() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rP_SMMA in a non-specific template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
if (single_value.union_selection != RPDU__SGSN__MS::ALT_rP__SMMA) TTCN_error("Accessing non-selected field rP_SMMA in a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
return *single_value.field_rP__SMMA;
}

boolean RPDU__SGSN__MS_template::ischosen(RPDU__SGSN__MS::union_selection_type checked_selection) const
{
if (checked_selection == RPDU__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == RPDU__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
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_SMS_Types.RPDU_SGSN_MS 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 RPDU__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
TTCN_Logger::log_event_str("{ rP_DATA_SGSN_MS := ");
single_value.field_rP__DATA__SGSN__MS->log();
TTCN_Logger::log_event_str(" }");
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
TTCN_Logger::log_event_str("{ rP_ACK_SGSN_MS := ");
single_value.field_rP__ACK__SGSN__MS->log();
TTCN_Logger::log_event_str(" }");
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
TTCN_Logger::log_event_str("{ rP_ERROR_SGSN_MS := ");
single_value.field_rP__ERROR__SGSN__MS->log();
TTCN_Logger::log_event_str(" }");
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
TTCN_Logger::log_event_str("{ rP_SMMA := ");
single_value.field_rP__SMMA->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 RPDU__SGSN__MS_template::log_match(const RPDU__SGSN__MS& 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 RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rP_DATA_SGSN_MS");
single_value.field_rP__DATA__SGSN__MS->log_match(match_value.rP__DATA__SGSN__MS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rP_DATA_SGSN_MS := ");
single_value.field_rP__DATA__SGSN__MS->log_match(match_value.rP__DATA__SGSN__MS(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rP_ACK_SGSN_MS");
single_value.field_rP__ACK__SGSN__MS->log_match(match_value.rP__ACK__SGSN__MS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rP_ACK_SGSN_MS := ");
single_value.field_rP__ACK__SGSN__MS->log_match(match_value.rP__ACK__SGSN__MS(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rP_ERROR_SGSN_MS");
single_value.field_rP__ERROR__SGSN__MS->log_match(match_value.rP__ERROR__SGSN__MS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rP_ERROR_SGSN_MS := ");
single_value.field_rP__ERROR__SGSN__MS->log_match(match_value.rP__ERROR__SGSN__MS(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rP_SMMA");
single_value.field_rP__SMMA->log_match(match_value.rP__SMMA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rP_SMMA := ");
single_value.field_rP__SMMA->log_match(match_value.rP__SMMA(), 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 RPDU__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
single_value.field_rP__DATA__SGSN__MS->set_implicit_omit(); break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
single_value.field_rP__ACK__SGSN__MS->set_implicit_omit(); break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
single_value.field_rP__ERROR__SGSN__MS->set_implicit_omit(); break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
single_value.field_rP__SMMA->set_implicit_omit(); break;
default: break;
}
}

void RPDU__SGSN__MS_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 RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
single_value.field_rP__DATA__SGSN__MS->encode_text(text_buf);
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
single_value.field_rP__ACK__SGSN__MS->encode_text(text_buf);
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
single_value.field_rP__ERROR__SGSN__MS->encode_text(text_buf);
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
single_value.field_rP__SMMA->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
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_SMS_Types.RPDU_SGSN_MS.");
}
}

void RPDU__SGSN__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = RPDU__SGSN__MS::UNBOUND_VALUE;
RPDU__SGSN__MS::union_selection_type new_selection = (RPDU__SGSN__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
single_value.field_rP__DATA__SGSN__MS = new RP__DATA__SGSN__MS_template;
single_value.field_rP__DATA__SGSN__MS->decode_text(text_buf);
break;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
single_value.field_rP__ACK__SGSN__MS = new RP__ACK__SGSN__MS_template;
single_value.field_rP__ACK__SGSN__MS->decode_text(text_buf);
break;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
single_value.field_rP__ERROR__SGSN__MS = new RP__ERROR__SGSN__MS_template;
single_value.field_rP__ERROR__SGSN__MS->decode_text(text_buf);
break;
case RPDU__SGSN__MS::ALT_rP__SMMA:
single_value.field_rP__SMMA = new RP__SMMA_template;
single_value.field_rP__SMMA->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
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 RPDU__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
}

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

boolean RPDU__SGSN__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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 RPDU__SGSN__MS_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_SMS_Types.RPDU_SGSN_MS'");
    }
    if (strcmp("rP_DATA_SGSN_MS", param_field) == 0) {
      rP__DATA__SGSN__MS().set_param(param);
      return;
    } else if (strcmp("rP_ACK_SGSN_MS", param_field) == 0) {
      rP__ACK__SGSN__MS().set_param(param);
      return;
    } else if (strcmp("rP_ERROR_SGSN_MS", param_field) == 0) {
      rP__ERROR__SGSN__MS().set_param(param);
      return;
    } else if (strcmp("rP_SMMA", param_field) == 0) {
      rP__SMMA().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.RPDU_SGSN_MS'", 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: {
    RPDU__SGSN__MS_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_SMS_Types.RPDU_SGSN_MS");
    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, "rP_DATA_SGSN_MS")) {
      rP__DATA__SGSN__MS().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rP_ACK_SGSN_MS")) {
      rP__ACK__SGSN__MS().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rP_ERROR_SGSN_MS")) {
      rP__ERROR__SGSN__MS().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rP_SMMA")) {
      rP__SMMA().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.RPDU_SGSN_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    RPDU__SGSN__MS_template* precondition = new RPDU__SGSN__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    RPDU__SGSN__MS_template* implied_template = new RPDU__SGSN__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RPDU__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.RPDU_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void RPDU__SGSN__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case RPDU__SGSN__MS::ALT_rP__DATA__SGSN__MS:
single_value.field_rP__DATA__SGSN__MS->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_SGSN_MS");
return;
case RPDU__SGSN__MS::ALT_rP__ACK__SGSN__MS:
single_value.field_rP__ACK__SGSN__MS->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_SGSN_MS");
return;
case RPDU__SGSN__MS::ALT_rP__ERROR__SGSN__MS:
single_value.field_rP__ERROR__SGSN__MS->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_SGSN_MS");
return;
case RPDU__SGSN__MS::ALT_rP__SMMA:
single_value.field_rP__SMMA->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_SGSN_MS");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_SMS_Types.RPDU_SGSN_MS.");
}
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_SMS_Types.RPDU_SGSN_MS");
}

void TPDU__RP__DATA__SGSN__MS::copy_value(const TPDU__RP__DATA__SGSN__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_sMS__DELIVER:
field_sMS__DELIVER = new SMS__DELIVER(*other_value.field_sMS__DELIVER);
break;
case ALT_sMS__STATUS__REPORT:
field_sMS__STATUS__REPORT = new SMS__STATUS__REPORT(*other_value.field_sMS__STATUS__REPORT);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TPDU__RP__DATA__SGSN__MS::operator==(const TPDU__RP__DATA__SGSN__MS& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sMS__DELIVER:
return *field_sMS__DELIVER == *other_value.field_sMS__DELIVER;
case ALT_sMS__STATUS__REPORT:
return *field_sMS__STATUS__REPORT == *other_value.field_sMS__STATUS__REPORT;
default:
return FALSE;
}
}

SMS__DELIVER& TPDU__RP__DATA__SGSN__MS::sMS__DELIVER()
{
if (union_selection != ALT_sMS__DELIVER) {
clean_up();
field_sMS__DELIVER = new SMS__DELIVER;
union_selection = ALT_sMS__DELIVER;
}
return *field_sMS__DELIVER;
}

const SMS__DELIVER& TPDU__RP__DATA__SGSN__MS::sMS__DELIVER() const
{
if (union_selection != ALT_sMS__DELIVER) TTCN_error("Using non-selected field sMS_DELIVER in a value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
return *field_sMS__DELIVER;
}

SMS__STATUS__REPORT& TPDU__RP__DATA__SGSN__MS::sMS__STATUS__REPORT()
{
if (union_selection != ALT_sMS__STATUS__REPORT) {
clean_up();
field_sMS__STATUS__REPORT = new SMS__STATUS__REPORT;
union_selection = ALT_sMS__STATUS__REPORT;
}
return *field_sMS__STATUS__REPORT;
}

const SMS__STATUS__REPORT& TPDU__RP__DATA__SGSN__MS::sMS__STATUS__REPORT() const
{
if (union_selection != ALT_sMS__STATUS__REPORT) TTCN_error("Using non-selected field sMS_STATUS_REPORT in a value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
return *field_sMS__STATUS__REPORT;
}

boolean TPDU__RP__DATA__SGSN__MS::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_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
return union_selection == checked_selection;
}

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

boolean TPDU__RP__DATA__SGSN__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_sMS__DELIVER: return field_sMS__DELIVER->is_value();
case ALT_sMS__STATUS__REPORT: return field_sMS__STATUS__REPORT->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TPDU__RP__DATA__SGSN__MS::clean_up()
{
switch (union_selection) {
case ALT_sMS__DELIVER:
  delete field_sMS__DELIVER;
  break;
case ALT_sMS__STATUS__REPORT:
  delete field_sMS__STATUS__REPORT;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TPDU__RP__DATA__SGSN__MS::log() const
{
switch (union_selection) {
case ALT_sMS__DELIVER:
TTCN_Logger::log_event_str("{ sMS_DELIVER := ");
field_sMS__DELIVER->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_sMS__STATUS__REPORT:
TTCN_Logger::log_event_str("{ sMS_STATUS_REPORT := ");
field_sMS__STATUS__REPORT->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TPDU__RP__DATA__SGSN__MS::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, "sMS_DELIVER")) {
    sMS__DELIVER().set_param(*mp_last);
    if (!sMS__DELIVER().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "sMS_STATUS_REPORT")) {
    sMS__STATUS__REPORT().set_param(*mp_last);
    if (!sMS__STATUS__REPORT().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.", last_name);
}

void TPDU__RP__DATA__SGSN__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_sMS__DELIVER:
field_sMS__DELIVER->set_implicit_omit(); break;
case ALT_sMS__STATUS__REPORT:
field_sMS__STATUS__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__DATA__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_sMS__DELIVER:
field_sMS__DELIVER->encode_text(text_buf);
break;
case ALT_sMS__STATUS__REPORT:
field_sMS__STATUS__REPORT->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
}

void TPDU__RP__DATA__SGSN__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_sMS__DELIVER:
sMS__DELIVER().decode_text(text_buf);
break;
case ALT_sMS__STATUS__REPORT:
sMS__STATUS__REPORT().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
}

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

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

int TPDU__RP__DATA__SGSN__MS::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int 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, SMS__DELIVER_descr_.raw->forceomit);
      decoded_length = sMS__DELIVER().RAW_decode(SMS__DELIVER_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, SMS__STATUS__REPORT_descr_.raw->forceomit);
      decoded_length = sMS__STATUS__REPORT().RAW_decode(SMS__STATUS__REPORT_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 {
    boolean already_failed = FALSE;
    BITSTRING temporal_0;
    int decoded_0_length;
    already_failed = FALSE;
    if (!already_failed) {
      p_buf.set_pos_bit(starting_pos + 0);
      decoded_0_length = temporal_0.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_3) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, SMS__DELIVER_descr_.raw->forceomit);
          decoded_length = sMS__DELIVER().RAW_decode(SMS__DELIVER_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__DELIVER).tP__MTI() ==  bs_3) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_1) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(1, force_omit, SMS__STATUS__REPORT_descr_.raw->forceomit);
          decoded_length = sMS__STATUS__REPORT().RAW_decode(SMS__STATUS__REPORT_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__STATUS__REPORT).tP__MTI() ==  bs_1) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int TPDU__RP__DATA__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  memset(myleaf.body.node.nodes, 0, 2 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_sMS__DELIVER:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SMS__DELIVER_descr_.raw);
    encoded_length = field_sMS__DELIVER->RAW_encode(SMS__DELIVER_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SMS__DELIVER_descr_;
    if ((*field_sMS__DELIVER).tP__MTI() !=  bs_3) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_3.RAW_encode(General__Types::BIT2_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);
  }
    }
    break;
  case ALT_sMS__STATUS__REPORT:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, SMS__STATUS__REPORT_descr_.raw);
    encoded_length = field_sMS__STATUS__REPORT->RAW_encode(SMS__STATUS__REPORT_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &SMS__STATUS__REPORT_descr_;
    if ((*field_sMS__STATUS__REPORT).tP__MTI() !=  bs_1) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT2_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);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TPDU__RP__DATA__SGSN__MS_template::copy_value(const TPDU__RP__DATA__SGSN__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
single_value.field_sMS__DELIVER = new SMS__DELIVER_template(other_value.sMS__DELIVER());
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
single_value.field_sMS__STATUS__REPORT = new SMS__STATUS__REPORT_template(other_value.sMS__STATUS__REPORT());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void TPDU__RP__DATA__SGSN__MS_template::copy_template(const TPDU__RP__DATA__SGSN__MS_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 TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
single_value.field_sMS__DELIVER = new SMS__DELIVER_template(*other_value.single_value.field_sMS__DELIVER);
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
single_value.field_sMS__STATUS__REPORT = new SMS__STATUS__REPORT_template(*other_value.single_value.field_sMS__STATUS__REPORT);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
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 TPDU__RP__DATA__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TPDU__RP__DATA__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new TPDU__RP__DATA__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
set_selection(other_value);
}

TPDU__RP__DATA__SGSN__MS_template::TPDU__RP__DATA__SGSN__MS_template()
{
}

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

TPDU__RP__DATA__SGSN__MS_template::TPDU__RP__DATA__SGSN__MS_template(const TPDU__RP__DATA__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void TPDU__RP__DATA__SGSN__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
delete single_value.field_sMS__DELIVER;
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
delete single_value.field_sMS__STATUS__REPORT;
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;
}

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

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

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

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

boolean TPDU__RP__DATA__SGSN__MS_template::match(const TPDU__RP__DATA__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
TPDU__RP__DATA__SGSN__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TPDU__RP__DATA__SGSN__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
return single_value.field_sMS__DELIVER->match(other_value.sMS__DELIVER(), legacy);
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
return single_value.field_sMS__STATUS__REPORT->match(other_value.sMS__STATUS__REPORT(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
}
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_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
return FALSE;
}

boolean TPDU__RP__DATA__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
return single_value.field_sMS__DELIVER->is_value();
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
return single_value.field_sMS__STATUS__REPORT->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_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
}

TPDU__RP__DATA__SGSN__MS TPDU__RP__DATA__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
TPDU__RP__DATA__SGSN__MS ret_val;
switch (single_value.union_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
ret_val.sMS__DELIVER() = single_value.field_sMS__DELIVER->valueof();
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
ret_val.sMS__STATUS__REPORT() = single_value.field_sMS__STATUS__REPORT->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
return ret_val;
}

TPDU__RP__DATA__SGSN__MS_template& TPDU__RP__DATA__SGSN__MS_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_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
return value_list.list_value[list_index];
}
void TPDU__RP__DATA__SGSN__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TPDU__RP__DATA__SGSN__MS_template[list_length];
}

SMS__DELIVER_template& TPDU__RP__DATA__SGSN__MS_template::sMS__DELIVER()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__DELIVER = new SMS__DELIVER_template(ANY_VALUE);
else single_value.field_sMS__DELIVER = new SMS__DELIVER_template;
single_value.union_selection = TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__DELIVER;
}

const SMS__DELIVER_template& TPDU__RP__DATA__SGSN__MS_template::sMS__DELIVER() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_DELIVER in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
if (single_value.union_selection != TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER) TTCN_error("Accessing non-selected field sMS_DELIVER in a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
return *single_value.field_sMS__DELIVER;
}

SMS__STATUS__REPORT_template& TPDU__RP__DATA__SGSN__MS_template::sMS__STATUS__REPORT()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__STATUS__REPORT = new SMS__STATUS__REPORT_template(ANY_VALUE);
else single_value.field_sMS__STATUS__REPORT = new SMS__STATUS__REPORT_template;
single_value.union_selection = TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__STATUS__REPORT;
}

const SMS__STATUS__REPORT_template& TPDU__RP__DATA__SGSN__MS_template::sMS__STATUS__REPORT() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_STATUS_REPORT in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
if (single_value.union_selection != TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT) TTCN_error("Accessing non-selected field sMS_STATUS_REPORT in a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
return *single_value.field_sMS__STATUS__REPORT;
}

boolean TPDU__RP__DATA__SGSN__MS_template::ischosen(TPDU__RP__DATA__SGSN__MS::union_selection_type checked_selection) const
{
if (checked_selection == TPDU__RP__DATA__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TPDU__RP__DATA__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
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_SMS_Types.TPDU_RP_DATA_SGSN_MS 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 TPDU__RP__DATA__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
TTCN_Logger::log_event_str("{ sMS_DELIVER := ");
single_value.field_sMS__DELIVER->log();
TTCN_Logger::log_event_str(" }");
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
TTCN_Logger::log_event_str("{ sMS_STATUS_REPORT := ");
single_value.field_sMS__STATUS__REPORT->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 TPDU__RP__DATA__SGSN__MS_template::log_match(const TPDU__RP__DATA__SGSN__MS& 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 TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_DELIVER");
single_value.field_sMS__DELIVER->log_match(match_value.sMS__DELIVER(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_DELIVER := ");
single_value.field_sMS__DELIVER->log_match(match_value.sMS__DELIVER(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_STATUS_REPORT");
single_value.field_sMS__STATUS__REPORT->log_match(match_value.sMS__STATUS__REPORT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_STATUS_REPORT := ");
single_value.field_sMS__STATUS__REPORT->log_match(match_value.sMS__STATUS__REPORT(), 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 TPDU__RP__DATA__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
single_value.field_sMS__DELIVER->set_implicit_omit(); break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
single_value.field_sMS__STATUS__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__DATA__SGSN__MS_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 TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
single_value.field_sMS__DELIVER->encode_text(text_buf);
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
single_value.field_sMS__STATUS__REPORT->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
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_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
}

void TPDU__RP__DATA__SGSN__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TPDU__RP__DATA__SGSN__MS::UNBOUND_VALUE;
TPDU__RP__DATA__SGSN__MS::union_selection_type new_selection = (TPDU__RP__DATA__SGSN__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
single_value.field_sMS__DELIVER = new SMS__DELIVER_template;
single_value.field_sMS__DELIVER->decode_text(text_buf);
break;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
single_value.field_sMS__STATUS__REPORT = new SMS__STATUS__REPORT_template;
single_value.field_sMS__STATUS__REPORT->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
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 TPDU__RP__DATA__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
}

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

boolean TPDU__RP__DATA__SGSN__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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 TPDU__RP__DATA__SGSN__MS_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_SMS_Types.TPDU_RP_DATA_SGSN_MS'");
    }
    if (strcmp("sMS_DELIVER", param_field) == 0) {
      sMS__DELIVER().set_param(param);
      return;
    } else if (strcmp("sMS_STATUS_REPORT", param_field) == 0) {
      sMS__STATUS__REPORT().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS'", 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: {
    TPDU__RP__DATA__SGSN__MS_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_SMS_Types.TPDU_RP_DATA_SGSN_MS");
    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, "sMS_DELIVER")) {
      sMS__DELIVER().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "sMS_STATUS_REPORT")) {
      sMS__STATUS__REPORT().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TPDU__RP__DATA__SGSN__MS_template* precondition = new TPDU__RP__DATA__SGSN__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    TPDU__RP__DATA__SGSN__MS_template* implied_template = new TPDU__RP__DATA__SGSN__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TPDU__RP__DATA__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void TPDU__RP__DATA__SGSN__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__DELIVER:
single_value.field_sMS__DELIVER->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS");
return;
case TPDU__RP__DATA__SGSN__MS::ALT_sMS__STATUS__REPORT:
single_value.field_sMS__STATUS__REPORT->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS.");
}
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_SMS_Types.TPDU_RP_DATA_SGSN_MS");
}

TP__OA__NoPad::TP__OA__NoPad()
{
}

TP__OA__NoPad::TP__OA__NoPad(const INTEGER& par_tP__LengthIndicator,
    const BITSTRING& par_tP__NumberingPlanID,
    const BITSTRING& par_tP__TypeOfNumber,
    const BITSTRING& par_tp__Spare,
    const HEXSTRING& par_tP__OAValue)
  :   field_tP__LengthIndicator(par_tP__LengthIndicator),
  field_tP__NumberingPlanID(par_tP__NumberingPlanID),
  field_tP__TypeOfNumber(par_tP__TypeOfNumber),
  field_tp__Spare(par_tp__Spare),
  field_tP__OAValue(par_tP__OAValue)
{
}

TP__OA__NoPad::TP__OA__NoPad(const TP__OA__NoPad& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_OA_NoPad.");
if (other_value.tP__LengthIndicator().is_bound()) field_tP__LengthIndicator = other_value.tP__LengthIndicator();
else field_tP__LengthIndicator.clean_up();
if (other_value.tP__NumberingPlanID().is_bound()) field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
else field_tP__NumberingPlanID.clean_up();
if (other_value.tP__TypeOfNumber().is_bound()) field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
else field_tP__TypeOfNumber.clean_up();
if (other_value.tp__Spare().is_bound()) field_tp__Spare = other_value.tp__Spare();
else field_tp__Spare.clean_up();
if (other_value.tP__OAValue().is_bound()) field_tP__OAValue = other_value.tP__OAValue();
else field_tP__OAValue.clean_up();
}

void TP__OA__NoPad::clean_up()
{
field_tP__LengthIndicator.clean_up();
field_tP__NumberingPlanID.clean_up();
field_tP__TypeOfNumber.clean_up();
field_tp__Spare.clean_up();
field_tP__OAValue.clean_up();
}

const TTCN_Typedescriptor_t* TP__OA__NoPad::get_descriptor() const { return &TP__OA__NoPad_descr_; }
TP__OA__NoPad& TP__OA__NoPad::operator=(const TP__OA__NoPad& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.TP_OA_NoPad.");
  if (other_value.tP__LengthIndicator().is_bound()) field_tP__LengthIndicator = other_value.tP__LengthIndicator();
  else field_tP__LengthIndicator.clean_up();
  if (other_value.tP__NumberingPlanID().is_bound()) field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
  else field_tP__NumberingPlanID.clean_up();
  if (other_value.tP__TypeOfNumber().is_bound()) field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
  else field_tP__TypeOfNumber.clean_up();
  if (other_value.tp__Spare().is_bound()) field_tp__Spare = other_value.tp__Spare();
  else field_tp__Spare.clean_up();
  if (other_value.tP__OAValue().is_bound()) field_tP__OAValue = other_value.tP__OAValue();
  else field_tP__OAValue.clean_up();
}
return *this;
}

boolean TP__OA__NoPad::operator==(const TP__OA__NoPad& other_value) const
{
return field_tP__LengthIndicator==other_value.field_tP__LengthIndicator
  && field_tP__NumberingPlanID==other_value.field_tP__NumberingPlanID
  && field_tP__TypeOfNumber==other_value.field_tP__TypeOfNumber
  && field_tp__Spare==other_value.field_tp__Spare
  && field_tP__OAValue==other_value.field_tP__OAValue;
}

boolean TP__OA__NoPad::is_bound() const
{
return (field_tP__LengthIndicator.is_bound())
  || (field_tP__NumberingPlanID.is_bound())
  || (field_tP__TypeOfNumber.is_bound())
  || (field_tp__Spare.is_bound())
  || (field_tP__OAValue.is_bound());
}
boolean TP__OA__NoPad::is_value() const
{
return field_tP__LengthIndicator.is_value()
  && field_tP__NumberingPlanID.is_value()
  && field_tP__TypeOfNumber.is_value()
  && field_tp__Spare.is_value()
  && field_tP__OAValue.is_value();
}
void TP__OA__NoPad::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_LengthIndicator := ");
field_tP__LengthIndicator.log();
TTCN_Logger::log_event_str(", tP_NumberingPlanID := ");
field_tP__NumberingPlanID.log();
TTCN_Logger::log_event_str(", tP_TypeOfNumber := ");
field_tP__TypeOfNumber.log();
TTCN_Logger::log_event_str(", tp_Spare := ");
field_tp__Spare.log();
TTCN_Logger::log_event_str(", tP_OAValue := ");
field_tP__OAValue.log();
TTCN_Logger::log_event_str(" }");
}

void TP__OA__NoPad::set_implicit_omit()
{
if (tP__LengthIndicator().is_bound()) tP__LengthIndicator().set_implicit_omit();
if (tP__NumberingPlanID().is_bound()) tP__NumberingPlanID().set_implicit_omit();
if (tP__TypeOfNumber().is_bound()) tP__TypeOfNumber().set_implicit_omit();
if (tp__Spare().is_bound()) tp__Spare().set_implicit_omit();
if (tP__OAValue().is_bound()) tP__OAValue().set_implicit_omit();
}

void TP__OA__NoPad::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_SMS_Types.TP_OA_NoPad 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) tP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__NumberingPlanID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__TypeOfNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tp__Spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__OAValue().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(), "tP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_NumberingPlanID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__NumberingPlanID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_TypeOfNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__TypeOfNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tp_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tp__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(), "tP_OAValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__OAValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.TP_OA_NoPad: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.TP_OA_NoPad");
  }
}

void TP__OA__NoPad::encode_text(Text_Buf& text_buf) const
{
field_tP__LengthIndicator.encode_text(text_buf);
field_tP__NumberingPlanID.encode_text(text_buf);
field_tP__TypeOfNumber.encode_text(text_buf);
field_tp__Spare.encode_text(text_buf);
field_tP__OAValue.encode_text(text_buf);
}

void TP__OA__NoPad::decode_text(Text_Buf& text_buf)
{
field_tP__LengthIndicator.decode_text(text_buf);
field_tP__NumberingPlanID.decode_text(text_buf);
field_tP__TypeOfNumber.decode_text(text_buf);
field_tp__Spare.decode_text(text_buf);
field_tP__OAValue.decode_text(text_buf);
}

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

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

int TP__OA__NoPad::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, TP__OA__NoPad_tP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_tP__LengthIndicator.RAW_decode(TP__OA__NoPad_tP__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_tP__LengthIndicator.convert_to_Integer(TP__OA__NoPad_tP__LengthIndicator_descr_);
  field_tP__LengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 4;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_tP__NumberingPlanID.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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_tP__TypeOfNumber.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, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tp__Spare.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, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_tP__OAValue.RAW_decode(HEXSTRING_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TP__OA__NoPad::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, TP__OA__NoPad_tP__LengthIndicator_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::BIT3_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, HEXSTRING_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &TP__OA__NoPad_tP__LengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 4;
  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[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_tP__NumberingPlanID.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__TypeOfNumber.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tp__Spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__OAValue.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct TP__OA__NoPad_template::single_value_struct {
INTEGER_template field_tP__LengthIndicator;
BITSTRING_template field_tP__NumberingPlanID;
BITSTRING_template field_tP__TypeOfNumber;
BITSTRING_template field_tp__Spare;
HEXSTRING_template field_tP__OAValue;
};

void TP__OA__NoPad_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_tP__LengthIndicator = ANY_VALUE;
single_value->field_tP__NumberingPlanID = ANY_VALUE;
single_value->field_tP__TypeOfNumber = ANY_VALUE;
single_value->field_tp__Spare = ANY_VALUE;
single_value->field_tP__OAValue = ANY_VALUE;
}
}
}

void TP__OA__NoPad_template::copy_value(const TP__OA__NoPad& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__LengthIndicator().is_bound()) {
  single_value->field_tP__LengthIndicator = other_value.tP__LengthIndicator();
} else {
  single_value->field_tP__LengthIndicator.clean_up();
}
if (other_value.tP__NumberingPlanID().is_bound()) {
  single_value->field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
} else {
  single_value->field_tP__NumberingPlanID.clean_up();
}
if (other_value.tP__TypeOfNumber().is_bound()) {
  single_value->field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
} else {
  single_value->field_tP__TypeOfNumber.clean_up();
}
if (other_value.tp__Spare().is_bound()) {
  single_value->field_tp__Spare = other_value.tp__Spare();
} else {
  single_value->field_tp__Spare.clean_up();
}
if (other_value.tP__OAValue().is_bound()) {
  single_value->field_tP__OAValue = other_value.tP__OAValue();
} else {
  single_value->field_tP__OAValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__OA__NoPad_template::copy_template(const TP__OA__NoPad_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__LengthIndicator().get_selection()) {
single_value->field_tP__LengthIndicator = other_value.tP__LengthIndicator();
} else {
single_value->field_tP__LengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__NumberingPlanID().get_selection()) {
single_value->field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
} else {
single_value->field_tP__NumberingPlanID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__TypeOfNumber().get_selection()) {
single_value->field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
} else {
single_value->field_tP__TypeOfNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tp__Spare().get_selection()) {
single_value->field_tp__Spare = other_value.tp__Spare();
} else {
single_value->field_tp__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__OAValue().get_selection()) {
single_value->field_tP__OAValue = other_value.tP__OAValue();
} else {
single_value->field_tP__OAValue.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 TP__OA__NoPad_template[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 TP__OA__NoPad_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__OA__NoPad_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_SMS_Types.TP_OA_NoPad.");
break;
}
set_selection(other_value);
}

TP__OA__NoPad_template::TP__OA__NoPad_template()
{
}

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

TP__OA__NoPad_template::TP__OA__NoPad_template(const TP__OA__NoPad& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__OA__NoPad_template::match(const TP__OA__NoPad& 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.tP__LengthIndicator().is_bound()) return FALSE;
if(!single_value->field_tP__LengthIndicator.match(other_value.tP__LengthIndicator(), legacy))return FALSE;
if(!other_value.tP__NumberingPlanID().is_bound()) return FALSE;
if(!single_value->field_tP__NumberingPlanID.match(other_value.tP__NumberingPlanID(), legacy))return FALSE;
if(!other_value.tP__TypeOfNumber().is_bound()) return FALSE;
if(!single_value->field_tP__TypeOfNumber.match(other_value.tP__TypeOfNumber(), legacy))return FALSE;
if(!other_value.tp__Spare().is_bound()) return FALSE;
if(!single_value->field_tp__Spare.match(other_value.tp__Spare(), legacy))return FALSE;
if(!other_value.tP__OAValue().is_bound()) return FALSE;
if(!single_value->field_tP__OAValue.match(other_value.tP__OAValue(), 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_SMS_Types.TP_OA_NoPad.");
}
return FALSE;
}

boolean TP__OA__NoPad_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tP__LengthIndicator.is_bound()
 || single_value->field_tP__NumberingPlanID.is_bound()
 || single_value->field_tP__TypeOfNumber.is_bound()
 || single_value->field_tp__Spare.is_bound()
 || single_value->field_tP__OAValue.is_bound();
}

boolean TP__OA__NoPad_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__LengthIndicator.is_value()
 && single_value->field_tP__NumberingPlanID.is_value()
 && single_value->field_tP__TypeOfNumber.is_value()
 && single_value->field_tp__Spare.is_value()
 && single_value->field_tP__OAValue.is_value();
}

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

TP__OA__NoPad TP__OA__NoPad_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_SMS_Types.TP_OA_NoPad.");
TP__OA__NoPad ret_val;
if (single_value->field_tP__LengthIndicator.is_bound()) {
ret_val.tP__LengthIndicator() = single_value->field_tP__LengthIndicator.valueof();
}
if (single_value->field_tP__NumberingPlanID.is_bound()) {
ret_val.tP__NumberingPlanID() = single_value->field_tP__NumberingPlanID.valueof();
}
if (single_value->field_tP__TypeOfNumber.is_bound()) {
ret_val.tP__TypeOfNumber() = single_value->field_tP__TypeOfNumber.valueof();
}
if (single_value->field_tp__Spare.is_bound()) {
ret_val.tp__Spare() = single_value->field_tp__Spare.valueof();
}
if (single_value->field_tP__OAValue.is_bound()) {
ret_val.tP__OAValue() = single_value->field_tP__OAValue.valueof();
}
return ret_val;
}

void TP__OA__NoPad_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_SMS_Types.TP_OA_NoPad.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TP__OA__NoPad_template[list_length];
}

TP__OA__NoPad_template& TP__OA__NoPad_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_SMS_Types.TP_OA_NoPad.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_SMS_Types.TP_OA_NoPad.");
return value_list.list_value[list_index];
}

INTEGER_template& TP__OA__NoPad_template::tP__LengthIndicator()
{
set_specific();
return single_value->field_tP__LengthIndicator;
}

const INTEGER_template& TP__OA__NoPad_template::tP__LengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_LengthIndicator of a non-specific template of type @MobileL3_SMS_Types.TP_OA_NoPad.");
return single_value->field_tP__LengthIndicator;
}

BITSTRING_template& TP__OA__NoPad_template::tP__NumberingPlanID()
{
set_specific();
return single_value->field_tP__NumberingPlanID;
}

const BITSTRING_template& TP__OA__NoPad_template::tP__NumberingPlanID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_NumberingPlanID of a non-specific template of type @MobileL3_SMS_Types.TP_OA_NoPad.");
return single_value->field_tP__NumberingPlanID;
}

BITSTRING_template& TP__OA__NoPad_template::tP__TypeOfNumber()
{
set_specific();
return single_value->field_tP__TypeOfNumber;
}

const BITSTRING_template& TP__OA__NoPad_template::tP__TypeOfNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_TypeOfNumber of a non-specific template of type @MobileL3_SMS_Types.TP_OA_NoPad.");
return single_value->field_tP__TypeOfNumber;
}

BITSTRING_template& TP__OA__NoPad_template::tp__Spare()
{
set_specific();
return single_value->field_tp__Spare;
}

const BITSTRING_template& TP__OA__NoPad_template::tp__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tp_Spare of a non-specific template of type @MobileL3_SMS_Types.TP_OA_NoPad.");
return single_value->field_tp__Spare;
}

HEXSTRING_template& TP__OA__NoPad_template::tP__OAValue()
{
set_specific();
return single_value->field_tP__OAValue;
}

const HEXSTRING_template& TP__OA__NoPad_template::tP__OAValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_OAValue of a non-specific template of type @MobileL3_SMS_Types.TP_OA_NoPad.");
return single_value->field_tP__OAValue;
}

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

void TP__OA__NoPad_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_LengthIndicator := ");
single_value->field_tP__LengthIndicator.log();
TTCN_Logger::log_event_str(", tP_NumberingPlanID := ");
single_value->field_tP__NumberingPlanID.log();
TTCN_Logger::log_event_str(", tP_TypeOfNumber := ");
single_value->field_tP__TypeOfNumber.log();
TTCN_Logger::log_event_str(", tp_Spare := ");
single_value->field_tp__Spare.log();
TTCN_Logger::log_event_str(", tP_OAValue := ");
single_value->field_tP__OAValue.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 TP__OA__NoPad_template::log_match(const TP__OA__NoPad& 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_tP__LengthIndicator.match(match_value.tP__LengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_LengthIndicator");
single_value->field_tP__LengthIndicator.log_match(match_value.tP__LengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__NumberingPlanID.match(match_value.tP__NumberingPlanID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_NumberingPlanID");
single_value->field_tP__NumberingPlanID.log_match(match_value.tP__NumberingPlanID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__TypeOfNumber.match(match_value.tP__TypeOfNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_TypeOfNumber");
single_value->field_tP__TypeOfNumber.log_match(match_value.tP__TypeOfNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tp__Spare.match(match_value.tp__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".tp_Spare");
single_value->field_tp__Spare.log_match(match_value.tp__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__OAValue.match(match_value.tP__OAValue(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_OAValue");
single_value->field_tP__OAValue.log_match(match_value.tP__OAValue(), 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("{ tP_LengthIndicator := ");
single_value->field_tP__LengthIndicator.log_match(match_value.tP__LengthIndicator(), legacy);
TTCN_Logger::log_event_str(", tP_NumberingPlanID := ");
single_value->field_tP__NumberingPlanID.log_match(match_value.tP__NumberingPlanID(), legacy);
TTCN_Logger::log_event_str(", tP_TypeOfNumber := ");
single_value->field_tP__TypeOfNumber.log_match(match_value.tP__TypeOfNumber(), legacy);
TTCN_Logger::log_event_str(", tp_Spare := ");
single_value->field_tp__Spare.log_match(match_value.tp__Spare(), legacy);
TTCN_Logger::log_event_str(", tP_OAValue := ");
single_value->field_tP__OAValue.log_match(match_value.tP__OAValue(), 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 TP__OA__NoPad_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__LengthIndicator().is_bound()) tP__LengthIndicator().set_implicit_omit();
if (tP__NumberingPlanID().is_bound()) tP__NumberingPlanID().set_implicit_omit();
if (tP__TypeOfNumber().is_bound()) tP__TypeOfNumber().set_implicit_omit();
if (tp__Spare().is_bound()) tp__Spare().set_implicit_omit();
if (tP__OAValue().is_bound()) tP__OAValue().set_implicit_omit();
}

void TP__OA__NoPad_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__LengthIndicator.encode_text(text_buf);
single_value->field_tP__NumberingPlanID.encode_text(text_buf);
single_value->field_tP__TypeOfNumber.encode_text(text_buf);
single_value->field_tp__Spare.encode_text(text_buf);
single_value->field_tP__OAValue.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_SMS_Types.TP_OA_NoPad.");
}
}

void TP__OA__NoPad_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_tP__LengthIndicator.decode_text(text_buf);
single_value->field_tP__NumberingPlanID.decode_text(text_buf);
single_value->field_tP__TypeOfNumber.decode_text(text_buf);
single_value->field_tp__Spare.decode_text(text_buf);
single_value->field_tP__OAValue.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 TP__OA__NoPad_template[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_SMS_Types.TP_OA_NoPad.");
}
}

void TP__OA__NoPad_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: {
    TP__OA__NoPad_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_SMS_Types.TP_OA_NoPad 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) tP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__NumberingPlanID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__TypeOfNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tp__Spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__OAValue().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(), "tP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_NumberingPlanID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__NumberingPlanID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_TypeOfNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__TypeOfNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tp_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tp__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(), "tP_OAValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__OAValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.TP_OA_NoPad: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TP__OA__NoPad_template* precondition = new TP__OA__NoPad_template;
    precondition->set_param(*param.get_elem(0));
    TP__OA__NoPad_template* implied_template = new TP__OA__NoPad_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TP__OA__NoPad_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.TP_OA_NoPad");
  }
  is_ifpresent = param.get_ifpresent();
}

void TP__OA__NoPad_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_tP__LengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_OA_NoPad");
single_value->field_tP__NumberingPlanID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_OA_NoPad");
single_value->field_tP__TypeOfNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_OA_NoPad");
single_value->field_tp__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_OA_NoPad");
single_value->field_tP__OAValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_OA_NoPad");
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_SMS_Types.TP_OA_NoPad");
}

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

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

TP__OA::TP__OA()
{
}

TP__OA::TP__OA(const TP__OA__NoPad& par_tP__OA__NoPad)
  :   field_tP__OA__NoPad(par_tP__OA__NoPad)
{
}

TP__OA::TP__OA(const TP__OA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_OA.");
if (other_value.tP__OA__NoPad().is_bound()) field_tP__OA__NoPad = other_value.tP__OA__NoPad();
else field_tP__OA__NoPad.clean_up();
}

void TP__OA::clean_up()
{
field_tP__OA__NoPad.clean_up();
}

const TTCN_Typedescriptor_t* TP__OA::get_descriptor() const { return &TP__OA_descr_; }
TP__OA& TP__OA::operator=(const TP__OA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.TP_OA.");
  if (other_value.tP__OA__NoPad().is_bound()) field_tP__OA__NoPad = other_value.tP__OA__NoPad();
  else field_tP__OA__NoPad.clean_up();
}
return *this;
}

boolean TP__OA::operator==(const TP__OA& other_value) const
{
return field_tP__OA__NoPad==other_value.field_tP__OA__NoPad;
}

boolean TP__OA::is_bound() const
{
return (field_tP__OA__NoPad.is_bound());
}
boolean TP__OA::is_value() const
{
return field_tP__OA__NoPad.is_value();
}
void TP__OA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_OA_NoPad := ");
field_tP__OA__NoPad.log();
TTCN_Logger::log_event_str(" }");
}

void TP__OA::set_implicit_omit()
{
if (tP__OA__NoPad().is_bound()) tP__OA__NoPad().set_implicit_omit();
}

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

void TP__OA::encode_text(Text_Buf& text_buf) const
{
field_tP__OA__NoPad.encode_text(text_buf);
}

void TP__OA::decode_text(Text_Buf& text_buf)
{
field_tP__OA__NoPad.decode_text(text_buf);
}

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

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

int TP__OA::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, TP__OA__NoPad_descr_.raw->forceomit);
  decoded_field_length = field_tP__OA__NoPad.RAW_decode(TP__OA__NoPad_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 TP__OA::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, TP__OA__NoPad_descr_.raw);
  encoded_length += field_tP__OA__NoPad.RAW_encode(TP__OA__NoPad_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct TP__OA_template::single_value_struct {
TP__OA__NoPad_template field_tP__OA__NoPad;
};

void TP__OA_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_tP__OA__NoPad = ANY_VALUE;
}
}
}

void TP__OA_template::copy_value(const TP__OA& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__OA__NoPad().is_bound()) {
  single_value->field_tP__OA__NoPad = other_value.tP__OA__NoPad();
} else {
  single_value->field_tP__OA__NoPad.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__OA_template::copy_template(const TP__OA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__OA__NoPad().get_selection()) {
single_value->field_tP__OA__NoPad = other_value.tP__OA__NoPad();
} else {
single_value->field_tP__OA__NoPad.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 TP__OA_template[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 TP__OA_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__OA_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_SMS_Types.TP_OA.");
break;
}
set_selection(other_value);
}

TP__OA_template::TP__OA_template()
{
}

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

TP__OA_template::TP__OA_template(const TP__OA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__OA_template::match(const TP__OA& 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.tP__OA__NoPad().is_bound()) return FALSE;
if(!single_value->field_tP__OA__NoPad.match(other_value.tP__OA__NoPad(), 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_SMS_Types.TP_OA.");
}
return FALSE;
}

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

boolean TP__OA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__OA__NoPad.is_value();
}

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

TP__OA TP__OA_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_SMS_Types.TP_OA.");
TP__OA ret_val;
if (single_value->field_tP__OA__NoPad.is_bound()) {
ret_val.tP__OA__NoPad() = single_value->field_tP__OA__NoPad.valueof();
}
return ret_val;
}

void TP__OA_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_SMS_Types.TP_OA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TP__OA_template[list_length];
}

TP__OA_template& TP__OA_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_SMS_Types.TP_OA.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_SMS_Types.TP_OA.");
return value_list.list_value[list_index];
}

TP__OA__NoPad_template& TP__OA_template::tP__OA__NoPad()
{
set_specific();
return single_value->field_tP__OA__NoPad;
}

const TP__OA__NoPad_template& TP__OA_template::tP__OA__NoPad() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_OA_NoPad of a non-specific template of type @MobileL3_SMS_Types.TP_OA.");
return single_value->field_tP__OA__NoPad;
}

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

void TP__OA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_OA_NoPad := ");
single_value->field_tP__OA__NoPad.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 TP__OA_template::log_match(const TP__OA& 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_tP__OA__NoPad.match(match_value.tP__OA__NoPad(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_OA_NoPad");
single_value->field_tP__OA__NoPad.log_match(match_value.tP__OA__NoPad(), 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("{ tP_OA_NoPad := ");
single_value->field_tP__OA__NoPad.log_match(match_value.tP__OA__NoPad(), 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 TP__OA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__OA__NoPad().is_bound()) tP__OA__NoPad().set_implicit_omit();
}

void TP__OA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__OA__NoPad.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_SMS_Types.TP_OA.");
}
}

void TP__OA_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_tP__OA__NoPad.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 TP__OA_template[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_SMS_Types.TP_OA.");
}
}

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

void TP__OA_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_tP__OA__NoPad.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_OA");
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_SMS_Types.TP_OA");
}

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

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

SMS__DELIVER::SMS__DELIVER()
{
}

SMS__DELIVER::SMS__DELIVER(const BITSTRING& par_tP__MTI,
    const BITSTRING& par_tP__MMS,
    const BITSTRING& par_tP__LP,
    const BITSTRING& par_tP__Spare,
    const BITSTRING& par_tP__SRI,
    const BITSTRING& par_tP__UDHI,
    const BITSTRING& par_tP__RP,
    const TP__OA& par_tP__OA,
    const OCTETSTRING& par_tP__PID,
    const OCTETSTRING& par_tP__DCS,
    const OCTETSTRING& par_tP__SCTS,
    const TP__UDL__UD& par_tP__UDL__UD)
  :   field_tP__MTI(par_tP__MTI),
  field_tP__MMS(par_tP__MMS),
  field_tP__LP(par_tP__LP),
  field_tP__Spare(par_tP__Spare),
  field_tP__SRI(par_tP__SRI),
  field_tP__UDHI(par_tP__UDHI),
  field_tP__RP(par_tP__RP),
  field_tP__OA(par_tP__OA),
  field_tP__PID(par_tP__PID),
  field_tP__DCS(par_tP__DCS),
  field_tP__SCTS(par_tP__SCTS),
  field_tP__UDL__UD(par_tP__UDL__UD)
{
}

SMS__DELIVER::SMS__DELIVER(const SMS__DELIVER& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_DELIVER.");
if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
else field_tP__MTI.clean_up();
if (other_value.tP__MMS().is_bound()) field_tP__MMS = other_value.tP__MMS();
else field_tP__MMS.clean_up();
if (other_value.tP__LP().is_bound()) field_tP__LP = other_value.tP__LP();
else field_tP__LP.clean_up();
if (other_value.tP__Spare().is_bound()) field_tP__Spare = other_value.tP__Spare();
else field_tP__Spare.clean_up();
if (other_value.tP__SRI().is_bound()) field_tP__SRI = other_value.tP__SRI();
else field_tP__SRI.clean_up();
if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
else field_tP__UDHI.clean_up();
if (other_value.tP__RP().is_bound()) field_tP__RP = other_value.tP__RP();
else field_tP__RP.clean_up();
if (other_value.tP__OA().is_bound()) field_tP__OA = other_value.tP__OA();
else field_tP__OA.clean_up();
if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
else field_tP__PID.clean_up();
if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
else field_tP__DCS.clean_up();
if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
else field_tP__SCTS.clean_up();
if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
else field_tP__UDL__UD.clean_up();
}

void SMS__DELIVER::clean_up()
{
field_tP__MTI.clean_up();
field_tP__MMS.clean_up();
field_tP__LP.clean_up();
field_tP__Spare.clean_up();
field_tP__SRI.clean_up();
field_tP__UDHI.clean_up();
field_tP__RP.clean_up();
field_tP__OA.clean_up();
field_tP__PID.clean_up();
field_tP__DCS.clean_up();
field_tP__SCTS.clean_up();
field_tP__UDL__UD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__DELIVER::get_descriptor() const { return &SMS__DELIVER_descr_; }
SMS__DELIVER& SMS__DELIVER::operator=(const SMS__DELIVER& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.SMS_DELIVER.");
  if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
  else field_tP__MTI.clean_up();
  if (other_value.tP__MMS().is_bound()) field_tP__MMS = other_value.tP__MMS();
  else field_tP__MMS.clean_up();
  if (other_value.tP__LP().is_bound()) field_tP__LP = other_value.tP__LP();
  else field_tP__LP.clean_up();
  if (other_value.tP__Spare().is_bound()) field_tP__Spare = other_value.tP__Spare();
  else field_tP__Spare.clean_up();
  if (other_value.tP__SRI().is_bound()) field_tP__SRI = other_value.tP__SRI();
  else field_tP__SRI.clean_up();
  if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
  else field_tP__UDHI.clean_up();
  if (other_value.tP__RP().is_bound()) field_tP__RP = other_value.tP__RP();
  else field_tP__RP.clean_up();
  if (other_value.tP__OA().is_bound()) field_tP__OA = other_value.tP__OA();
  else field_tP__OA.clean_up();
  if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
  else field_tP__PID.clean_up();
  if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
  else field_tP__DCS.clean_up();
  if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
  else field_tP__SCTS.clean_up();
  if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
  else field_tP__UDL__UD.clean_up();
}
return *this;
}

boolean SMS__DELIVER::operator==(const SMS__DELIVER& other_value) const
{
return field_tP__MTI==other_value.field_tP__MTI
  && field_tP__MMS==other_value.field_tP__MMS
  && field_tP__LP==other_value.field_tP__LP
  && field_tP__Spare==other_value.field_tP__Spare
  && field_tP__SRI==other_value.field_tP__SRI
  && field_tP__UDHI==other_value.field_tP__UDHI
  && field_tP__RP==other_value.field_tP__RP
  && field_tP__OA==other_value.field_tP__OA
  && field_tP__PID==other_value.field_tP__PID
  && field_tP__DCS==other_value.field_tP__DCS
  && field_tP__SCTS==other_value.field_tP__SCTS
  && field_tP__UDL__UD==other_value.field_tP__UDL__UD;
}

boolean SMS__DELIVER::is_bound() const
{
return (field_tP__MTI.is_bound())
  || (field_tP__MMS.is_bound())
  || (field_tP__LP.is_bound())
  || (field_tP__Spare.is_bound())
  || (field_tP__SRI.is_bound())
  || (field_tP__UDHI.is_bound())
  || (field_tP__RP.is_bound())
  || (field_tP__OA.is_bound())
  || (field_tP__PID.is_bound())
  || (field_tP__DCS.is_bound())
  || (field_tP__SCTS.is_bound())
  || (field_tP__UDL__UD.is_bound());
}
boolean SMS__DELIVER::is_value() const
{
return field_tP__MTI.is_value()
  && field_tP__MMS.is_value()
  && field_tP__LP.is_value()
  && field_tP__Spare.is_value()
  && field_tP__SRI.is_value()
  && field_tP__UDHI.is_value()
  && field_tP__RP.is_value()
  && field_tP__OA.is_value()
  && field_tP__PID.is_value()
  && field_tP__DCS.is_value()
  && field_tP__SCTS.is_value()
  && field_tP__UDL__UD.is_value();
}
void SMS__DELIVER::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_MTI := ");
field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_MMS := ");
field_tP__MMS.log();
TTCN_Logger::log_event_str(", tP_LP := ");
field_tP__LP.log();
TTCN_Logger::log_event_str(", tP_Spare := ");
field_tP__Spare.log();
TTCN_Logger::log_event_str(", tP_SRI := ");
field_tP__SRI.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_RP := ");
field_tP__RP.log();
TTCN_Logger::log_event_str(", tP_OA := ");
field_tP__OA.log();
TTCN_Logger::log_event_str(", tP_PID := ");
field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
field_tP__UDL__UD.log();
TTCN_Logger::log_event_str(" }");
}

void SMS__DELIVER::set_implicit_omit()
{
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__MMS().is_bound()) tP__MMS().set_implicit_omit();
if (tP__LP().is_bound()) tP__LP().set_implicit_omit();
if (tP__Spare().is_bound()) tP__Spare().set_implicit_omit();
if (tP__SRI().is_bound()) tP__SRI().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__RP().is_bound()) tP__RP().set_implicit_omit();
if (tP__OA().is_bound()) tP__OA().set_implicit_omit();
if (tP__PID().is_bound()) tP__PID().set_implicit_omit();
if (tP__DCS().is_bound()) tP__DCS().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (tP__UDL__UD().is_bound()) tP__UDL__UD().set_implicit_omit();
}

void SMS__DELIVER::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.SMS_DELIVER has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__MMS().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__LP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__SRI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__RP().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__OA().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_LP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__LP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_SRI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_RP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_OA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__OA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_DELIVER: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_DELIVER");
  }
}

void SMS__DELIVER::encode_text(Text_Buf& text_buf) const
{
field_tP__MTI.encode_text(text_buf);
field_tP__MMS.encode_text(text_buf);
field_tP__LP.encode_text(text_buf);
field_tP__Spare.encode_text(text_buf);
field_tP__SRI.encode_text(text_buf);
field_tP__UDHI.encode_text(text_buf);
field_tP__RP.encode_text(text_buf);
field_tP__OA.encode_text(text_buf);
field_tP__PID.encode_text(text_buf);
field_tP__DCS.encode_text(text_buf);
field_tP__SCTS.encode_text(text_buf);
field_tP__UDL__UD.encode_text(text_buf);
}

void SMS__DELIVER::decode_text(Text_Buf& text_buf)
{
field_tP__MTI.decode_text(text_buf);
field_tP__MMS.decode_text(text_buf);
field_tP__LP.decode_text(text_buf);
field_tP__Spare.decode_text(text_buf);
field_tP__SRI.decode_text(text_buf);
field_tP__UDHI.decode_text(text_buf);
field_tP__RP.decode_text(text_buf);
field_tP__OA.decode_text(text_buf);
field_tP__PID.decode_text(text_buf);
field_tP__DCS.decode_text(text_buf);
field_tP__SCTS.decode_text(text_buf);
field_tP__UDL__UD.decode_text(text_buf);
}

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

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

int SMS__DELIVER::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_tP__MTI.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__MMS.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_tP__LP.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_tP__Spare.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_tP__SRI.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_tP__UDHI.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_tP__RP.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, TP__OA_descr_.raw->forceomit);
  decoded_field_length = field_tP__OA.RAW_decode(TP__OA_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__PID.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_9_force_omit(9, force_omit, TP__DCS_descr_.raw->forceomit);
  decoded_field_length = field_tP__DCS.RAW_decode(TP__DCS_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::OCT7_descr_.raw->forceomit);
  decoded_field_length = field_tP__SCTS.RAW_decode(General__Types::OCT7_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, TP__UDL__UD_descr_.raw->forceomit);
  decoded_field_length = field_tP__UDL__UD.RAW_decode(TP__UDL__UD_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());
  if (field_tP__MTI !=  bs_3) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SMS__DELIVER::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 12;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT2_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, TP__OA_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, TP__DCS_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::OCT7_descr_.raw);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, TP__UDL__UD_descr_.raw);
  encoded_length += field_tP__MTI.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tP__MMS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__LP.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tP__Spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__SRI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_tP__UDHI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tP__RP.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_tP__OA.RAW_encode(TP__OA_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_tP__PID.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_tP__DCS.RAW_encode(TP__DCS_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_tP__SCTS.RAW_encode(General__Types::OCT7_descr_, *myleaf.body.node.nodes[10]);
  encoded_length += field_tP__UDL__UD.RAW_encode(TP__UDL__UD_descr_, *myleaf.body.node.nodes[11]);
  if (field_tP__MTI !=  bs_3) {
  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_3.RAW_encode(General__Types::BIT2_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 SMS__DELIVER_template::single_value_struct {
BITSTRING_template field_tP__MTI;
BITSTRING_template field_tP__MMS;
BITSTRING_template field_tP__LP;
BITSTRING_template field_tP__Spare;
BITSTRING_template field_tP__SRI;
BITSTRING_template field_tP__UDHI;
BITSTRING_template field_tP__RP;
TP__OA_template field_tP__OA;
OCTETSTRING_template field_tP__PID;
OCTETSTRING_template field_tP__DCS;
OCTETSTRING_template field_tP__SCTS;
TP__UDL__UD_template field_tP__UDL__UD;
};

void SMS__DELIVER_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_tP__MTI = ANY_VALUE;
single_value->field_tP__MMS = ANY_VALUE;
single_value->field_tP__LP = ANY_VALUE;
single_value->field_tP__Spare = ANY_VALUE;
single_value->field_tP__SRI = ANY_VALUE;
single_value->field_tP__UDHI = ANY_VALUE;
single_value->field_tP__RP = ANY_VALUE;
single_value->field_tP__OA = ANY_VALUE;
single_value->field_tP__PID = ANY_VALUE;
single_value->field_tP__DCS = ANY_VALUE;
single_value->field_tP__SCTS = ANY_VALUE;
single_value->field_tP__UDL__UD = ANY_VALUE;
}
}
}

void SMS__DELIVER_template::copy_value(const SMS__DELIVER& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__MTI().is_bound()) {
  single_value->field_tP__MTI = other_value.tP__MTI();
} else {
  single_value->field_tP__MTI.clean_up();
}
if (other_value.tP__MMS().is_bound()) {
  single_value->field_tP__MMS = other_value.tP__MMS();
} else {
  single_value->field_tP__MMS.clean_up();
}
if (other_value.tP__LP().is_bound()) {
  single_value->field_tP__LP = other_value.tP__LP();
} else {
  single_value->field_tP__LP.clean_up();
}
if (other_value.tP__Spare().is_bound()) {
  single_value->field_tP__Spare = other_value.tP__Spare();
} else {
  single_value->field_tP__Spare.clean_up();
}
if (other_value.tP__SRI().is_bound()) {
  single_value->field_tP__SRI = other_value.tP__SRI();
} else {
  single_value->field_tP__SRI.clean_up();
}
if (other_value.tP__UDHI().is_bound()) {
  single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
  single_value->field_tP__UDHI.clean_up();
}
if (other_value.tP__RP().is_bound()) {
  single_value->field_tP__RP = other_value.tP__RP();
} else {
  single_value->field_tP__RP.clean_up();
}
if (other_value.tP__OA().is_bound()) {
  single_value->field_tP__OA = other_value.tP__OA();
} else {
  single_value->field_tP__OA.clean_up();
}
if (other_value.tP__PID().is_bound()) {
  single_value->field_tP__PID = other_value.tP__PID();
} else {
  single_value->field_tP__PID.clean_up();
}
if (other_value.tP__DCS().is_bound()) {
  single_value->field_tP__DCS = other_value.tP__DCS();
} else {
  single_value->field_tP__DCS.clean_up();
}
if (other_value.tP__SCTS().is_bound()) {
  single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
  single_value->field_tP__SCTS.clean_up();
}
if (other_value.tP__UDL__UD().is_bound()) {
  single_value->field_tP__UDL__UD = other_value.tP__UDL__UD();
} else {
  single_value->field_tP__UDL__UD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SMS__DELIVER_template::copy_template(const SMS__DELIVER_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__MTI().get_selection()) {
single_value->field_tP__MTI = other_value.tP__MTI();
} else {
single_value->field_tP__MTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__MMS().get_selection()) {
single_value->field_tP__MMS = other_value.tP__MMS();
} else {
single_value->field_tP__MMS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__LP().get_selection()) {
single_value->field_tP__LP = other_value.tP__LP();
} else {
single_value->field_tP__LP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Spare().get_selection()) {
single_value->field_tP__Spare = other_value.tP__Spare();
} else {
single_value->field_tP__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__SRI().get_selection()) {
single_value->field_tP__SRI = other_value.tP__SRI();
} else {
single_value->field_tP__SRI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDHI().get_selection()) {
single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
single_value->field_tP__UDHI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__RP().get_selection()) {
single_value->field_tP__RP = other_value.tP__RP();
} else {
single_value->field_tP__RP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__OA().get_selection()) {
single_value->field_tP__OA = other_value.tP__OA();
} else {
single_value->field_tP__OA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PID().get_selection()) {
single_value->field_tP__PID = other_value.tP__PID();
} else {
single_value->field_tP__PID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__DCS().get_selection()) {
single_value->field_tP__DCS = other_value.tP__DCS();
} else {
single_value->field_tP__DCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__SCTS().get_selection()) {
single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
single_value->field_tP__SCTS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDL__UD().get_selection()) {
single_value->field_tP__UDL__UD = other_value.tP__UDL__UD();
} else {
single_value->field_tP__UDL__UD.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 SMS__DELIVER_template[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 SMS__DELIVER_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__DELIVER_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_SMS_Types.SMS_DELIVER.");
break;
}
set_selection(other_value);
}

SMS__DELIVER_template::SMS__DELIVER_template()
{
}

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

SMS__DELIVER_template::SMS__DELIVER_template(const SMS__DELIVER& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMS__DELIVER_template::match(const SMS__DELIVER& 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.tP__MTI().is_bound()) return FALSE;
if(!single_value->field_tP__MTI.match(other_value.tP__MTI(), legacy))return FALSE;
if(!other_value.tP__MMS().is_bound()) return FALSE;
if(!single_value->field_tP__MMS.match(other_value.tP__MMS(), legacy))return FALSE;
if(!other_value.tP__LP().is_bound()) return FALSE;
if(!single_value->field_tP__LP.match(other_value.tP__LP(), legacy))return FALSE;
if(!other_value.tP__Spare().is_bound()) return FALSE;
if(!single_value->field_tP__Spare.match(other_value.tP__Spare(), legacy))return FALSE;
if(!other_value.tP__SRI().is_bound()) return FALSE;
if(!single_value->field_tP__SRI.match(other_value.tP__SRI(), legacy))return FALSE;
if(!other_value.tP__UDHI().is_bound()) return FALSE;
if(!single_value->field_tP__UDHI.match(other_value.tP__UDHI(), legacy))return FALSE;
if(!other_value.tP__RP().is_bound()) return FALSE;
if(!single_value->field_tP__RP.match(other_value.tP__RP(), legacy))return FALSE;
if(!other_value.tP__OA().is_bound()) return FALSE;
if(!single_value->field_tP__OA.match(other_value.tP__OA(), legacy))return FALSE;
if(!other_value.tP__PID().is_bound()) return FALSE;
if(!single_value->field_tP__PID.match(other_value.tP__PID(), legacy))return FALSE;
if(!other_value.tP__DCS().is_bound()) return FALSE;
if(!single_value->field_tP__DCS.match(other_value.tP__DCS(), legacy))return FALSE;
if(!other_value.tP__SCTS().is_bound()) return FALSE;
if(!single_value->field_tP__SCTS.match(other_value.tP__SCTS(), legacy))return FALSE;
if(!other_value.tP__UDL__UD().is_bound()) return FALSE;
if(!single_value->field_tP__UDL__UD.match(other_value.tP__UDL__UD(), 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_SMS_Types.SMS_DELIVER.");
}
return FALSE;
}

boolean SMS__DELIVER_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tP__MTI.is_bound()
 || single_value->field_tP__MMS.is_bound()
 || single_value->field_tP__LP.is_bound()
 || single_value->field_tP__Spare.is_bound()
 || single_value->field_tP__SRI.is_bound()
 || single_value->field_tP__UDHI.is_bound()
 || single_value->field_tP__RP.is_bound()
 || single_value->field_tP__OA.is_bound()
 || single_value->field_tP__PID.is_bound()
 || single_value->field_tP__DCS.is_bound()
 || single_value->field_tP__SCTS.is_bound()
 || single_value->field_tP__UDL__UD.is_bound();
}

boolean SMS__DELIVER_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__MTI.is_value()
 && single_value->field_tP__MMS.is_value()
 && single_value->field_tP__LP.is_value()
 && single_value->field_tP__Spare.is_value()
 && single_value->field_tP__SRI.is_value()
 && single_value->field_tP__UDHI.is_value()
 && single_value->field_tP__RP.is_value()
 && single_value->field_tP__OA.is_value()
 && single_value->field_tP__PID.is_value()
 && single_value->field_tP__DCS.is_value()
 && single_value->field_tP__SCTS.is_value()
 && single_value->field_tP__UDL__UD.is_value();
}

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

SMS__DELIVER SMS__DELIVER_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_SMS_Types.SMS_DELIVER.");
SMS__DELIVER ret_val;
if (single_value->field_tP__MTI.is_bound()) {
ret_val.tP__MTI() = single_value->field_tP__MTI.valueof();
}
if (single_value->field_tP__MMS.is_bound()) {
ret_val.tP__MMS() = single_value->field_tP__MMS.valueof();
}
if (single_value->field_tP__LP.is_bound()) {
ret_val.tP__LP() = single_value->field_tP__LP.valueof();
}
if (single_value->field_tP__Spare.is_bound()) {
ret_val.tP__Spare() = single_value->field_tP__Spare.valueof();
}
if (single_value->field_tP__SRI.is_bound()) {
ret_val.tP__SRI() = single_value->field_tP__SRI.valueof();
}
if (single_value->field_tP__UDHI.is_bound()) {
ret_val.tP__UDHI() = single_value->field_tP__UDHI.valueof();
}
if (single_value->field_tP__RP.is_bound()) {
ret_val.tP__RP() = single_value->field_tP__RP.valueof();
}
if (single_value->field_tP__OA.is_bound()) {
ret_val.tP__OA() = single_value->field_tP__OA.valueof();
}
if (single_value->field_tP__PID.is_bound()) {
ret_val.tP__PID() = single_value->field_tP__PID.valueof();
}
if (single_value->field_tP__DCS.is_bound()) {
ret_val.tP__DCS() = single_value->field_tP__DCS.valueof();
}
if (single_value->field_tP__SCTS.is_bound()) {
ret_val.tP__SCTS() = single_value->field_tP__SCTS.valueof();
}
if (single_value->field_tP__UDL__UD.is_bound()) {
ret_val.tP__UDL__UD() = single_value->field_tP__UDL__UD.valueof();
}
return ret_val;
}

void SMS__DELIVER_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_SMS_Types.SMS_DELIVER.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SMS__DELIVER_template[list_length];
}

SMS__DELIVER_template& SMS__DELIVER_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_SMS_Types.SMS_DELIVER.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return value_list.list_value[list_index];
}

BITSTRING_template& SMS__DELIVER_template::tP__MTI()
{
set_specific();
return single_value->field_tP__MTI;
}

const BITSTRING_template& SMS__DELIVER_template::tP__MTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MTI of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__MTI;
}

BITSTRING_template& SMS__DELIVER_template::tP__MMS()
{
set_specific();
return single_value->field_tP__MMS;
}

const BITSTRING_template& SMS__DELIVER_template::tP__MMS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MMS of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__MMS;
}

BITSTRING_template& SMS__DELIVER_template::tP__LP()
{
set_specific();
return single_value->field_tP__LP;
}

const BITSTRING_template& SMS__DELIVER_template::tP__LP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_LP of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__LP;
}

BITSTRING_template& SMS__DELIVER_template::tP__Spare()
{
set_specific();
return single_value->field_tP__Spare;
}

const BITSTRING_template& SMS__DELIVER_template::tP__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Spare of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__Spare;
}

BITSTRING_template& SMS__DELIVER_template::tP__SRI()
{
set_specific();
return single_value->field_tP__SRI;
}

const BITSTRING_template& SMS__DELIVER_template::tP__SRI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SRI of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__SRI;
}

BITSTRING_template& SMS__DELIVER_template::tP__UDHI()
{
set_specific();
return single_value->field_tP__UDHI;
}

const BITSTRING_template& SMS__DELIVER_template::tP__UDHI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDHI of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__UDHI;
}

BITSTRING_template& SMS__DELIVER_template::tP__RP()
{
set_specific();
return single_value->field_tP__RP;
}

const BITSTRING_template& SMS__DELIVER_template::tP__RP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_RP of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__RP;
}

TP__OA_template& SMS__DELIVER_template::tP__OA()
{
set_specific();
return single_value->field_tP__OA;
}

const TP__OA_template& SMS__DELIVER_template::tP__OA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_OA of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__OA;
}

OCTETSTRING_template& SMS__DELIVER_template::tP__PID()
{
set_specific();
return single_value->field_tP__PID;
}

const OCTETSTRING_template& SMS__DELIVER_template::tP__PID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PID of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__PID;
}

OCTETSTRING_template& SMS__DELIVER_template::tP__DCS()
{
set_specific();
return single_value->field_tP__DCS;
}

const OCTETSTRING_template& SMS__DELIVER_template::tP__DCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DCS of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__DCS;
}

OCTETSTRING_template& SMS__DELIVER_template::tP__SCTS()
{
set_specific();
return single_value->field_tP__SCTS;
}

const OCTETSTRING_template& SMS__DELIVER_template::tP__SCTS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SCTS of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__SCTS;
}

TP__UDL__UD_template& SMS__DELIVER_template::tP__UDL__UD()
{
set_specific();
return single_value->field_tP__UDL__UD;
}

const TP__UDL__UD_template& SMS__DELIVER_template::tP__UDL__UD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDL_UD of a non-specific template of type @MobileL3_SMS_Types.SMS_DELIVER.");
return single_value->field_tP__UDL__UD;
}

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

void SMS__DELIVER_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_MTI := ");
single_value->field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_MMS := ");
single_value->field_tP__MMS.log();
TTCN_Logger::log_event_str(", tP_LP := ");
single_value->field_tP__LP.log();
TTCN_Logger::log_event_str(", tP_Spare := ");
single_value->field_tP__Spare.log();
TTCN_Logger::log_event_str(", tP_SRI := ");
single_value->field_tP__SRI.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_RP := ");
single_value->field_tP__RP.log();
TTCN_Logger::log_event_str(", tP_OA := ");
single_value->field_tP__OA.log();
TTCN_Logger::log_event_str(", tP_PID := ");
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
single_value->field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
single_value->field_tP__UDL__UD.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 SMS__DELIVER_template::log_match(const SMS__DELIVER& 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_tP__MTI.match(match_value.tP__MTI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MTI");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__MMS.match(match_value.tP__MMS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MMS");
single_value->field_tP__MMS.log_match(match_value.tP__MMS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__LP.match(match_value.tP__LP(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_LP");
single_value->field_tP__LP.log_match(match_value.tP__LP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Spare.match(match_value.tP__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Spare");
single_value->field_tP__Spare.log_match(match_value.tP__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__SRI.match(match_value.tP__SRI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SRI");
single_value->field_tP__SRI.log_match(match_value.tP__SRI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__UDHI.match(match_value.tP__UDHI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDHI");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__RP.match(match_value.tP__RP(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_RP");
single_value->field_tP__RP.log_match(match_value.tP__RP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__OA.match(match_value.tP__OA(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_OA");
single_value->field_tP__OA.log_match(match_value.tP__OA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__PID.match(match_value.tP__PID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PID");
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__DCS.match(match_value.tP__DCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DCS");
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__SCTS.match(match_value.tP__SCTS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SCTS");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__UDL__UD.match(match_value.tP__UDL__UD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDL_UD");
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), 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("{ tP_MTI := ");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::log_event_str(", tP_MMS := ");
single_value->field_tP__MMS.log_match(match_value.tP__MMS(), legacy);
TTCN_Logger::log_event_str(", tP_LP := ");
single_value->field_tP__LP.log_match(match_value.tP__LP(), legacy);
TTCN_Logger::log_event_str(", tP_Spare := ");
single_value->field_tP__Spare.log_match(match_value.tP__Spare(), legacy);
TTCN_Logger::log_event_str(", tP_SRI := ");
single_value->field_tP__SRI.log_match(match_value.tP__SRI(), legacy);
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::log_event_str(", tP_RP := ");
single_value->field_tP__RP.log_match(match_value.tP__RP(), legacy);
TTCN_Logger::log_event_str(", tP_OA := ");
single_value->field_tP__OA.log_match(match_value.tP__OA(), legacy);
TTCN_Logger::log_event_str(", tP_PID := ");
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
TTCN_Logger::log_event_str(", tP_DCS := ");
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), 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 SMS__DELIVER_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__MMS().is_bound()) tP__MMS().set_implicit_omit();
if (tP__LP().is_bound()) tP__LP().set_implicit_omit();
if (tP__Spare().is_bound()) tP__Spare().set_implicit_omit();
if (tP__SRI().is_bound()) tP__SRI().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__RP().is_bound()) tP__RP().set_implicit_omit();
if (tP__OA().is_bound()) tP__OA().set_implicit_omit();
if (tP__PID().is_bound()) tP__PID().set_implicit_omit();
if (tP__DCS().is_bound()) tP__DCS().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (tP__UDL__UD().is_bound()) tP__UDL__UD().set_implicit_omit();
}

void SMS__DELIVER_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__MTI.encode_text(text_buf);
single_value->field_tP__MMS.encode_text(text_buf);
single_value->field_tP__LP.encode_text(text_buf);
single_value->field_tP__Spare.encode_text(text_buf);
single_value->field_tP__SRI.encode_text(text_buf);
single_value->field_tP__UDHI.encode_text(text_buf);
single_value->field_tP__RP.encode_text(text_buf);
single_value->field_tP__OA.encode_text(text_buf);
single_value->field_tP__PID.encode_text(text_buf);
single_value->field_tP__DCS.encode_text(text_buf);
single_value->field_tP__SCTS.encode_text(text_buf);
single_value->field_tP__UDL__UD.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_SMS_Types.SMS_DELIVER.");
}
}

void SMS__DELIVER_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_tP__MTI.decode_text(text_buf);
single_value->field_tP__MMS.decode_text(text_buf);
single_value->field_tP__LP.decode_text(text_buf);
single_value->field_tP__Spare.decode_text(text_buf);
single_value->field_tP__SRI.decode_text(text_buf);
single_value->field_tP__UDHI.decode_text(text_buf);
single_value->field_tP__RP.decode_text(text_buf);
single_value->field_tP__OA.decode_text(text_buf);
single_value->field_tP__PID.decode_text(text_buf);
single_value->field_tP__DCS.decode_text(text_buf);
single_value->field_tP__SCTS.decode_text(text_buf);
single_value->field_tP__UDL__UD.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 SMS__DELIVER_template[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_SMS_Types.SMS_DELIVER.");
}
}

void SMS__DELIVER_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: {
    SMS__DELIVER_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.SMS_DELIVER has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__MMS().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__LP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__SRI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__RP().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__OA().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_LP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__LP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_SRI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_RP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_OA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__OA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_DELIVER: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__DELIVER_template* precondition = new SMS__DELIVER_template;
    precondition->set_param(*param.get_elem(0));
    SMS__DELIVER_template* implied_template = new SMS__DELIVER_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__DELIVER_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_DELIVER");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__DELIVER_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_tP__MTI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__MMS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__LP.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__SRI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__RP.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__OA.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__SCTS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
single_value->field_tP__UDL__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER");
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_SMS_Types.SMS_DELIVER");
}

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

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

TP__RA__NoPad::TP__RA__NoPad()
{
}

TP__RA__NoPad::TP__RA__NoPad(const INTEGER& par_tP__LengthIndicator,
    const BITSTRING& par_tP__NumberingPlanID,
    const BITSTRING& par_tP__TypeOfNumber,
    const BITSTRING& par_tp__Spare,
    const HEXSTRING& par_tP__RAValue)
  :   field_tP__LengthIndicator(par_tP__LengthIndicator),
  field_tP__NumberingPlanID(par_tP__NumberingPlanID),
  field_tP__TypeOfNumber(par_tP__TypeOfNumber),
  field_tp__Spare(par_tp__Spare),
  field_tP__RAValue(par_tP__RAValue)
{
}

TP__RA__NoPad::TP__RA__NoPad(const TP__RA__NoPad& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_RA_NoPad.");
if (other_value.tP__LengthIndicator().is_bound()) field_tP__LengthIndicator = other_value.tP__LengthIndicator();
else field_tP__LengthIndicator.clean_up();
if (other_value.tP__NumberingPlanID().is_bound()) field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
else field_tP__NumberingPlanID.clean_up();
if (other_value.tP__TypeOfNumber().is_bound()) field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
else field_tP__TypeOfNumber.clean_up();
if (other_value.tp__Spare().is_bound()) field_tp__Spare = other_value.tp__Spare();
else field_tp__Spare.clean_up();
if (other_value.tP__RAValue().is_bound()) field_tP__RAValue = other_value.tP__RAValue();
else field_tP__RAValue.clean_up();
}

void TP__RA__NoPad::clean_up()
{
field_tP__LengthIndicator.clean_up();
field_tP__NumberingPlanID.clean_up();
field_tP__TypeOfNumber.clean_up();
field_tp__Spare.clean_up();
field_tP__RAValue.clean_up();
}

const TTCN_Typedescriptor_t* TP__RA__NoPad::get_descriptor() const { return &TP__RA__NoPad_descr_; }
TP__RA__NoPad& TP__RA__NoPad::operator=(const TP__RA__NoPad& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.TP_RA_NoPad.");
  if (other_value.tP__LengthIndicator().is_bound()) field_tP__LengthIndicator = other_value.tP__LengthIndicator();
  else field_tP__LengthIndicator.clean_up();
  if (other_value.tP__NumberingPlanID().is_bound()) field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
  else field_tP__NumberingPlanID.clean_up();
  if (other_value.tP__TypeOfNumber().is_bound()) field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
  else field_tP__TypeOfNumber.clean_up();
  if (other_value.tp__Spare().is_bound()) field_tp__Spare = other_value.tp__Spare();
  else field_tp__Spare.clean_up();
  if (other_value.tP__RAValue().is_bound()) field_tP__RAValue = other_value.tP__RAValue();
  else field_tP__RAValue.clean_up();
}
return *this;
}

boolean TP__RA__NoPad::operator==(const TP__RA__NoPad& other_value) const
{
return field_tP__LengthIndicator==other_value.field_tP__LengthIndicator
  && field_tP__NumberingPlanID==other_value.field_tP__NumberingPlanID
  && field_tP__TypeOfNumber==other_value.field_tP__TypeOfNumber
  && field_tp__Spare==other_value.field_tp__Spare
  && field_tP__RAValue==other_value.field_tP__RAValue;
}

boolean TP__RA__NoPad::is_bound() const
{
return (field_tP__LengthIndicator.is_bound())
  || (field_tP__NumberingPlanID.is_bound())
  || (field_tP__TypeOfNumber.is_bound())
  || (field_tp__Spare.is_bound())
  || (field_tP__RAValue.is_bound());
}
boolean TP__RA__NoPad::is_value() const
{
return field_tP__LengthIndicator.is_value()
  && field_tP__NumberingPlanID.is_value()
  && field_tP__TypeOfNumber.is_value()
  && field_tp__Spare.is_value()
  && field_tP__RAValue.is_value();
}
void TP__RA__NoPad::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_LengthIndicator := ");
field_tP__LengthIndicator.log();
TTCN_Logger::log_event_str(", tP_NumberingPlanID := ");
field_tP__NumberingPlanID.log();
TTCN_Logger::log_event_str(", tP_TypeOfNumber := ");
field_tP__TypeOfNumber.log();
TTCN_Logger::log_event_str(", tp_Spare := ");
field_tp__Spare.log();
TTCN_Logger::log_event_str(", tP_RAValue := ");
field_tP__RAValue.log();
TTCN_Logger::log_event_str(" }");
}

void TP__RA__NoPad::set_implicit_omit()
{
if (tP__LengthIndicator().is_bound()) tP__LengthIndicator().set_implicit_omit();
if (tP__NumberingPlanID().is_bound()) tP__NumberingPlanID().set_implicit_omit();
if (tP__TypeOfNumber().is_bound()) tP__TypeOfNumber().set_implicit_omit();
if (tp__Spare().is_bound()) tp__Spare().set_implicit_omit();
if (tP__RAValue().is_bound()) tP__RAValue().set_implicit_omit();
}

void TP__RA__NoPad::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_SMS_Types.TP_RA_NoPad 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) tP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__NumberingPlanID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__TypeOfNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tp__Spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__RAValue().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(), "tP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_NumberingPlanID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__NumberingPlanID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_TypeOfNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__TypeOfNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tp_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tp__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(), "tP_RAValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RAValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.TP_RA_NoPad: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.TP_RA_NoPad");
  }
}

void TP__RA__NoPad::encode_text(Text_Buf& text_buf) const
{
field_tP__LengthIndicator.encode_text(text_buf);
field_tP__NumberingPlanID.encode_text(text_buf);
field_tP__TypeOfNumber.encode_text(text_buf);
field_tp__Spare.encode_text(text_buf);
field_tP__RAValue.encode_text(text_buf);
}

void TP__RA__NoPad::decode_text(Text_Buf& text_buf)
{
field_tP__LengthIndicator.decode_text(text_buf);
field_tP__NumberingPlanID.decode_text(text_buf);
field_tP__TypeOfNumber.decode_text(text_buf);
field_tp__Spare.decode_text(text_buf);
field_tP__RAValue.decode_text(text_buf);
}

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

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

int TP__RA__NoPad::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, TP__RA__NoPad_tP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_tP__LengthIndicator.RAW_decode(TP__RA__NoPad_tP__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_tP__LengthIndicator.convert_to_Integer(TP__RA__NoPad_tP__LengthIndicator_descr_);
  field_tP__LengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 4;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_tP__NumberingPlanID.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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_tP__TypeOfNumber.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, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tp__Spare.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, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_tP__RAValue.RAW_decode(HEXSTRING_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TP__RA__NoPad::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, TP__RA__NoPad_tP__LengthIndicator_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::BIT3_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, HEXSTRING_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &TP__RA__NoPad_tP__LengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 4;
  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[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_tP__NumberingPlanID.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__TypeOfNumber.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tp__Spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__RAValue.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct TP__RA__NoPad_template::single_value_struct {
INTEGER_template field_tP__LengthIndicator;
BITSTRING_template field_tP__NumberingPlanID;
BITSTRING_template field_tP__TypeOfNumber;
BITSTRING_template field_tp__Spare;
HEXSTRING_template field_tP__RAValue;
};

void TP__RA__NoPad_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_tP__LengthIndicator = ANY_VALUE;
single_value->field_tP__NumberingPlanID = ANY_VALUE;
single_value->field_tP__TypeOfNumber = ANY_VALUE;
single_value->field_tp__Spare = ANY_VALUE;
single_value->field_tP__RAValue = ANY_VALUE;
}
}
}

void TP__RA__NoPad_template::copy_value(const TP__RA__NoPad& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__LengthIndicator().is_bound()) {
  single_value->field_tP__LengthIndicator = other_value.tP__LengthIndicator();
} else {
  single_value->field_tP__LengthIndicator.clean_up();
}
if (other_value.tP__NumberingPlanID().is_bound()) {
  single_value->field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
} else {
  single_value->field_tP__NumberingPlanID.clean_up();
}
if (other_value.tP__TypeOfNumber().is_bound()) {
  single_value->field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
} else {
  single_value->field_tP__TypeOfNumber.clean_up();
}
if (other_value.tp__Spare().is_bound()) {
  single_value->field_tp__Spare = other_value.tp__Spare();
} else {
  single_value->field_tp__Spare.clean_up();
}
if (other_value.tP__RAValue().is_bound()) {
  single_value->field_tP__RAValue = other_value.tP__RAValue();
} else {
  single_value->field_tP__RAValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__RA__NoPad_template::copy_template(const TP__RA__NoPad_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__LengthIndicator().get_selection()) {
single_value->field_tP__LengthIndicator = other_value.tP__LengthIndicator();
} else {
single_value->field_tP__LengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__NumberingPlanID().get_selection()) {
single_value->field_tP__NumberingPlanID = other_value.tP__NumberingPlanID();
} else {
single_value->field_tP__NumberingPlanID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__TypeOfNumber().get_selection()) {
single_value->field_tP__TypeOfNumber = other_value.tP__TypeOfNumber();
} else {
single_value->field_tP__TypeOfNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tp__Spare().get_selection()) {
single_value->field_tp__Spare = other_value.tp__Spare();
} else {
single_value->field_tp__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__RAValue().get_selection()) {
single_value->field_tP__RAValue = other_value.tP__RAValue();
} else {
single_value->field_tP__RAValue.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 TP__RA__NoPad_template[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 TP__RA__NoPad_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__RA__NoPad_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_SMS_Types.TP_RA_NoPad.");
break;
}
set_selection(other_value);
}

TP__RA__NoPad_template::TP__RA__NoPad_template()
{
}

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

TP__RA__NoPad_template::TP__RA__NoPad_template(const TP__RA__NoPad& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__RA__NoPad_template::match(const TP__RA__NoPad& 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.tP__LengthIndicator().is_bound()) return FALSE;
if(!single_value->field_tP__LengthIndicator.match(other_value.tP__LengthIndicator(), legacy))return FALSE;
if(!other_value.tP__NumberingPlanID().is_bound()) return FALSE;
if(!single_value->field_tP__NumberingPlanID.match(other_value.tP__NumberingPlanID(), legacy))return FALSE;
if(!other_value.tP__TypeOfNumber().is_bound()) return FALSE;
if(!single_value->field_tP__TypeOfNumber.match(other_value.tP__TypeOfNumber(), legacy))return FALSE;
if(!other_value.tp__Spare().is_bound()) return FALSE;
if(!single_value->field_tp__Spare.match(other_value.tp__Spare(), legacy))return FALSE;
if(!other_value.tP__RAValue().is_bound()) return FALSE;
if(!single_value->field_tP__RAValue.match(other_value.tP__RAValue(), 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_SMS_Types.TP_RA_NoPad.");
}
return FALSE;
}

boolean TP__RA__NoPad_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tP__LengthIndicator.is_bound()
 || single_value->field_tP__NumberingPlanID.is_bound()
 || single_value->field_tP__TypeOfNumber.is_bound()
 || single_value->field_tp__Spare.is_bound()
 || single_value->field_tP__RAValue.is_bound();
}

boolean TP__RA__NoPad_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__LengthIndicator.is_value()
 && single_value->field_tP__NumberingPlanID.is_value()
 && single_value->field_tP__TypeOfNumber.is_value()
 && single_value->field_tp__Spare.is_value()
 && single_value->field_tP__RAValue.is_value();
}

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

TP__RA__NoPad TP__RA__NoPad_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_SMS_Types.TP_RA_NoPad.");
TP__RA__NoPad ret_val;
if (single_value->field_tP__LengthIndicator.is_bound()) {
ret_val.tP__LengthIndicator() = single_value->field_tP__LengthIndicator.valueof();
}
if (single_value->field_tP__NumberingPlanID.is_bound()) {
ret_val.tP__NumberingPlanID() = single_value->field_tP__NumberingPlanID.valueof();
}
if (single_value->field_tP__TypeOfNumber.is_bound()) {
ret_val.tP__TypeOfNumber() = single_value->field_tP__TypeOfNumber.valueof();
}
if (single_value->field_tp__Spare.is_bound()) {
ret_val.tp__Spare() = single_value->field_tp__Spare.valueof();
}
if (single_value->field_tP__RAValue.is_bound()) {
ret_val.tP__RAValue() = single_value->field_tP__RAValue.valueof();
}
return ret_val;
}

void TP__RA__NoPad_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_SMS_Types.TP_RA_NoPad.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TP__RA__NoPad_template[list_length];
}

TP__RA__NoPad_template& TP__RA__NoPad_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_SMS_Types.TP_RA_NoPad.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_SMS_Types.TP_RA_NoPad.");
return value_list.list_value[list_index];
}

INTEGER_template& TP__RA__NoPad_template::tP__LengthIndicator()
{
set_specific();
return single_value->field_tP__LengthIndicator;
}

const INTEGER_template& TP__RA__NoPad_template::tP__LengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_LengthIndicator of a non-specific template of type @MobileL3_SMS_Types.TP_RA_NoPad.");
return single_value->field_tP__LengthIndicator;
}

BITSTRING_template& TP__RA__NoPad_template::tP__NumberingPlanID()
{
set_specific();
return single_value->field_tP__NumberingPlanID;
}

const BITSTRING_template& TP__RA__NoPad_template::tP__NumberingPlanID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_NumberingPlanID of a non-specific template of type @MobileL3_SMS_Types.TP_RA_NoPad.");
return single_value->field_tP__NumberingPlanID;
}

BITSTRING_template& TP__RA__NoPad_template::tP__TypeOfNumber()
{
set_specific();
return single_value->field_tP__TypeOfNumber;
}

const BITSTRING_template& TP__RA__NoPad_template::tP__TypeOfNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_TypeOfNumber of a non-specific template of type @MobileL3_SMS_Types.TP_RA_NoPad.");
return single_value->field_tP__TypeOfNumber;
}

BITSTRING_template& TP__RA__NoPad_template::tp__Spare()
{
set_specific();
return single_value->field_tp__Spare;
}

const BITSTRING_template& TP__RA__NoPad_template::tp__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tp_Spare of a non-specific template of type @MobileL3_SMS_Types.TP_RA_NoPad.");
return single_value->field_tp__Spare;
}

HEXSTRING_template& TP__RA__NoPad_template::tP__RAValue()
{
set_specific();
return single_value->field_tP__RAValue;
}

const HEXSTRING_template& TP__RA__NoPad_template::tP__RAValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_RAValue of a non-specific template of type @MobileL3_SMS_Types.TP_RA_NoPad.");
return single_value->field_tP__RAValue;
}

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

void TP__RA__NoPad_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_LengthIndicator := ");
single_value->field_tP__LengthIndicator.log();
TTCN_Logger::log_event_str(", tP_NumberingPlanID := ");
single_value->field_tP__NumberingPlanID.log();
TTCN_Logger::log_event_str(", tP_TypeOfNumber := ");
single_value->field_tP__TypeOfNumber.log();
TTCN_Logger::log_event_str(", tp_Spare := ");
single_value->field_tp__Spare.log();
TTCN_Logger::log_event_str(", tP_RAValue := ");
single_value->field_tP__RAValue.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 TP__RA__NoPad_template::log_match(const TP__RA__NoPad& 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_tP__LengthIndicator.match(match_value.tP__LengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_LengthIndicator");
single_value->field_tP__LengthIndicator.log_match(match_value.tP__LengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__NumberingPlanID.match(match_value.tP__NumberingPlanID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_NumberingPlanID");
single_value->field_tP__NumberingPlanID.log_match(match_value.tP__NumberingPlanID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__TypeOfNumber.match(match_value.tP__TypeOfNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_TypeOfNumber");
single_value->field_tP__TypeOfNumber.log_match(match_value.tP__TypeOfNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tp__Spare.match(match_value.tp__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".tp_Spare");
single_value->field_tp__Spare.log_match(match_value.tp__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__RAValue.match(match_value.tP__RAValue(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_RAValue");
single_value->field_tP__RAValue.log_match(match_value.tP__RAValue(), 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("{ tP_LengthIndicator := ");
single_value->field_tP__LengthIndicator.log_match(match_value.tP__LengthIndicator(), legacy);
TTCN_Logger::log_event_str(", tP_NumberingPlanID := ");
single_value->field_tP__NumberingPlanID.log_match(match_value.tP__NumberingPlanID(), legacy);
TTCN_Logger::log_event_str(", tP_TypeOfNumber := ");
single_value->field_tP__TypeOfNumber.log_match(match_value.tP__TypeOfNumber(), legacy);
TTCN_Logger::log_event_str(", tp_Spare := ");
single_value->field_tp__Spare.log_match(match_value.tp__Spare(), legacy);
TTCN_Logger::log_event_str(", tP_RAValue := ");
single_value->field_tP__RAValue.log_match(match_value.tP__RAValue(), 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 TP__RA__NoPad_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__LengthIndicator().is_bound()) tP__LengthIndicator().set_implicit_omit();
if (tP__NumberingPlanID().is_bound()) tP__NumberingPlanID().set_implicit_omit();
if (tP__TypeOfNumber().is_bound()) tP__TypeOfNumber().set_implicit_omit();
if (tp__Spare().is_bound()) tp__Spare().set_implicit_omit();
if (tP__RAValue().is_bound()) tP__RAValue().set_implicit_omit();
}

void TP__RA__NoPad_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__LengthIndicator.encode_text(text_buf);
single_value->field_tP__NumberingPlanID.encode_text(text_buf);
single_value->field_tP__TypeOfNumber.encode_text(text_buf);
single_value->field_tp__Spare.encode_text(text_buf);
single_value->field_tP__RAValue.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_SMS_Types.TP_RA_NoPad.");
}
}

void TP__RA__NoPad_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_tP__LengthIndicator.decode_text(text_buf);
single_value->field_tP__NumberingPlanID.decode_text(text_buf);
single_value->field_tP__TypeOfNumber.decode_text(text_buf);
single_value->field_tp__Spare.decode_text(text_buf);
single_value->field_tP__RAValue.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 TP__RA__NoPad_template[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_SMS_Types.TP_RA_NoPad.");
}
}

void TP__RA__NoPad_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: {
    TP__RA__NoPad_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_SMS_Types.TP_RA_NoPad 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) tP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__NumberingPlanID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__TypeOfNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tp__Spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__RAValue().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(), "tP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_NumberingPlanID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__NumberingPlanID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_TypeOfNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__TypeOfNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tp_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tp__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(), "tP_RAValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RAValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.TP_RA_NoPad: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TP__RA__NoPad_template* precondition = new TP__RA__NoPad_template;
    precondition->set_param(*param.get_elem(0));
    TP__RA__NoPad_template* implied_template = new TP__RA__NoPad_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TP__RA__NoPad_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.TP_RA_NoPad");
  }
  is_ifpresent = param.get_ifpresent();
}

void TP__RA__NoPad_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_tP__LengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_RA_NoPad");
single_value->field_tP__NumberingPlanID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_RA_NoPad");
single_value->field_tP__TypeOfNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_RA_NoPad");
single_value->field_tp__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_RA_NoPad");
single_value->field_tP__RAValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_RA_NoPad");
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_SMS_Types.TP_RA_NoPad");
}

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

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

TP__RA::TP__RA()
{
}

TP__RA::TP__RA(const TP__RA__NoPad& par_tP__RA__NoPad)
  :   field_tP__RA__NoPad(par_tP__RA__NoPad)
{
}

TP__RA::TP__RA(const TP__RA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_RA.");
if (other_value.tP__RA__NoPad().is_bound()) field_tP__RA__NoPad = other_value.tP__RA__NoPad();
else field_tP__RA__NoPad.clean_up();
}

void TP__RA::clean_up()
{
field_tP__RA__NoPad.clean_up();
}

const TTCN_Typedescriptor_t* TP__RA::get_descriptor() const { return &TP__RA_descr_; }
TP__RA& TP__RA::operator=(const TP__RA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.TP_RA.");
  if (other_value.tP__RA__NoPad().is_bound()) field_tP__RA__NoPad = other_value.tP__RA__NoPad();
  else field_tP__RA__NoPad.clean_up();
}
return *this;
}

boolean TP__RA::operator==(const TP__RA& other_value) const
{
return field_tP__RA__NoPad==other_value.field_tP__RA__NoPad;
}

boolean TP__RA::is_bound() const
{
return (field_tP__RA__NoPad.is_bound());
}
boolean TP__RA::is_value() const
{
return field_tP__RA__NoPad.is_value();
}
void TP__RA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_RA_NoPad := ");
field_tP__RA__NoPad.log();
TTCN_Logger::log_event_str(" }");
}

void TP__RA::set_implicit_omit()
{
if (tP__RA__NoPad().is_bound()) tP__RA__NoPad().set_implicit_omit();
}

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

void TP__RA::encode_text(Text_Buf& text_buf) const
{
field_tP__RA__NoPad.encode_text(text_buf);
}

void TP__RA::decode_text(Text_Buf& text_buf)
{
field_tP__RA__NoPad.decode_text(text_buf);
}

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

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

int TP__RA::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, TP__RA__NoPad_descr_.raw->forceomit);
  decoded_field_length = field_tP__RA__NoPad.RAW_decode(TP__RA__NoPad_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 TP__RA::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, TP__RA__NoPad_descr_.raw);
  encoded_length += field_tP__RA__NoPad.RAW_encode(TP__RA__NoPad_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct TP__RA_template::single_value_struct {
TP__RA__NoPad_template field_tP__RA__NoPad;
};

void TP__RA_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_tP__RA__NoPad = ANY_VALUE;
}
}
}

void TP__RA_template::copy_value(const TP__RA& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__RA__NoPad().is_bound()) {
  single_value->field_tP__RA__NoPad = other_value.tP__RA__NoPad();
} else {
  single_value->field_tP__RA__NoPad.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__RA_template::copy_template(const TP__RA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__RA__NoPad().get_selection()) {
single_value->field_tP__RA__NoPad = other_value.tP__RA__NoPad();
} else {
single_value->field_tP__RA__NoPad.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 TP__RA_template[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 TP__RA_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__RA_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_SMS_Types.TP_RA.");
break;
}
set_selection(other_value);
}

TP__RA_template::TP__RA_template()
{
}

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

TP__RA_template::TP__RA_template(const TP__RA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__RA_template::match(const TP__RA& 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.tP__RA__NoPad().is_bound()) return FALSE;
if(!single_value->field_tP__RA__NoPad.match(other_value.tP__RA__NoPad(), 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_SMS_Types.TP_RA.");
}
return FALSE;
}

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

boolean TP__RA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__RA__NoPad.is_value();
}

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

TP__RA TP__RA_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_SMS_Types.TP_RA.");
TP__RA ret_val;
if (single_value->field_tP__RA__NoPad.is_bound()) {
ret_val.tP__RA__NoPad() = single_value->field_tP__RA__NoPad.valueof();
}
return ret_val;
}

void TP__RA_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_SMS_Types.TP_RA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TP__RA_template[list_length];
}

TP__RA_template& TP__RA_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_SMS_Types.TP_RA.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_SMS_Types.TP_RA.");
return value_list.list_value[list_index];
}

TP__RA__NoPad_template& TP__RA_template::tP__RA__NoPad()
{
set_specific();
return single_value->field_tP__RA__NoPad;
}

const TP__RA__NoPad_template& TP__RA_template::tP__RA__NoPad() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_RA_NoPad of a non-specific template of type @MobileL3_SMS_Types.TP_RA.");
return single_value->field_tP__RA__NoPad;
}

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

void TP__RA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_RA_NoPad := ");
single_value->field_tP__RA__NoPad.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 TP__RA_template::log_match(const TP__RA& 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_tP__RA__NoPad.match(match_value.tP__RA__NoPad(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_RA_NoPad");
single_value->field_tP__RA__NoPad.log_match(match_value.tP__RA__NoPad(), 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("{ tP_RA_NoPad := ");
single_value->field_tP__RA__NoPad.log_match(match_value.tP__RA__NoPad(), 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 TP__RA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__RA__NoPad().is_bound()) tP__RA__NoPad().set_implicit_omit();
}

void TP__RA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__RA__NoPad.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_SMS_Types.TP_RA.");
}
}

void TP__RA_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_tP__RA__NoPad.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 TP__RA_template[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_SMS_Types.TP_RA.");
}
}

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

void TP__RA_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_tP__RA__NoPad.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_RA");
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_SMS_Types.TP_RA");
}

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

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

SMS__STATUS__REPORT::SMS__STATUS__REPORT()
{
}

SMS__STATUS__REPORT::SMS__STATUS__REPORT(const BITSTRING& par_tP__MTI,
    const BITSTRING& par_tP__MMS,
    const BITSTRING& par_tP__LP,
    const BITSTRING& par_tP__Spare1,
    const BITSTRING& par_tP__SRQ,
    const BITSTRING& par_tP__UDHI,
    const BITSTRING& par_tP__Spare2,
    const OCTETSTRING& par_tP__MR,
    const TP__RA& par_tP__RA,
    const OCTETSTRING& par_tP__SCTS,
    const OCTETSTRING& par_tP__DT,
    const OCTETSTRING& par_tP__ST,
    const OPTIONAL< BITSTRING >& par_tP__PresenceBitTP__PID,
    const OPTIONAL< BITSTRING >& par_tP__PresenceBitTP__DCS,
    const OPTIONAL< BITSTRING >& par_tP__PresenceBitTP__UDL,
    const OPTIONAL< BITSTRING >& par_tP__Reserved,
    const OPTIONAL< BITSTRING >& par_tP__ExtensionBit,
    const OPTIONAL< OCTETSTRING >& par_tP__PID,
    const OPTIONAL< OCTETSTRING >& par_tP__DCS,
    const OPTIONAL< TP__UDL__UD >& par_tP__UDL__UD)
  :   field_tP__MTI(par_tP__MTI),
  field_tP__MMS(par_tP__MMS),
  field_tP__LP(par_tP__LP),
  field_tP__Spare1(par_tP__Spare1),
  field_tP__SRQ(par_tP__SRQ),
  field_tP__UDHI(par_tP__UDHI),
  field_tP__Spare2(par_tP__Spare2),
  field_tP__MR(par_tP__MR),
  field_tP__RA(par_tP__RA),
  field_tP__SCTS(par_tP__SCTS),
  field_tP__DT(par_tP__DT),
  field_tP__ST(par_tP__ST),
  field_tP__PresenceBitTP__PID(par_tP__PresenceBitTP__PID),
  field_tP__PresenceBitTP__DCS(par_tP__PresenceBitTP__DCS),
  field_tP__PresenceBitTP__UDL(par_tP__PresenceBitTP__UDL),
  field_tP__Reserved(par_tP__Reserved),
  field_tP__ExtensionBit(par_tP__ExtensionBit),
  field_tP__PID(par_tP__PID),
  field_tP__DCS(par_tP__DCS),
  field_tP__UDL__UD(par_tP__UDL__UD)
{
}

SMS__STATUS__REPORT::SMS__STATUS__REPORT(const SMS__STATUS__REPORT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
else field_tP__MTI.clean_up();
if (other_value.tP__MMS().is_bound()) field_tP__MMS = other_value.tP__MMS();
else field_tP__MMS.clean_up();
if (other_value.tP__LP().is_bound()) field_tP__LP = other_value.tP__LP();
else field_tP__LP.clean_up();
if (other_value.tP__Spare1().is_bound()) field_tP__Spare1 = other_value.tP__Spare1();
else field_tP__Spare1.clean_up();
if (other_value.tP__SRQ().is_bound()) field_tP__SRQ = other_value.tP__SRQ();
else field_tP__SRQ.clean_up();
if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
else field_tP__UDHI.clean_up();
if (other_value.tP__Spare2().is_bound()) field_tP__Spare2 = other_value.tP__Spare2();
else field_tP__Spare2.clean_up();
if (other_value.tP__MR().is_bound()) field_tP__MR = other_value.tP__MR();
else field_tP__MR.clean_up();
if (other_value.tP__RA().is_bound()) field_tP__RA = other_value.tP__RA();
else field_tP__RA.clean_up();
if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
else field_tP__SCTS.clean_up();
if (other_value.tP__DT().is_bound()) field_tP__DT = other_value.tP__DT();
else field_tP__DT.clean_up();
if (other_value.tP__ST().is_bound()) field_tP__ST = other_value.tP__ST();
else field_tP__ST.clean_up();
if (other_value.tP__PresenceBitTP__PID().is_bound()) field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
else field_tP__PresenceBitTP__PID.clean_up();
if (other_value.tP__PresenceBitTP__DCS().is_bound()) field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
else field_tP__PresenceBitTP__DCS.clean_up();
if (other_value.tP__PresenceBitTP__UDL().is_bound()) field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
else field_tP__PresenceBitTP__UDL.clean_up();
if (other_value.tP__Reserved().is_bound()) field_tP__Reserved = other_value.tP__Reserved();
else field_tP__Reserved.clean_up();
if (other_value.tP__ExtensionBit().is_bound()) field_tP__ExtensionBit = other_value.tP__ExtensionBit();
else field_tP__ExtensionBit.clean_up();
if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
else field_tP__PID.clean_up();
if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
else field_tP__DCS.clean_up();
if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
else field_tP__UDL__UD.clean_up();
}

void SMS__STATUS__REPORT::clean_up()
{
field_tP__MTI.clean_up();
field_tP__MMS.clean_up();
field_tP__LP.clean_up();
field_tP__Spare1.clean_up();
field_tP__SRQ.clean_up();
field_tP__UDHI.clean_up();
field_tP__Spare2.clean_up();
field_tP__MR.clean_up();
field_tP__RA.clean_up();
field_tP__SCTS.clean_up();
field_tP__DT.clean_up();
field_tP__ST.clean_up();
field_tP__PresenceBitTP__PID.clean_up();
field_tP__PresenceBitTP__DCS.clean_up();
field_tP__PresenceBitTP__UDL.clean_up();
field_tP__Reserved.clean_up();
field_tP__ExtensionBit.clean_up();
field_tP__PID.clean_up();
field_tP__DCS.clean_up();
field_tP__UDL__UD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__STATUS__REPORT::get_descriptor() const { return &SMS__STATUS__REPORT_descr_; }
SMS__STATUS__REPORT& SMS__STATUS__REPORT::operator=(const SMS__STATUS__REPORT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
  if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
  else field_tP__MTI.clean_up();
  if (other_value.tP__MMS().is_bound()) field_tP__MMS = other_value.tP__MMS();
  else field_tP__MMS.clean_up();
  if (other_value.tP__LP().is_bound()) field_tP__LP = other_value.tP__LP();
  else field_tP__LP.clean_up();
  if (other_value.tP__Spare1().is_bound()) field_tP__Spare1 = other_value.tP__Spare1();
  else field_tP__Spare1.clean_up();
  if (other_value.tP__SRQ().is_bound()) field_tP__SRQ = other_value.tP__SRQ();
  else field_tP__SRQ.clean_up();
  if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
  else field_tP__UDHI.clean_up();
  if (other_value.tP__Spare2().is_bound()) field_tP__Spare2 = other_value.tP__Spare2();
  else field_tP__Spare2.clean_up();
  if (other_value.tP__MR().is_bound()) field_tP__MR = other_value.tP__MR();
  else field_tP__MR.clean_up();
  if (other_value.tP__RA().is_bound()) field_tP__RA = other_value.tP__RA();
  else field_tP__RA.clean_up();
  if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
  else field_tP__SCTS.clean_up();
  if (other_value.tP__DT().is_bound()) field_tP__DT = other_value.tP__DT();
  else field_tP__DT.clean_up();
  if (other_value.tP__ST().is_bound()) field_tP__ST = other_value.tP__ST();
  else field_tP__ST.clean_up();
  if (other_value.tP__PresenceBitTP__PID().is_bound()) field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
  else field_tP__PresenceBitTP__PID.clean_up();
  if (other_value.tP__PresenceBitTP__DCS().is_bound()) field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
  else field_tP__PresenceBitTP__DCS.clean_up();
  if (other_value.tP__PresenceBitTP__UDL().is_bound()) field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
  else field_tP__PresenceBitTP__UDL.clean_up();
  if (other_value.tP__Reserved().is_bound()) field_tP__Reserved = other_value.tP__Reserved();
  else field_tP__Reserved.clean_up();
  if (other_value.tP__ExtensionBit().is_bound()) field_tP__ExtensionBit = other_value.tP__ExtensionBit();
  else field_tP__ExtensionBit.clean_up();
  if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
  else field_tP__PID.clean_up();
  if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
  else field_tP__DCS.clean_up();
  if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
  else field_tP__UDL__UD.clean_up();
}
return *this;
}

boolean SMS__STATUS__REPORT::operator==(const SMS__STATUS__REPORT& other_value) const
{
return field_tP__MTI==other_value.field_tP__MTI
  && field_tP__MMS==other_value.field_tP__MMS
  && field_tP__LP==other_value.field_tP__LP
  && field_tP__Spare1==other_value.field_tP__Spare1
  && field_tP__SRQ==other_value.field_tP__SRQ
  && field_tP__UDHI==other_value.field_tP__UDHI
  && field_tP__Spare2==other_value.field_tP__Spare2
  && field_tP__MR==other_value.field_tP__MR
  && field_tP__RA==other_value.field_tP__RA
  && field_tP__SCTS==other_value.field_tP__SCTS
  && field_tP__DT==other_value.field_tP__DT
  && field_tP__ST==other_value.field_tP__ST
  && field_tP__PresenceBitTP__PID==other_value.field_tP__PresenceBitTP__PID
  && field_tP__PresenceBitTP__DCS==other_value.field_tP__PresenceBitTP__DCS
  && field_tP__PresenceBitTP__UDL==other_value.field_tP__PresenceBitTP__UDL
  && field_tP__Reserved==other_value.field_tP__Reserved
  && field_tP__ExtensionBit==other_value.field_tP__ExtensionBit
  && field_tP__PID==other_value.field_tP__PID
  && field_tP__DCS==other_value.field_tP__DCS
  && field_tP__UDL__UD==other_value.field_tP__UDL__UD;
}

boolean SMS__STATUS__REPORT::is_bound() const
{
return (field_tP__MTI.is_bound())
  || (field_tP__MMS.is_bound())
  || (field_tP__LP.is_bound())
  || (field_tP__Spare1.is_bound())
  || (field_tP__SRQ.is_bound())
  || (field_tP__UDHI.is_bound())
  || (field_tP__Spare2.is_bound())
  || (field_tP__MR.is_bound())
  || (field_tP__RA.is_bound())
  || (field_tP__SCTS.is_bound())
  || (field_tP__DT.is_bound())
  || (field_tP__ST.is_bound())
  || (OPTIONAL_OMIT == field_tP__PresenceBitTP__PID.get_selection() || field_tP__PresenceBitTP__PID.is_bound())
  || (OPTIONAL_OMIT == field_tP__PresenceBitTP__DCS.get_selection() || field_tP__PresenceBitTP__DCS.is_bound())
  || (OPTIONAL_OMIT == field_tP__PresenceBitTP__UDL.get_selection() || field_tP__PresenceBitTP__UDL.is_bound())
  || (OPTIONAL_OMIT == field_tP__Reserved.get_selection() || field_tP__Reserved.is_bound())
  || (OPTIONAL_OMIT == field_tP__ExtensionBit.get_selection() || field_tP__ExtensionBit.is_bound())
  || (OPTIONAL_OMIT == field_tP__PID.get_selection() || field_tP__PID.is_bound())
  || (OPTIONAL_OMIT == field_tP__DCS.get_selection() || field_tP__DCS.is_bound())
  || (OPTIONAL_OMIT == field_tP__UDL__UD.get_selection() || field_tP__UDL__UD.is_bound());
}
boolean SMS__STATUS__REPORT::is_value() const
{
return field_tP__MTI.is_value()
  && field_tP__MMS.is_value()
  && field_tP__LP.is_value()
  && field_tP__Spare1.is_value()
  && field_tP__SRQ.is_value()
  && field_tP__UDHI.is_value()
  && field_tP__Spare2.is_value()
  && field_tP__MR.is_value()
  && field_tP__RA.is_value()
  && field_tP__SCTS.is_value()
  && field_tP__DT.is_value()
  && field_tP__ST.is_value()
  && (OPTIONAL_OMIT == field_tP__PresenceBitTP__PID.get_selection() || field_tP__PresenceBitTP__PID.is_value())
  && (OPTIONAL_OMIT == field_tP__PresenceBitTP__DCS.get_selection() || field_tP__PresenceBitTP__DCS.is_value())
  && (OPTIONAL_OMIT == field_tP__PresenceBitTP__UDL.get_selection() || field_tP__PresenceBitTP__UDL.is_value())
  && (OPTIONAL_OMIT == field_tP__Reserved.get_selection() || field_tP__Reserved.is_value())
  && (OPTIONAL_OMIT == field_tP__ExtensionBit.get_selection() || field_tP__ExtensionBit.is_value())
  && (OPTIONAL_OMIT == field_tP__PID.get_selection() || field_tP__PID.is_value())
  && (OPTIONAL_OMIT == field_tP__DCS.get_selection() || field_tP__DCS.is_value())
  && (OPTIONAL_OMIT == field_tP__UDL__UD.get_selection() || field_tP__UDL__UD.is_value());
}
int SMS__STATUS__REPORT::size_of() const
{
  int ret_val = 12;
  if (field_tP__PresenceBitTP__PID.ispresent()) ret_val++;
  if (field_tP__PresenceBitTP__DCS.ispresent()) ret_val++;
  if (field_tP__PresenceBitTP__UDL.ispresent()) ret_val++;
  if (field_tP__Reserved.ispresent()) ret_val++;
  if (field_tP__ExtensionBit.ispresent()) ret_val++;
  if (field_tP__PID.ispresent()) ret_val++;
  if (field_tP__DCS.ispresent()) ret_val++;
  if (field_tP__UDL__UD.ispresent()) ret_val++;
  return ret_val;
}

void SMS__STATUS__REPORT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_MTI := ");
field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_MMS := ");
field_tP__MMS.log();
TTCN_Logger::log_event_str(", tP_LP := ");
field_tP__LP.log();
TTCN_Logger::log_event_str(", tP_Spare1 := ");
field_tP__Spare1.log();
TTCN_Logger::log_event_str(", tP_SRQ := ");
field_tP__SRQ.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_Spare2 := ");
field_tP__Spare2.log();
TTCN_Logger::log_event_str(", tP_MR := ");
field_tP__MR.log();
TTCN_Logger::log_event_str(", tP_RA := ");
field_tP__RA.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_DT := ");
field_tP__DT.log();
TTCN_Logger::log_event_str(", tP_ST := ");
field_tP__ST.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
field_tP__PresenceBitTP__PID.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
field_tP__PresenceBitTP__DCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
field_tP__PresenceBitTP__UDL.log();
TTCN_Logger::log_event_str(", tP_Reserved := ");
field_tP__Reserved.log();
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
field_tP__ExtensionBit.log();
TTCN_Logger::log_event_str(", tP_PID := ");
field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
field_tP__UDL__UD.log();
TTCN_Logger::log_event_str(" }");
}

void SMS__STATUS__REPORT::set_implicit_omit()
{
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__MMS().is_bound()) tP__MMS().set_implicit_omit();
if (tP__LP().is_bound()) tP__LP().set_implicit_omit();
if (tP__Spare1().is_bound()) tP__Spare1().set_implicit_omit();
if (tP__SRQ().is_bound()) tP__SRQ().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__Spare2().is_bound()) tP__Spare2().set_implicit_omit();
if (tP__MR().is_bound()) tP__MR().set_implicit_omit();
if (tP__RA().is_bound()) tP__RA().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (tP__DT().is_bound()) tP__DT().set_implicit_omit();
if (tP__ST().is_bound()) tP__ST().set_implicit_omit();
if (!tP__PresenceBitTP__PID().is_bound()) tP__PresenceBitTP__PID() = OMIT_VALUE;
else tP__PresenceBitTP__PID().set_implicit_omit();
if (!tP__PresenceBitTP__DCS().is_bound()) tP__PresenceBitTP__DCS() = OMIT_VALUE;
else tP__PresenceBitTP__DCS().set_implicit_omit();
if (!tP__PresenceBitTP__UDL().is_bound()) tP__PresenceBitTP__UDL() = OMIT_VALUE;
else tP__PresenceBitTP__UDL().set_implicit_omit();
if (!tP__Reserved().is_bound()) tP__Reserved() = OMIT_VALUE;
else tP__Reserved().set_implicit_omit();
if (!tP__ExtensionBit().is_bound()) tP__ExtensionBit() = OMIT_VALUE;
else tP__ExtensionBit().set_implicit_omit();
if (!tP__PID().is_bound()) tP__PID() = OMIT_VALUE;
else tP__PID().set_implicit_omit();
if (!tP__DCS().is_bound()) tP__DCS() = OMIT_VALUE;
else tP__DCS().set_implicit_omit();
if (!tP__UDL__UD().is_bound()) tP__UDL__UD() = OMIT_VALUE;
else tP__UDL__UD().set_implicit_omit();
}

void SMS__STATUS__REPORT::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 (20<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.SMS_STATUS_REPORT has 20 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__MMS().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__LP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__SRQ().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__MR().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__RA().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__DT().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__ST().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__PID().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__DCS().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__UDL().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) tP__Reserved().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) tP__ExtensionBit().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(19));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_LP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__LP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_SRQ")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRQ().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_MR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_RA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ST")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ST().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_UDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__UDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__Reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ExtensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ExtensionBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_STATUS_REPORT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
  }
}

void SMS__STATUS__REPORT::encode_text(Text_Buf& text_buf) const
{
field_tP__MTI.encode_text(text_buf);
field_tP__MMS.encode_text(text_buf);
field_tP__LP.encode_text(text_buf);
field_tP__Spare1.encode_text(text_buf);
field_tP__SRQ.encode_text(text_buf);
field_tP__UDHI.encode_text(text_buf);
field_tP__Spare2.encode_text(text_buf);
field_tP__MR.encode_text(text_buf);
field_tP__RA.encode_text(text_buf);
field_tP__SCTS.encode_text(text_buf);
field_tP__DT.encode_text(text_buf);
field_tP__ST.encode_text(text_buf);
field_tP__PresenceBitTP__PID.encode_text(text_buf);
field_tP__PresenceBitTP__DCS.encode_text(text_buf);
field_tP__PresenceBitTP__UDL.encode_text(text_buf);
field_tP__Reserved.encode_text(text_buf);
field_tP__ExtensionBit.encode_text(text_buf);
field_tP__PID.encode_text(text_buf);
field_tP__DCS.encode_text(text_buf);
field_tP__UDL__UD.encode_text(text_buf);
}

void SMS__STATUS__REPORT::decode_text(Text_Buf& text_buf)
{
field_tP__MTI.decode_text(text_buf);
field_tP__MMS.decode_text(text_buf);
field_tP__LP.decode_text(text_buf);
field_tP__Spare1.decode_text(text_buf);
field_tP__SRQ.decode_text(text_buf);
field_tP__UDHI.decode_text(text_buf);
field_tP__Spare2.decode_text(text_buf);
field_tP__MR.decode_text(text_buf);
field_tP__RA.decode_text(text_buf);
field_tP__SCTS.decode_text(text_buf);
field_tP__DT.decode_text(text_buf);
field_tP__ST.decode_text(text_buf);
field_tP__PresenceBitTP__PID.decode_text(text_buf);
field_tP__PresenceBitTP__DCS.decode_text(text_buf);
field_tP__PresenceBitTP__UDL.decode_text(text_buf);
field_tP__Reserved.decode_text(text_buf);
field_tP__ExtensionBit.decode_text(text_buf);
field_tP__PID.decode_text(text_buf);
field_tP__DCS.decode_text(text_buf);
field_tP__UDL__UD.decode_text(text_buf);
}

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

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

int SMS__STATUS__REPORT::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_tP__MTI.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__MMS.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_tP__LP.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_tP__Spare1.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_tP__SRQ.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_tP__UDHI.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_tP__Spare2.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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__MR.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, TP__RA_descr_.raw->forceomit);
  decoded_field_length = field_tP__RA.RAW_decode(TP__RA_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::OCT7_descr_.raw->forceomit);
  decoded_field_length = field_tP__SCTS.RAW_decode(General__Types::OCT7_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::OCT7_descr_.raw->forceomit);
  decoded_field_length = field_tP__DT.RAW_decode(General__Types::OCT7_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__ST.RAW_decode(General__Types::OCT1_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_tP__PresenceBitTP__PID = 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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__PresenceBitTP__PID().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_tP__PresenceBitTP__PID = 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_tP__PresenceBitTP__PID=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_tP__PresenceBitTP__DCS = 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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__PresenceBitTP__DCS().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_tP__PresenceBitTP__DCS = 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_tP__PresenceBitTP__DCS=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_tP__PresenceBitTP__UDL = 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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__PresenceBitTP__UDL().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_tP__PresenceBitTP__UDL = 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_tP__PresenceBitTP__UDL=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_tP__Reserved = 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_tP__Reserved().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_tP__Reserved = 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_tP__Reserved=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_tP__ExtensionBit = 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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__ExtensionBit().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_tP__ExtensionBit = 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_tP__ExtensionBit=OMIT_VALUE;
  if (limit > 0 && field_tP__PresenceBitTP__PID ==  bs_4){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_tP__PID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, SMS__STATUS__REPORT_tP__PID_descr_.raw->forceomit);
  decoded_field_length = field_tP__PID().RAW_decode(SMS__STATUS__REPORT_tP__PID_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_tP__PID = 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_tP__PID=OMIT_VALUE;
  if (limit > 0 && field_tP__PresenceBitTP__DCS ==  bs_4){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_tP__DCS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, SMS__STATUS__REPORT_tP__DCS_descr_.raw->forceomit);
  decoded_field_length = field_tP__DCS().RAW_decode(SMS__STATUS__REPORT_tP__DCS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_tP__DCS = 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_tP__DCS=OMIT_VALUE;
  if (limit > 0 && field_tP__PresenceBitTP__UDL ==  bs_4){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_tP__UDL__UD = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, SMS__STATUS__REPORT_tP__UDL__UD_descr_.raw->forceomit);
  decoded_field_length = field_tP__UDL__UD().RAW_decode(SMS__STATUS__REPORT_tP__UDL__UD_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_tP__UDL__UD = 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_tP__UDL__UD=OMIT_VALUE;
  if (field_tP__MTI !=  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 SMS__STATUS__REPORT::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 = 20;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(20);
  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::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::OCT1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, TP__RA_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::OCT7_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::OCT7_descr_.raw);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, General__Types::OCT1_descr_.raw);
  if (field_tP__PresenceBitTP__PID.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_tP__PresenceBitTP__DCS.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_tP__PresenceBitTP__UDL.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_tP__Reserved.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_tP__ExtensionBit.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_tP__PID.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, SMS__STATUS__REPORT_tP__PID_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_tP__DCS.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, SMS__STATUS__REPORT_tP__DCS_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_tP__UDL__UD.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, SMS__STATUS__REPORT_tP__UDL__UD_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  encoded_length += field_tP__MTI.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tP__MMS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__LP.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tP__Spare1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__SRQ.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_tP__UDHI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tP__Spare2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_tP__MR.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_tP__RA.RAW_encode(TP__RA_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_tP__SCTS.RAW_encode(General__Types::OCT7_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_tP__DT.RAW_encode(General__Types::OCT7_descr_, *myleaf.body.node.nodes[10]);
  encoded_length += field_tP__ST.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[11]);
  if (field_tP__PresenceBitTP__PID.ispresent()) {
  encoded_length += field_tP__PresenceBitTP__PID().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_tP__PresenceBitTP__DCS.ispresent()) {
  encoded_length += field_tP__PresenceBitTP__DCS().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_tP__PresenceBitTP__UDL.ispresent()) {
  encoded_length += field_tP__PresenceBitTP__UDL().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_tP__Reserved.ispresent()) {
  encoded_length += field_tP__Reserved().RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_tP__ExtensionBit.ispresent()) {
  encoded_length += field_tP__ExtensionBit().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_tP__PID.ispresent()) {
  encoded_length += field_tP__PID().RAW_encode(SMS__STATUS__REPORT_tP__PID_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_tP__DCS.ispresent()) {
  encoded_length += field_tP__DCS().RAW_encode(SMS__STATUS__REPORT_tP__DCS_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_tP__UDL__UD.ispresent()) {
  encoded_length += field_tP__UDL__UD().RAW_encode(SMS__STATUS__REPORT_tP__UDL__UD_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_tP__PID.ispresent() && (field_tP__PresenceBitTP__PID !=  bs_4)) {
  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_4.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_tP__DCS.ispresent() && (field_tP__PresenceBitTP__DCS !=  bs_4)) {
  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_4.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_tP__UDL__UD.ispresent() && (field_tP__PresenceBitTP__UDL !=  bs_4)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={14};
  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_4.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_tP__MTI !=  bs_1) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT2_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 SMS__STATUS__REPORT_template::single_value_struct {
BITSTRING_template field_tP__MTI;
BITSTRING_template field_tP__MMS;
BITSTRING_template field_tP__LP;
BITSTRING_template field_tP__Spare1;
BITSTRING_template field_tP__SRQ;
BITSTRING_template field_tP__UDHI;
BITSTRING_template field_tP__Spare2;
OCTETSTRING_template field_tP__MR;
TP__RA_template field_tP__RA;
OCTETSTRING_template field_tP__SCTS;
OCTETSTRING_template field_tP__DT;
OCTETSTRING_template field_tP__ST;
BITSTRING_template field_tP__PresenceBitTP__PID;
BITSTRING_template field_tP__PresenceBitTP__DCS;
BITSTRING_template field_tP__PresenceBitTP__UDL;
BITSTRING_template field_tP__Reserved;
BITSTRING_template field_tP__ExtensionBit;
OCTETSTRING_template field_tP__PID;
OCTETSTRING_template field_tP__DCS;
TP__UDL__UD_template field_tP__UDL__UD;
};

void SMS__STATUS__REPORT_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_tP__MTI = ANY_VALUE;
single_value->field_tP__MMS = ANY_VALUE;
single_value->field_tP__LP = ANY_VALUE;
single_value->field_tP__Spare1 = ANY_VALUE;
single_value->field_tP__SRQ = ANY_VALUE;
single_value->field_tP__UDHI = ANY_VALUE;
single_value->field_tP__Spare2 = ANY_VALUE;
single_value->field_tP__MR = ANY_VALUE;
single_value->field_tP__RA = ANY_VALUE;
single_value->field_tP__SCTS = ANY_VALUE;
single_value->field_tP__DT = ANY_VALUE;
single_value->field_tP__ST = ANY_VALUE;
single_value->field_tP__PresenceBitTP__PID = ANY_OR_OMIT;
single_value->field_tP__PresenceBitTP__DCS = ANY_OR_OMIT;
single_value->field_tP__PresenceBitTP__UDL = ANY_OR_OMIT;
single_value->field_tP__Reserved = ANY_OR_OMIT;
single_value->field_tP__ExtensionBit = ANY_OR_OMIT;
single_value->field_tP__PID = ANY_OR_OMIT;
single_value->field_tP__DCS = ANY_OR_OMIT;
single_value->field_tP__UDL__UD = ANY_OR_OMIT;
}
}
}

void SMS__STATUS__REPORT_template::copy_value(const SMS__STATUS__REPORT& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__MTI().is_bound()) {
  single_value->field_tP__MTI = other_value.tP__MTI();
} else {
  single_value->field_tP__MTI.clean_up();
}
if (other_value.tP__MMS().is_bound()) {
  single_value->field_tP__MMS = other_value.tP__MMS();
} else {
  single_value->field_tP__MMS.clean_up();
}
if (other_value.tP__LP().is_bound()) {
  single_value->field_tP__LP = other_value.tP__LP();
} else {
  single_value->field_tP__LP.clean_up();
}
if (other_value.tP__Spare1().is_bound()) {
  single_value->field_tP__Spare1 = other_value.tP__Spare1();
} else {
  single_value->field_tP__Spare1.clean_up();
}
if (other_value.tP__SRQ().is_bound()) {
  single_value->field_tP__SRQ = other_value.tP__SRQ();
} else {
  single_value->field_tP__SRQ.clean_up();
}
if (other_value.tP__UDHI().is_bound()) {
  single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
  single_value->field_tP__UDHI.clean_up();
}
if (other_value.tP__Spare2().is_bound()) {
  single_value->field_tP__Spare2 = other_value.tP__Spare2();
} else {
  single_value->field_tP__Spare2.clean_up();
}
if (other_value.tP__MR().is_bound()) {
  single_value->field_tP__MR = other_value.tP__MR();
} else {
  single_value->field_tP__MR.clean_up();
}
if (other_value.tP__RA().is_bound()) {
  single_value->field_tP__RA = other_value.tP__RA();
} else {
  single_value->field_tP__RA.clean_up();
}
if (other_value.tP__SCTS().is_bound()) {
  single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
  single_value->field_tP__SCTS.clean_up();
}
if (other_value.tP__DT().is_bound()) {
  single_value->field_tP__DT = other_value.tP__DT();
} else {
  single_value->field_tP__DT.clean_up();
}
if (other_value.tP__ST().is_bound()) {
  single_value->field_tP__ST = other_value.tP__ST();
} else {
  single_value->field_tP__ST.clean_up();
}
if (other_value.tP__PresenceBitTP__PID().is_bound()) {
  if (other_value.tP__PresenceBitTP__PID().ispresent()) single_value->field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID()();
  else single_value->field_tP__PresenceBitTP__PID = OMIT_VALUE;
} else {
  single_value->field_tP__PresenceBitTP__PID.clean_up();
}
if (other_value.tP__PresenceBitTP__DCS().is_bound()) {
  if (other_value.tP__PresenceBitTP__DCS().ispresent()) single_value->field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS()();
  else single_value->field_tP__PresenceBitTP__DCS = OMIT_VALUE;
} else {
  single_value->field_tP__PresenceBitTP__DCS.clean_up();
}
if (other_value.tP__PresenceBitTP__UDL().is_bound()) {
  if (other_value.tP__PresenceBitTP__UDL().ispresent()) single_value->field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL()();
  else single_value->field_tP__PresenceBitTP__UDL = OMIT_VALUE;
} else {
  single_value->field_tP__PresenceBitTP__UDL.clean_up();
}
if (other_value.tP__Reserved().is_bound()) {
  if (other_value.tP__Reserved().ispresent()) single_value->field_tP__Reserved = other_value.tP__Reserved()();
  else single_value->field_tP__Reserved = OMIT_VALUE;
} else {
  single_value->field_tP__Reserved.clean_up();
}
if (other_value.tP__ExtensionBit().is_bound()) {
  if (other_value.tP__ExtensionBit().ispresent()) single_value->field_tP__ExtensionBit = other_value.tP__ExtensionBit()();
  else single_value->field_tP__ExtensionBit = OMIT_VALUE;
} else {
  single_value->field_tP__ExtensionBit.clean_up();
}
if (other_value.tP__PID().is_bound()) {
  if (other_value.tP__PID().ispresent()) single_value->field_tP__PID = other_value.tP__PID()();
  else single_value->field_tP__PID = OMIT_VALUE;
} else {
  single_value->field_tP__PID.clean_up();
}
if (other_value.tP__DCS().is_bound()) {
  if (other_value.tP__DCS().ispresent()) single_value->field_tP__DCS = other_value.tP__DCS()();
  else single_value->field_tP__DCS = OMIT_VALUE;
} else {
  single_value->field_tP__DCS.clean_up();
}
if (other_value.tP__UDL__UD().is_bound()) {
  if (other_value.tP__UDL__UD().ispresent()) single_value->field_tP__UDL__UD = other_value.tP__UDL__UD()();
  else single_value->field_tP__UDL__UD = OMIT_VALUE;
} else {
  single_value->field_tP__UDL__UD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SMS__STATUS__REPORT_template::copy_template(const SMS__STATUS__REPORT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__MTI().get_selection()) {
single_value->field_tP__MTI = other_value.tP__MTI();
} else {
single_value->field_tP__MTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__MMS().get_selection()) {
single_value->field_tP__MMS = other_value.tP__MMS();
} else {
single_value->field_tP__MMS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__LP().get_selection()) {
single_value->field_tP__LP = other_value.tP__LP();
} else {
single_value->field_tP__LP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Spare1().get_selection()) {
single_value->field_tP__Spare1 = other_value.tP__Spare1();
} else {
single_value->field_tP__Spare1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__SRQ().get_selection()) {
single_value->field_tP__SRQ = other_value.tP__SRQ();
} else {
single_value->field_tP__SRQ.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDHI().get_selection()) {
single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
single_value->field_tP__UDHI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Spare2().get_selection()) {
single_value->field_tP__Spare2 = other_value.tP__Spare2();
} else {
single_value->field_tP__Spare2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__MR().get_selection()) {
single_value->field_tP__MR = other_value.tP__MR();
} else {
single_value->field_tP__MR.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__RA().get_selection()) {
single_value->field_tP__RA = other_value.tP__RA();
} else {
single_value->field_tP__RA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__SCTS().get_selection()) {
single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
single_value->field_tP__SCTS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__DT().get_selection()) {
single_value->field_tP__DT = other_value.tP__DT();
} else {
single_value->field_tP__DT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__ST().get_selection()) {
single_value->field_tP__ST = other_value.tP__ST();
} else {
single_value->field_tP__ST.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__PID().get_selection()) {
single_value->field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
} else {
single_value->field_tP__PresenceBitTP__PID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__DCS().get_selection()) {
single_value->field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
} else {
single_value->field_tP__PresenceBitTP__DCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__UDL().get_selection()) {
single_value->field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
} else {
single_value->field_tP__PresenceBitTP__UDL.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Reserved().get_selection()) {
single_value->field_tP__Reserved = other_value.tP__Reserved();
} else {
single_value->field_tP__Reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__ExtensionBit().get_selection()) {
single_value->field_tP__ExtensionBit = other_value.tP__ExtensionBit();
} else {
single_value->field_tP__ExtensionBit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PID().get_selection()) {
single_value->field_tP__PID = other_value.tP__PID();
} else {
single_value->field_tP__PID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__DCS().get_selection()) {
single_value->field_tP__DCS = other_value.tP__DCS();
} else {
single_value->field_tP__DCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDL__UD().get_selection()) {
single_value->field_tP__UDL__UD = other_value.tP__UDL__UD();
} else {
single_value->field_tP__UDL__UD.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 SMS__STATUS__REPORT_template[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 SMS__STATUS__REPORT_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__STATUS__REPORT_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_SMS_Types.SMS_STATUS_REPORT.");
break;
}
set_selection(other_value);
}

SMS__STATUS__REPORT_template::SMS__STATUS__REPORT_template()
{
}

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

SMS__STATUS__REPORT_template::SMS__STATUS__REPORT_template(const SMS__STATUS__REPORT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMS__STATUS__REPORT_template::match(const SMS__STATUS__REPORT& 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.tP__MTI().is_bound()) return FALSE;
if(!single_value->field_tP__MTI.match(other_value.tP__MTI(), legacy))return FALSE;
if(!other_value.tP__MMS().is_bound()) return FALSE;
if(!single_value->field_tP__MMS.match(other_value.tP__MMS(), legacy))return FALSE;
if(!other_value.tP__LP().is_bound()) return FALSE;
if(!single_value->field_tP__LP.match(other_value.tP__LP(), legacy))return FALSE;
if(!other_value.tP__Spare1().is_bound()) return FALSE;
if(!single_value->field_tP__Spare1.match(other_value.tP__Spare1(), legacy))return FALSE;
if(!other_value.tP__SRQ().is_bound()) return FALSE;
if(!single_value->field_tP__SRQ.match(other_value.tP__SRQ(), legacy))return FALSE;
if(!other_value.tP__UDHI().is_bound()) return FALSE;
if(!single_value->field_tP__UDHI.match(other_value.tP__UDHI(), legacy))return FALSE;
if(!other_value.tP__Spare2().is_bound()) return FALSE;
if(!single_value->field_tP__Spare2.match(other_value.tP__Spare2(), legacy))return FALSE;
if(!other_value.tP__MR().is_bound()) return FALSE;
if(!single_value->field_tP__MR.match(other_value.tP__MR(), legacy))return FALSE;
if(!other_value.tP__RA().is_bound()) return FALSE;
if(!single_value->field_tP__RA.match(other_value.tP__RA(), legacy))return FALSE;
if(!other_value.tP__SCTS().is_bound()) return FALSE;
if(!single_value->field_tP__SCTS.match(other_value.tP__SCTS(), legacy))return FALSE;
if(!other_value.tP__DT().is_bound()) return FALSE;
if(!single_value->field_tP__DT.match(other_value.tP__DT(), legacy))return FALSE;
if(!other_value.tP__ST().is_bound()) return FALSE;
if(!single_value->field_tP__ST.match(other_value.tP__ST(), legacy))return FALSE;
if(!other_value.tP__PresenceBitTP__PID().is_bound()) return FALSE;
if((other_value.tP__PresenceBitTP__PID().ispresent() ? !single_value->field_tP__PresenceBitTP__PID.match((const BITSTRING&)other_value.tP__PresenceBitTP__PID(), legacy) : !single_value->field_tP__PresenceBitTP__PID.match_omit(legacy)))return FALSE;
if(!other_value.tP__PresenceBitTP__DCS().is_bound()) return FALSE;
if((other_value.tP__PresenceBitTP__DCS().ispresent() ? !single_value->field_tP__PresenceBitTP__DCS.match((const BITSTRING&)other_value.tP__PresenceBitTP__DCS(), legacy) : !single_value->field_tP__PresenceBitTP__DCS.match_omit(legacy)))return FALSE;
if(!other_value.tP__PresenceBitTP__UDL().is_bound()) return FALSE;
if((other_value.tP__PresenceBitTP__UDL().ispresent() ? !single_value->field_tP__PresenceBitTP__UDL.match((const BITSTRING&)other_value.tP__PresenceBitTP__UDL(), legacy) : !single_value->field_tP__PresenceBitTP__UDL.match_omit(legacy)))return FALSE;
if(!other_value.tP__Reserved().is_bound()) return FALSE;
if((other_value.tP__Reserved().ispresent() ? !single_value->field_tP__Reserved.match((const BITSTRING&)other_value.tP__Reserved(), legacy) : !single_value->field_tP__Reserved.match_omit(legacy)))return FALSE;
if(!other_value.tP__ExtensionBit().is_bound()) return FALSE;
if((other_value.tP__ExtensionBit().ispresent() ? !single_value->field_tP__ExtensionBit.match((const BITSTRING&)other_value.tP__ExtensionBit(), legacy) : !single_value->field_tP__ExtensionBit.match_omit(legacy)))return FALSE;
if(!other_value.tP__PID().is_bound()) return FALSE;
if((other_value.tP__PID().ispresent() ? !single_value->field_tP__PID.match((const OCTETSTRING&)other_value.tP__PID(), legacy) : !single_value->field_tP__PID.match_omit(legacy)))return FALSE;
if(!other_value.tP__DCS().is_bound()) return FALSE;
if((other_value.tP__DCS().ispresent() ? !single_value->field_tP__DCS.match((const OCTETSTRING&)other_value.tP__DCS(), legacy) : !single_value->field_tP__DCS.match_omit(legacy)))return FALSE;
if(!other_value.tP__UDL__UD().is_bound()) return FALSE;
if((other_value.tP__UDL__UD().ispresent() ? !single_value->field_tP__UDL__UD.match((const TP__UDL__UD&)other_value.tP__UDL__UD(), legacy) : !single_value->field_tP__UDL__UD.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_SMS_Types.SMS_STATUS_REPORT.");
}
return FALSE;
}

boolean SMS__STATUS__REPORT_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tP__MTI.is_bound()
 || single_value->field_tP__MMS.is_bound()
 || single_value->field_tP__LP.is_bound()
 || single_value->field_tP__Spare1.is_bound()
 || single_value->field_tP__SRQ.is_bound()
 || single_value->field_tP__UDHI.is_bound()
 || single_value->field_tP__Spare2.is_bound()
 || single_value->field_tP__MR.is_bound()
 || single_value->field_tP__RA.is_bound()
 || single_value->field_tP__SCTS.is_bound()
 || single_value->field_tP__DT.is_bound()
 || single_value->field_tP__ST.is_bound()
 || (single_value->field_tP__PresenceBitTP__PID.is_omit() || single_value->field_tP__PresenceBitTP__PID.is_bound())
 || (single_value->field_tP__PresenceBitTP__DCS.is_omit() || single_value->field_tP__PresenceBitTP__DCS.is_bound())
 || (single_value->field_tP__PresenceBitTP__UDL.is_omit() || single_value->field_tP__PresenceBitTP__UDL.is_bound())
 || (single_value->field_tP__Reserved.is_omit() || single_value->field_tP__Reserved.is_bound())
 || (single_value->field_tP__ExtensionBit.is_omit() || single_value->field_tP__ExtensionBit.is_bound())
 || (single_value->field_tP__PID.is_omit() || single_value->field_tP__PID.is_bound())
 || (single_value->field_tP__DCS.is_omit() || single_value->field_tP__DCS.is_bound())
 || (single_value->field_tP__UDL__UD.is_omit() || single_value->field_tP__UDL__UD.is_bound());
}

boolean SMS__STATUS__REPORT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__MTI.is_value()
 && single_value->field_tP__MMS.is_value()
 && single_value->field_tP__LP.is_value()
 && single_value->field_tP__Spare1.is_value()
 && single_value->field_tP__SRQ.is_value()
 && single_value->field_tP__UDHI.is_value()
 && single_value->field_tP__Spare2.is_value()
 && single_value->field_tP__MR.is_value()
 && single_value->field_tP__RA.is_value()
 && single_value->field_tP__SCTS.is_value()
 && single_value->field_tP__DT.is_value()
 && single_value->field_tP__ST.is_value()
 && (single_value->field_tP__PresenceBitTP__PID.is_omit() || single_value->field_tP__PresenceBitTP__PID.is_value())
 && (single_value->field_tP__PresenceBitTP__DCS.is_omit() || single_value->field_tP__PresenceBitTP__DCS.is_value())
 && (single_value->field_tP__PresenceBitTP__UDL.is_omit() || single_value->field_tP__PresenceBitTP__UDL.is_value())
 && (single_value->field_tP__Reserved.is_omit() || single_value->field_tP__Reserved.is_value())
 && (single_value->field_tP__ExtensionBit.is_omit() || single_value->field_tP__ExtensionBit.is_value())
 && (single_value->field_tP__PID.is_omit() || single_value->field_tP__PID.is_value())
 && (single_value->field_tP__DCS.is_omit() || single_value->field_tP__DCS.is_value())
 && (single_value->field_tP__UDL__UD.is_omit() || single_value->field_tP__UDL__UD.is_value());
}

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

SMS__STATUS__REPORT SMS__STATUS__REPORT_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_SMS_Types.SMS_STATUS_REPORT.");
SMS__STATUS__REPORT ret_val;
if (single_value->field_tP__MTI.is_bound()) {
ret_val.tP__MTI() = single_value->field_tP__MTI.valueof();
}
if (single_value->field_tP__MMS.is_bound()) {
ret_val.tP__MMS() = single_value->field_tP__MMS.valueof();
}
if (single_value->field_tP__LP.is_bound()) {
ret_val.tP__LP() = single_value->field_tP__LP.valueof();
}
if (single_value->field_tP__Spare1.is_bound()) {
ret_val.tP__Spare1() = single_value->field_tP__Spare1.valueof();
}
if (single_value->field_tP__SRQ.is_bound()) {
ret_val.tP__SRQ() = single_value->field_tP__SRQ.valueof();
}
if (single_value->field_tP__UDHI.is_bound()) {
ret_val.tP__UDHI() = single_value->field_tP__UDHI.valueof();
}
if (single_value->field_tP__Spare2.is_bound()) {
ret_val.tP__Spare2() = single_value->field_tP__Spare2.valueof();
}
if (single_value->field_tP__MR.is_bound()) {
ret_val.tP__MR() = single_value->field_tP__MR.valueof();
}
if (single_value->field_tP__RA.is_bound()) {
ret_val.tP__RA() = single_value->field_tP__RA.valueof();
}
if (single_value->field_tP__SCTS.is_bound()) {
ret_val.tP__SCTS() = single_value->field_tP__SCTS.valueof();
}
if (single_value->field_tP__DT.is_bound()) {
ret_val.tP__DT() = single_value->field_tP__DT.valueof();
}
if (single_value->field_tP__ST.is_bound()) {
ret_val.tP__ST() = single_value->field_tP__ST.valueof();
}
if (single_value->field_tP__PresenceBitTP__PID.is_omit()) ret_val.tP__PresenceBitTP__PID() = OMIT_VALUE;
else if (single_value->field_tP__PresenceBitTP__PID.is_bound()) {
ret_val.tP__PresenceBitTP__PID() = single_value->field_tP__PresenceBitTP__PID.valueof();
}
if (single_value->field_tP__PresenceBitTP__DCS.is_omit()) ret_val.tP__PresenceBitTP__DCS() = OMIT_VALUE;
else if (single_value->field_tP__PresenceBitTP__DCS.is_bound()) {
ret_val.tP__PresenceBitTP__DCS() = single_value->field_tP__PresenceBitTP__DCS.valueof();
}
if (single_value->field_tP__PresenceBitTP__UDL.is_omit()) ret_val.tP__PresenceBitTP__UDL() = OMIT_VALUE;
else if (single_value->field_tP__PresenceBitTP__UDL.is_bound()) {
ret_val.tP__PresenceBitTP__UDL() = single_value->field_tP__PresenceBitTP__UDL.valueof();
}
if (single_value->field_tP__Reserved.is_omit()) ret_val.tP__Reserved() = OMIT_VALUE;
else if (single_value->field_tP__Reserved.is_bound()) {
ret_val.tP__Reserved() = single_value->field_tP__Reserved.valueof();
}
if (single_value->field_tP__ExtensionBit.is_omit()) ret_val.tP__ExtensionBit() = OMIT_VALUE;
else if (single_value->field_tP__ExtensionBit.is_bound()) {
ret_val.tP__ExtensionBit() = single_value->field_tP__ExtensionBit.valueof();
}
if (single_value->field_tP__PID.is_omit()) ret_val.tP__PID() = OMIT_VALUE;
else if (single_value->field_tP__PID.is_bound()) {
ret_val.tP__PID() = single_value->field_tP__PID.valueof();
}
if (single_value->field_tP__DCS.is_omit()) ret_val.tP__DCS() = OMIT_VALUE;
else if (single_value->field_tP__DCS.is_bound()) {
ret_val.tP__DCS() = single_value->field_tP__DCS.valueof();
}
if (single_value->field_tP__UDL__UD.is_omit()) ret_val.tP__UDL__UD() = OMIT_VALUE;
else if (single_value->field_tP__UDL__UD.is_bound()) {
ret_val.tP__UDL__UD() = single_value->field_tP__UDL__UD.valueof();
}
return ret_val;
}

void SMS__STATUS__REPORT_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_SMS_Types.SMS_STATUS_REPORT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SMS__STATUS__REPORT_template[list_length];
}

SMS__STATUS__REPORT_template& SMS__STATUS__REPORT_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_SMS_Types.SMS_STATUS_REPORT.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return value_list.list_value[list_index];
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__MTI()
{
set_specific();
return single_value->field_tP__MTI;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__MTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MTI of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__MTI;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__MMS()
{
set_specific();
return single_value->field_tP__MMS;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__MMS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MMS of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__MMS;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__LP()
{
set_specific();
return single_value->field_tP__LP;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__LP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_LP of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__LP;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__Spare1()
{
set_specific();
return single_value->field_tP__Spare1;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__Spare1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Spare1 of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__Spare1;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__SRQ()
{
set_specific();
return single_value->field_tP__SRQ;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__SRQ() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SRQ of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__SRQ;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__UDHI()
{
set_specific();
return single_value->field_tP__UDHI;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__UDHI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDHI of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__UDHI;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__Spare2()
{
set_specific();
return single_value->field_tP__Spare2;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__Spare2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Spare2 of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__Spare2;
}

OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__MR()
{
set_specific();
return single_value->field_tP__MR;
}

const OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__MR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MR of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__MR;
}

TP__RA_template& SMS__STATUS__REPORT_template::tP__RA()
{
set_specific();
return single_value->field_tP__RA;
}

const TP__RA_template& SMS__STATUS__REPORT_template::tP__RA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_RA of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__RA;
}

OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__SCTS()
{
set_specific();
return single_value->field_tP__SCTS;
}

const OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__SCTS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SCTS of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__SCTS;
}

OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__DT()
{
set_specific();
return single_value->field_tP__DT;
}

const OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__DT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DT of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__DT;
}

OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__ST()
{
set_specific();
return single_value->field_tP__ST;
}

const OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__ST() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_ST of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__ST;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__PresenceBitTP__PID()
{
set_specific();
return single_value->field_tP__PresenceBitTP__PID;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__PresenceBitTP__PID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_PID of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__PresenceBitTP__PID;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__PresenceBitTP__DCS()
{
set_specific();
return single_value->field_tP__PresenceBitTP__DCS;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__PresenceBitTP__DCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_DCS of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__PresenceBitTP__DCS;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__PresenceBitTP__UDL()
{
set_specific();
return single_value->field_tP__PresenceBitTP__UDL;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__PresenceBitTP__UDL() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_UDL of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__PresenceBitTP__UDL;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__Reserved()
{
set_specific();
return single_value->field_tP__Reserved;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__Reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Reserved of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__Reserved;
}

BITSTRING_template& SMS__STATUS__REPORT_template::tP__ExtensionBit()
{
set_specific();
return single_value->field_tP__ExtensionBit;
}

const BITSTRING_template& SMS__STATUS__REPORT_template::tP__ExtensionBit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_ExtensionBit of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__ExtensionBit;
}

OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__PID()
{
set_specific();
return single_value->field_tP__PID;
}

const OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__PID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PID of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__PID;
}

OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__DCS()
{
set_specific();
return single_value->field_tP__DCS;
}

const OCTETSTRING_template& SMS__STATUS__REPORT_template::tP__DCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DCS of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__DCS;
}

TP__UDL__UD_template& SMS__STATUS__REPORT_template::tP__UDL__UD()
{
set_specific();
return single_value->field_tP__UDL__UD;
}

const TP__UDL__UD_template& SMS__STATUS__REPORT_template::tP__UDL__UD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDL_UD of a non-specific template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
return single_value->field_tP__UDL__UD;
}

int SMS__STATUS__REPORT_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 12;
      if (single_value->field_tP__PresenceBitTP__PID.is_present()) ret_val++;
      if (single_value->field_tP__PresenceBitTP__DCS.is_present()) ret_val++;
      if (single_value->field_tP__PresenceBitTP__UDL.is_present()) ret_val++;
      if (single_value->field_tP__Reserved.is_present()) ret_val++;
      if (single_value->field_tP__ExtensionBit.is_present()) ret_val++;
      if (single_value->field_tP__PID.is_present()) ret_val++;
      if (single_value->field_tP__DCS.is_present()) ret_val++;
      if (single_value->field_tP__UDL__UD.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_SMS_Types.SMS_STATUS_REPORT 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_SMS_Types.SMS_STATUS_REPORT containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT.");
  }
  return 0;
}

void SMS__STATUS__REPORT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_MTI := ");
single_value->field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_MMS := ");
single_value->field_tP__MMS.log();
TTCN_Logger::log_event_str(", tP_LP := ");
single_value->field_tP__LP.log();
TTCN_Logger::log_event_str(", tP_Spare1 := ");
single_value->field_tP__Spare1.log();
TTCN_Logger::log_event_str(", tP_SRQ := ");
single_value->field_tP__SRQ.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_Spare2 := ");
single_value->field_tP__Spare2.log();
TTCN_Logger::log_event_str(", tP_MR := ");
single_value->field_tP__MR.log();
TTCN_Logger::log_event_str(", tP_RA := ");
single_value->field_tP__RA.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_DT := ");
single_value->field_tP__DT.log();
TTCN_Logger::log_event_str(", tP_ST := ");
single_value->field_tP__ST.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
single_value->field_tP__PresenceBitTP__PID.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
single_value->field_tP__PresenceBitTP__DCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
single_value->field_tP__PresenceBitTP__UDL.log();
TTCN_Logger::log_event_str(", tP_Reserved := ");
single_value->field_tP__Reserved.log();
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
single_value->field_tP__ExtensionBit.log();
TTCN_Logger::log_event_str(", tP_PID := ");
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
single_value->field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
single_value->field_tP__UDL__UD.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 SMS__STATUS__REPORT_template::log_match(const SMS__STATUS__REPORT& 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_tP__MTI.match(match_value.tP__MTI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MTI");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__MMS.match(match_value.tP__MMS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MMS");
single_value->field_tP__MMS.log_match(match_value.tP__MMS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__LP.match(match_value.tP__LP(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_LP");
single_value->field_tP__LP.log_match(match_value.tP__LP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Spare1.match(match_value.tP__Spare1(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Spare1");
single_value->field_tP__Spare1.log_match(match_value.tP__Spare1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__SRQ.match(match_value.tP__SRQ(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SRQ");
single_value->field_tP__SRQ.log_match(match_value.tP__SRQ(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__UDHI.match(match_value.tP__UDHI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDHI");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Spare2.match(match_value.tP__Spare2(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Spare2");
single_value->field_tP__Spare2.log_match(match_value.tP__Spare2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__MR.match(match_value.tP__MR(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MR");
single_value->field_tP__MR.log_match(match_value.tP__MR(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__RA.match(match_value.tP__RA(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_RA");
single_value->field_tP__RA.log_match(match_value.tP__RA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__SCTS.match(match_value.tP__SCTS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SCTS");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__DT.match(match_value.tP__DT(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DT");
single_value->field_tP__DT.log_match(match_value.tP__DT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__ST.match(match_value.tP__ST(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_ST");
single_value->field_tP__ST.log_match(match_value.tP__ST(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tP__PresenceBitTP__PID().ispresent()){
if(!single_value->field_tP__PresenceBitTP__PID.match(match_value.tP__PresenceBitTP__PID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_PID");
single_value->field_tP__PresenceBitTP__PID.log_match(match_value.tP__PresenceBitTP__PID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__PresenceBitTP__PID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_PID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__PresenceBitTP__PID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__PresenceBitTP__DCS().ispresent()){
if(!single_value->field_tP__PresenceBitTP__DCS.match(match_value.tP__PresenceBitTP__DCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_DCS");
single_value->field_tP__PresenceBitTP__DCS.log_match(match_value.tP__PresenceBitTP__DCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__PresenceBitTP__DCS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_DCS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__PresenceBitTP__DCS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__PresenceBitTP__UDL().ispresent()){
if(!single_value->field_tP__PresenceBitTP__UDL.match(match_value.tP__PresenceBitTP__UDL(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_UDL");
single_value->field_tP__PresenceBitTP__UDL.log_match(match_value.tP__PresenceBitTP__UDL(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__PresenceBitTP__UDL.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_UDL := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__PresenceBitTP__UDL.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__Reserved().ispresent()){
if(!single_value->field_tP__Reserved.match(match_value.tP__Reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Reserved");
single_value->field_tP__Reserved.log_match(match_value.tP__Reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__Reserved.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_Reserved := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__Reserved.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__ExtensionBit().ispresent()){
if(!single_value->field_tP__ExtensionBit.match(match_value.tP__ExtensionBit(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_ExtensionBit");
single_value->field_tP__ExtensionBit.log_match(match_value.tP__ExtensionBit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__ExtensionBit.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_ExtensionBit := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__ExtensionBit.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__PID().ispresent()){
if(!single_value->field_tP__PID.match(match_value.tP__PID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PID");
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__PID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_PID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__DCS().ispresent()){
if(!single_value->field_tP__DCS.match(match_value.tP__DCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DCS");
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__DCS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_DCS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__DCS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__UDL__UD().ispresent()){
if(!single_value->field_tP__UDL__UD.match(match_value.tP__UDL__UD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDL_UD");
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__UDL__UD.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_UDL_UD := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__UDL__UD.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("{ tP_MTI := ");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::log_event_str(", tP_MMS := ");
single_value->field_tP__MMS.log_match(match_value.tP__MMS(), legacy);
TTCN_Logger::log_event_str(", tP_LP := ");
single_value->field_tP__LP.log_match(match_value.tP__LP(), legacy);
TTCN_Logger::log_event_str(", tP_Spare1 := ");
single_value->field_tP__Spare1.log_match(match_value.tP__Spare1(), legacy);
TTCN_Logger::log_event_str(", tP_SRQ := ");
single_value->field_tP__SRQ.log_match(match_value.tP__SRQ(), legacy);
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::log_event_str(", tP_Spare2 := ");
single_value->field_tP__Spare2.log_match(match_value.tP__Spare2(), legacy);
TTCN_Logger::log_event_str(", tP_MR := ");
single_value->field_tP__MR.log_match(match_value.tP__MR(), legacy);
TTCN_Logger::log_event_str(", tP_RA := ");
single_value->field_tP__RA.log_match(match_value.tP__RA(), legacy);
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::log_event_str(", tP_DT := ");
single_value->field_tP__DT.log_match(match_value.tP__DT(), legacy);
TTCN_Logger::log_event_str(", tP_ST := ");
single_value->field_tP__ST.log_match(match_value.tP__ST(), legacy);
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
if (match_value.tP__PresenceBitTP__PID().ispresent()) {
single_value->field_tP__PresenceBitTP__PID.log_match(match_value.tP__PresenceBitTP__PID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__PresenceBitTP__PID.log();
if (single_value->field_tP__PresenceBitTP__PID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
if (match_value.tP__PresenceBitTP__DCS().ispresent()) {
single_value->field_tP__PresenceBitTP__DCS.log_match(match_value.tP__PresenceBitTP__DCS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__PresenceBitTP__DCS.log();
if (single_value->field_tP__PresenceBitTP__DCS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
if (match_value.tP__PresenceBitTP__UDL().ispresent()) {
single_value->field_tP__PresenceBitTP__UDL.log_match(match_value.tP__PresenceBitTP__UDL(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__PresenceBitTP__UDL.log();
if (single_value->field_tP__PresenceBitTP__UDL.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_Reserved := ");
if (match_value.tP__Reserved().ispresent()) {
single_value->field_tP__Reserved.log_match(match_value.tP__Reserved(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__Reserved.log();
if (single_value->field_tP__Reserved.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
if (match_value.tP__ExtensionBit().ispresent()) {
single_value->field_tP__ExtensionBit.log_match(match_value.tP__ExtensionBit(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__ExtensionBit.log();
if (single_value->field_tP__ExtensionBit.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_PID := ");
if (match_value.tP__PID().ispresent()) {
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__PID.log();
if (single_value->field_tP__PID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_DCS := ");
if (match_value.tP__DCS().ispresent()) {
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__DCS.log();
if (single_value->field_tP__DCS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
if (match_value.tP__UDL__UD().ispresent()) {
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__UDL__UD.log();
if (single_value->field_tP__UDL__UD.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 SMS__STATUS__REPORT_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__MMS().is_bound()) tP__MMS().set_implicit_omit();
if (tP__LP().is_bound()) tP__LP().set_implicit_omit();
if (tP__Spare1().is_bound()) tP__Spare1().set_implicit_omit();
if (tP__SRQ().is_bound()) tP__SRQ().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__Spare2().is_bound()) tP__Spare2().set_implicit_omit();
if (tP__MR().is_bound()) tP__MR().set_implicit_omit();
if (tP__RA().is_bound()) tP__RA().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (tP__DT().is_bound()) tP__DT().set_implicit_omit();
if (tP__ST().is_bound()) tP__ST().set_implicit_omit();
if (!tP__PresenceBitTP__PID().is_bound()) tP__PresenceBitTP__PID() = OMIT_VALUE;
else tP__PresenceBitTP__PID().set_implicit_omit();
if (!tP__PresenceBitTP__DCS().is_bound()) tP__PresenceBitTP__DCS() = OMIT_VALUE;
else tP__PresenceBitTP__DCS().set_implicit_omit();
if (!tP__PresenceBitTP__UDL().is_bound()) tP__PresenceBitTP__UDL() = OMIT_VALUE;
else tP__PresenceBitTP__UDL().set_implicit_omit();
if (!tP__Reserved().is_bound()) tP__Reserved() = OMIT_VALUE;
else tP__Reserved().set_implicit_omit();
if (!tP__ExtensionBit().is_bound()) tP__ExtensionBit() = OMIT_VALUE;
else tP__ExtensionBit().set_implicit_omit();
if (!tP__PID().is_bound()) tP__PID() = OMIT_VALUE;
else tP__PID().set_implicit_omit();
if (!tP__DCS().is_bound()) tP__DCS() = OMIT_VALUE;
else tP__DCS().set_implicit_omit();
if (!tP__UDL__UD().is_bound()) tP__UDL__UD() = OMIT_VALUE;
else tP__UDL__UD().set_implicit_omit();
}

void SMS__STATUS__REPORT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__MTI.encode_text(text_buf);
single_value->field_tP__MMS.encode_text(text_buf);
single_value->field_tP__LP.encode_text(text_buf);
single_value->field_tP__Spare1.encode_text(text_buf);
single_value->field_tP__SRQ.encode_text(text_buf);
single_value->field_tP__UDHI.encode_text(text_buf);
single_value->field_tP__Spare2.encode_text(text_buf);
single_value->field_tP__MR.encode_text(text_buf);
single_value->field_tP__RA.encode_text(text_buf);
single_value->field_tP__SCTS.encode_text(text_buf);
single_value->field_tP__DT.encode_text(text_buf);
single_value->field_tP__ST.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__PID.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__DCS.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__UDL.encode_text(text_buf);
single_value->field_tP__Reserved.encode_text(text_buf);
single_value->field_tP__ExtensionBit.encode_text(text_buf);
single_value->field_tP__PID.encode_text(text_buf);
single_value->field_tP__DCS.encode_text(text_buf);
single_value->field_tP__UDL__UD.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_SMS_Types.SMS_STATUS_REPORT.");
}
}

void SMS__STATUS__REPORT_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_tP__MTI.decode_text(text_buf);
single_value->field_tP__MMS.decode_text(text_buf);
single_value->field_tP__LP.decode_text(text_buf);
single_value->field_tP__Spare1.decode_text(text_buf);
single_value->field_tP__SRQ.decode_text(text_buf);
single_value->field_tP__UDHI.decode_text(text_buf);
single_value->field_tP__Spare2.decode_text(text_buf);
single_value->field_tP__MR.decode_text(text_buf);
single_value->field_tP__RA.decode_text(text_buf);
single_value->field_tP__SCTS.decode_text(text_buf);
single_value->field_tP__DT.decode_text(text_buf);
single_value->field_tP__ST.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__PID.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__DCS.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__UDL.decode_text(text_buf);
single_value->field_tP__Reserved.decode_text(text_buf);
single_value->field_tP__ExtensionBit.decode_text(text_buf);
single_value->field_tP__PID.decode_text(text_buf);
single_value->field_tP__DCS.decode_text(text_buf);
single_value->field_tP__UDL__UD.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 SMS__STATUS__REPORT_template[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_SMS_Types.SMS_STATUS_REPORT.");
}
}

void SMS__STATUS__REPORT_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: {
    SMS__STATUS__REPORT_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 (20<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.SMS_STATUS_REPORT has 20 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__MMS().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__LP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__SRQ().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__MR().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__RA().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__DT().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__ST().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__PID().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__DCS().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__UDL().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) tP__Reserved().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) tP__ExtensionBit().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(19));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_LP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__LP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_SRQ")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRQ().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_MR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_RA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ST")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ST().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_UDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__UDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__Reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ExtensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ExtensionBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_STATUS_REPORT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__STATUS__REPORT_template* precondition = new SMS__STATUS__REPORT_template;
    precondition->set_param(*param.get_elem(0));
    SMS__STATUS__REPORT_template* implied_template = new SMS__STATUS__REPORT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__STATUS__REPORT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__STATUS__REPORT_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_tP__MTI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__MMS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__LP.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__Spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__SRQ.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__Spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__MR.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__RA.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__SCTS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__DT.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__ST.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__PresenceBitTP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__PresenceBitTP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__PresenceBitTP__UDL.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__Reserved.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__ExtensionBit.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
single_value->field_tP__UDL__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_STATUS_REPORT");
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_SMS_Types.SMS_STATUS_REPORT");
}

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

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

RP__DATA__User__DataLV__SGSN__MS::RP__DATA__User__DataLV__SGSN__MS()
{
}

RP__DATA__User__DataLV__SGSN__MS::RP__DATA__User__DataLV__SGSN__MS(const INTEGER& par_rP__LengthIndicator,
    const TPDU__RP__DATA__SGSN__MS& par_rP__TPDU)
  :   field_rP__LengthIndicator(par_rP__LengthIndicator),
  field_rP__TPDU(par_rP__TPDU)
{
}

RP__DATA__User__DataLV__SGSN__MS::RP__DATA__User__DataLV__SGSN__MS(const RP__DATA__User__DataLV__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
else field_rP__LengthIndicator.clean_up();
if (other_value.rP__TPDU().is_bound()) field_rP__TPDU = other_value.rP__TPDU();
else field_rP__TPDU.clean_up();
}

void RP__DATA__User__DataLV__SGSN__MS::clean_up()
{
field_rP__LengthIndicator.clean_up();
field_rP__TPDU.clean_up();
}

const TTCN_Typedescriptor_t* RP__DATA__User__DataLV__SGSN__MS::get_descriptor() const { return &RP__DATA__User__DataLV__SGSN__MS_descr_; }
RP__DATA__User__DataLV__SGSN__MS& RP__DATA__User__DataLV__SGSN__MS::operator=(const RP__DATA__User__DataLV__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
  if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
  else field_rP__LengthIndicator.clean_up();
  if (other_value.rP__TPDU().is_bound()) field_rP__TPDU = other_value.rP__TPDU();
  else field_rP__TPDU.clean_up();
}
return *this;
}

boolean RP__DATA__User__DataLV__SGSN__MS::operator==(const RP__DATA__User__DataLV__SGSN__MS& other_value) const
{
return field_rP__LengthIndicator==other_value.field_rP__LengthIndicator
  && field_rP__TPDU==other_value.field_rP__TPDU;
}

boolean RP__DATA__User__DataLV__SGSN__MS::is_bound() const
{
return (field_rP__LengthIndicator.is_bound())
  || (field_rP__TPDU.is_bound());
}
boolean RP__DATA__User__DataLV__SGSN__MS::is_value() const
{
return field_rP__LengthIndicator.is_value()
  && field_rP__TPDU.is_value();
}
void RP__DATA__User__DataLV__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rP_LengthIndicator := ");
field_rP__LengthIndicator.log();
TTCN_Logger::log_event_str(", rP_TPDU := ");
field_rP__TPDU.log();
TTCN_Logger::log_event_str(" }");
}

void RP__DATA__User__DataLV__SGSN__MS::set_implicit_omit()
{
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__TPDU().is_bound()) rP__TPDU().set_implicit_omit();
}

void RP__DATA__User__DataLV__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS 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) rP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__TPDU().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(), "rP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_TPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__TPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.RP_DATA_User_DataLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS");
  }
}

void RP__DATA__User__DataLV__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_rP__LengthIndicator.encode_text(text_buf);
field_rP__TPDU.encode_text(text_buf);
}

void RP__DATA__User__DataLV__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_rP__LengthIndicator.decode_text(text_buf);
field_rP__TPDU.decode_text(text_buf);
}

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

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

int RP__DATA__User__DataLV__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_rP__LengthIndicator.RAW_decode(RP__DATA__User__DataLV__SGSN__MS_rP__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_rP__LengthIndicator.convert_to_Integer(RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_descr_);
  field_rP__LengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, TPDU__RP__DATA__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_rP__TPDU.RAW_decode(TPDU__RP__DATA__SGSN__MS_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 RP__DATA__User__DataLV__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TPDU__RP__DATA__SGSN__MS_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RP__DATA__User__DataLV__SGSN__MS_rP__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_rP__TPDU.RAW_encode(TPDU__RP__DATA__SGSN__MS_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RP__DATA__User__DataLV__SGSN__MS_template::single_value_struct {
INTEGER_template field_rP__LengthIndicator;
TPDU__RP__DATA__SGSN__MS_template field_rP__TPDU;
};

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

void RP__DATA__User__DataLV__SGSN__MS_template::copy_value(const RP__DATA__User__DataLV__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.rP__LengthIndicator().is_bound()) {
  single_value->field_rP__LengthIndicator = other_value.rP__LengthIndicator();
} else {
  single_value->field_rP__LengthIndicator.clean_up();
}
if (other_value.rP__TPDU().is_bound()) {
  single_value->field_rP__TPDU = other_value.rP__TPDU();
} else {
  single_value->field_rP__TPDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__DATA__User__DataLV__SGSN__MS_template::copy_template(const RP__DATA__User__DataLV__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rP__LengthIndicator().get_selection()) {
single_value->field_rP__LengthIndicator = other_value.rP__LengthIndicator();
} else {
single_value->field_rP__LengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__TPDU().get_selection()) {
single_value->field_rP__TPDU = other_value.rP__TPDU();
} else {
single_value->field_rP__TPDU.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 RP__DATA__User__DataLV__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RP__DATA__User__DataLV__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__DATA__User__DataLV__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
break;
}
set_selection(other_value);
}

RP__DATA__User__DataLV__SGSN__MS_template::RP__DATA__User__DataLV__SGSN__MS_template()
{
}

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

RP__DATA__User__DataLV__SGSN__MS_template::RP__DATA__User__DataLV__SGSN__MS_template(const RP__DATA__User__DataLV__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__DATA__User__DataLV__SGSN__MS_template::match(const RP__DATA__User__DataLV__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.rP__LengthIndicator().is_bound()) return FALSE;
if(!single_value->field_rP__LengthIndicator.match(other_value.rP__LengthIndicator(), legacy))return FALSE;
if(!other_value.rP__TPDU().is_bound()) return FALSE;
if(!single_value->field_rP__TPDU.match(other_value.rP__TPDU(), 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_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
}
return FALSE;
}

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

boolean RP__DATA__User__DataLV__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rP__LengthIndicator.is_value()
 && single_value->field_rP__TPDU.is_value();
}

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

RP__DATA__User__DataLV__SGSN__MS RP__DATA__User__DataLV__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
RP__DATA__User__DataLV__SGSN__MS ret_val;
if (single_value->field_rP__LengthIndicator.is_bound()) {
ret_val.rP__LengthIndicator() = single_value->field_rP__LengthIndicator.valueof();
}
if (single_value->field_rP__TPDU.is_bound()) {
ret_val.rP__TPDU() = single_value->field_rP__TPDU.valueof();
}
return ret_val;
}

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

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

INTEGER_template& RP__DATA__User__DataLV__SGSN__MS_template::rP__LengthIndicator()
{
set_specific();
return single_value->field_rP__LengthIndicator;
}

const INTEGER_template& RP__DATA__User__DataLV__SGSN__MS_template::rP__LengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_LengthIndicator of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
return single_value->field_rP__LengthIndicator;
}

TPDU__RP__DATA__SGSN__MS_template& RP__DATA__User__DataLV__SGSN__MS_template::rP__TPDU()
{
set_specific();
return single_value->field_rP__TPDU;
}

const TPDU__RP__DATA__SGSN__MS_template& RP__DATA__User__DataLV__SGSN__MS_template::rP__TPDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_TPDU of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
return single_value->field_rP__TPDU;
}

int RP__DATA__User__DataLV__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS 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_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
  }
  return 0;
}

void RP__DATA__User__DataLV__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rP_LengthIndicator := ");
single_value->field_rP__LengthIndicator.log();
TTCN_Logger::log_event_str(", rP_TPDU := ");
single_value->field_rP__TPDU.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 RP__DATA__User__DataLV__SGSN__MS_template::log_match(const RP__DATA__User__DataLV__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_rP__LengthIndicator.match(match_value.rP__LengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_LengthIndicator");
single_value->field_rP__LengthIndicator.log_match(match_value.rP__LengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__TPDU.match(match_value.rP__TPDU(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_TPDU");
single_value->field_rP__TPDU.log_match(match_value.rP__TPDU(), 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("{ rP_LengthIndicator := ");
single_value->field_rP__LengthIndicator.log_match(match_value.rP__LengthIndicator(), legacy);
TTCN_Logger::log_event_str(", rP_TPDU := ");
single_value->field_rP__TPDU.log_match(match_value.rP__TPDU(), 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 RP__DATA__User__DataLV__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__TPDU().is_bound()) rP__TPDU().set_implicit_omit();
}

void RP__DATA__User__DataLV__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rP__LengthIndicator.encode_text(text_buf);
single_value->field_rP__TPDU.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_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.");
}
}

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

void RP__DATA__User__DataLV__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RP__DATA__User__DataLV__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS 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) rP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__TPDU().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(), "rP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_TPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__TPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.RP_DATA_User_DataLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__DATA__User__DataLV__SGSN__MS_template* precondition = new RP__DATA__User__DataLV__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    RP__DATA__User__DataLV__SGSN__MS_template* implied_template = new RP__DATA__User__DataLV__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__DATA__User__DataLV__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

RP__DATA__SGSN__MS::RP__DATA__SGSN__MS()
{
}

RP__DATA__SGSN__MS::RP__DATA__SGSN__MS(const BITSTRING& par_rP__MTI,
    const BITSTRING& par_rP__Spare,
    const OCTETSTRING& par_rP__MessageReference,
    const RP__OriginatorAddressLV& par_rP__OriginatorAddress,
    const RP__DestinationAddressLV& par_rP__DestinationAddress,
    const RP__DATA__User__DataLV__SGSN__MS& par_rP__User__Data)
  :   field_rP__MTI(par_rP__MTI),
  field_rP__Spare(par_rP__Spare),
  field_rP__MessageReference(par_rP__MessageReference),
  field_rP__OriginatorAddress(par_rP__OriginatorAddress),
  field_rP__DestinationAddress(par_rP__DestinationAddress),
  field_rP__User__Data(par_rP__User__Data)
{
}

RP__DATA__SGSN__MS::RP__DATA__SGSN__MS(const RP__DATA__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
if (other_value.rP__MTI().is_bound()) field_rP__MTI = other_value.rP__MTI();
else field_rP__MTI.clean_up();
if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
else field_rP__Spare.clean_up();
if (other_value.rP__MessageReference().is_bound()) field_rP__MessageReference = other_value.rP__MessageReference();
else field_rP__MessageReference.clean_up();
if (other_value.rP__OriginatorAddress().is_bound()) field_rP__OriginatorAddress = other_value.rP__OriginatorAddress();
else field_rP__OriginatorAddress.clean_up();
if (other_value.rP__DestinationAddress().is_bound()) field_rP__DestinationAddress = other_value.rP__DestinationAddress();
else field_rP__DestinationAddress.clean_up();
if (other_value.rP__User__Data().is_bound()) field_rP__User__Data = other_value.rP__User__Data();
else field_rP__User__Data.clean_up();
}

void RP__DATA__SGSN__MS::clean_up()
{
field_rP__MTI.clean_up();
field_rP__Spare.clean_up();
field_rP__MessageReference.clean_up();
field_rP__OriginatorAddress.clean_up();
field_rP__DestinationAddress.clean_up();
field_rP__User__Data.clean_up();
}

const TTCN_Typedescriptor_t* RP__DATA__SGSN__MS::get_descriptor() const { return &RP__DATA__SGSN__MS_descr_; }
RP__DATA__SGSN__MS& RP__DATA__SGSN__MS::operator=(const RP__DATA__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
  if (other_value.rP__MTI().is_bound()) field_rP__MTI = other_value.rP__MTI();
  else field_rP__MTI.clean_up();
  if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
  else field_rP__Spare.clean_up();
  if (other_value.rP__MessageReference().is_bound()) field_rP__MessageReference = other_value.rP__MessageReference();
  else field_rP__MessageReference.clean_up();
  if (other_value.rP__OriginatorAddress().is_bound()) field_rP__OriginatorAddress = other_value.rP__OriginatorAddress();
  else field_rP__OriginatorAddress.clean_up();
  if (other_value.rP__DestinationAddress().is_bound()) field_rP__DestinationAddress = other_value.rP__DestinationAddress();
  else field_rP__DestinationAddress.clean_up();
  if (other_value.rP__User__Data().is_bound()) field_rP__User__Data = other_value.rP__User__Data();
  else field_rP__User__Data.clean_up();
}
return *this;
}

boolean RP__DATA__SGSN__MS::operator==(const RP__DATA__SGSN__MS& other_value) const
{
return field_rP__MTI==other_value.field_rP__MTI
  && field_rP__Spare==other_value.field_rP__Spare
  && field_rP__MessageReference==other_value.field_rP__MessageReference
  && field_rP__OriginatorAddress==other_value.field_rP__OriginatorAddress
  && field_rP__DestinationAddress==other_value.field_rP__DestinationAddress
  && field_rP__User__Data==other_value.field_rP__User__Data;
}

boolean RP__DATA__SGSN__MS::is_bound() const
{
return (field_rP__MTI.is_bound())
  || (field_rP__Spare.is_bound())
  || (field_rP__MessageReference.is_bound())
  || (field_rP__OriginatorAddress.is_bound())
  || (field_rP__DestinationAddress.is_bound())
  || (field_rP__User__Data.is_bound());
}
boolean RP__DATA__SGSN__MS::is_value() const
{
return field_rP__MTI.is_value()
  && field_rP__Spare.is_value()
  && field_rP__MessageReference.is_value()
  && field_rP__OriginatorAddress.is_value()
  && field_rP__DestinationAddress.is_value()
  && field_rP__User__Data.is_value();
}
void RP__DATA__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rP_MTI := ");
field_rP__MTI.log();
TTCN_Logger::log_event_str(", rP_Spare := ");
field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_MessageReference := ");
field_rP__MessageReference.log();
TTCN_Logger::log_event_str(", rP_OriginatorAddress := ");
field_rP__OriginatorAddress.log();
TTCN_Logger::log_event_str(", rP_DestinationAddress := ");
field_rP__DestinationAddress.log();
TTCN_Logger::log_event_str(", rP_User_Data := ");
field_rP__User__Data.log();
TTCN_Logger::log_event_str(" }");
}

void RP__DATA__SGSN__MS::set_implicit_omit()
{
if (rP__MTI().is_bound()) rP__MTI().set_implicit_omit();
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__MessageReference().is_bound()) rP__MessageReference().set_implicit_omit();
if (rP__OriginatorAddress().is_bound()) rP__OriginatorAddress().set_implicit_omit();
if (rP__DestinationAddress().is_bound()) rP__DestinationAddress().set_implicit_omit();
if (rP__User__Data().is_bound()) rP__User__Data().set_implicit_omit();
}

void RP__DATA__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) rP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__Spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__MessageReference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__OriginatorAddress().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rP__DestinationAddress().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rP__User__Data().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_MessageReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MessageReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_OriginatorAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__OriginatorAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_DestinationAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__DestinationAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_User_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__User__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.RP_DATA_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
  }
}

void RP__DATA__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_rP__MTI.encode_text(text_buf);
field_rP__Spare.encode_text(text_buf);
field_rP__MessageReference.encode_text(text_buf);
field_rP__OriginatorAddress.encode_text(text_buf);
field_rP__DestinationAddress.encode_text(text_buf);
field_rP__User__Data.encode_text(text_buf);
}

void RP__DATA__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_rP__MTI.decode_text(text_buf);
field_rP__Spare.decode_text(text_buf);
field_rP__MessageReference.decode_text(text_buf);
field_rP__OriginatorAddress.decode_text(text_buf);
field_rP__DestinationAddress.decode_text(text_buf);
field_rP__User__Data.decode_text(text_buf);
}

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

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

int RP__DATA__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_rP__MTI.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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_rP__Spare.RAW_decode(General__Types::BIT5_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_rP__MessageReference.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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, RP__OriginatorAddressLV_descr_.raw->forceomit);
  decoded_field_length = field_rP__OriginatorAddress.RAW_decode(RP__OriginatorAddressLV_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, RP__DestinationAddressLV_descr_.raw->forceomit);
  decoded_field_length = field_rP__DestinationAddress.RAW_decode(RP__DestinationAddressLV_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, RP__DATA__User__DataLV__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_rP__User__Data.RAW_decode(RP__DATA__User__DataLV__SGSN__MS_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_rP__MTI !=  bs_5) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__DATA__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT5_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, RP__OriginatorAddressLV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RP__DestinationAddressLV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RP__DATA__User__DataLV__SGSN__MS_descr_.raw);
  encoded_length += field_rP__MTI.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__Spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rP__MessageReference.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rP__OriginatorAddress.RAW_encode(RP__OriginatorAddressLV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rP__DestinationAddress.RAW_encode(RP__DestinationAddressLV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_rP__User__Data.RAW_encode(RP__DATA__User__DataLV__SGSN__MS_descr_, *myleaf.body.node.nodes[5]);
  if (field_rP__MTI !=  bs_5) {
  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_5.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 RP__DATA__SGSN__MS_template::single_value_struct {
BITSTRING_template field_rP__MTI;
BITSTRING_template field_rP__Spare;
OCTETSTRING_template field_rP__MessageReference;
RP__OriginatorAddressLV_template field_rP__OriginatorAddress;
RP__DestinationAddressLV_template field_rP__DestinationAddress;
RP__DATA__User__DataLV__SGSN__MS_template field_rP__User__Data;
};

void RP__DATA__SGSN__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_rP__MTI = ANY_VALUE;
single_value->field_rP__Spare = ANY_VALUE;
single_value->field_rP__MessageReference = ANY_VALUE;
single_value->field_rP__OriginatorAddress = ANY_VALUE;
single_value->field_rP__DestinationAddress = ANY_VALUE;
single_value->field_rP__User__Data = ANY_VALUE;
}
}
}

void RP__DATA__SGSN__MS_template::copy_value(const RP__DATA__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.rP__MTI().is_bound()) {
  single_value->field_rP__MTI = other_value.rP__MTI();
} else {
  single_value->field_rP__MTI.clean_up();
}
if (other_value.rP__Spare().is_bound()) {
  single_value->field_rP__Spare = other_value.rP__Spare();
} else {
  single_value->field_rP__Spare.clean_up();
}
if (other_value.rP__MessageReference().is_bound()) {
  single_value->field_rP__MessageReference = other_value.rP__MessageReference();
} else {
  single_value->field_rP__MessageReference.clean_up();
}
if (other_value.rP__OriginatorAddress().is_bound()) {
  single_value->field_rP__OriginatorAddress = other_value.rP__OriginatorAddress();
} else {
  single_value->field_rP__OriginatorAddress.clean_up();
}
if (other_value.rP__DestinationAddress().is_bound()) {
  single_value->field_rP__DestinationAddress = other_value.rP__DestinationAddress();
} else {
  single_value->field_rP__DestinationAddress.clean_up();
}
if (other_value.rP__User__Data().is_bound()) {
  single_value->field_rP__User__Data = other_value.rP__User__Data();
} else {
  single_value->field_rP__User__Data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__DATA__SGSN__MS_template::copy_template(const RP__DATA__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rP__MTI().get_selection()) {
single_value->field_rP__MTI = other_value.rP__MTI();
} else {
single_value->field_rP__MTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__Spare().get_selection()) {
single_value->field_rP__Spare = other_value.rP__Spare();
} else {
single_value->field_rP__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__MessageReference().get_selection()) {
single_value->field_rP__MessageReference = other_value.rP__MessageReference();
} else {
single_value->field_rP__MessageReference.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__OriginatorAddress().get_selection()) {
single_value->field_rP__OriginatorAddress = other_value.rP__OriginatorAddress();
} else {
single_value->field_rP__OriginatorAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__DestinationAddress().get_selection()) {
single_value->field_rP__DestinationAddress = other_value.rP__DestinationAddress();
} else {
single_value->field_rP__DestinationAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__User__Data().get_selection()) {
single_value->field_rP__User__Data = other_value.rP__User__Data();
} else {
single_value->field_rP__User__Data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RP__DATA__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RP__DATA__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__DATA__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
break;
}
set_selection(other_value);
}

RP__DATA__SGSN__MS_template::RP__DATA__SGSN__MS_template()
{
}

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

RP__DATA__SGSN__MS_template::RP__DATA__SGSN__MS_template(const RP__DATA__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__DATA__SGSN__MS_template::match(const RP__DATA__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.rP__MTI().is_bound()) return FALSE;
if(!single_value->field_rP__MTI.match(other_value.rP__MTI(), legacy))return FALSE;
if(!other_value.rP__Spare().is_bound()) return FALSE;
if(!single_value->field_rP__Spare.match(other_value.rP__Spare(), legacy))return FALSE;
if(!other_value.rP__MessageReference().is_bound()) return FALSE;
if(!single_value->field_rP__MessageReference.match(other_value.rP__MessageReference(), legacy))return FALSE;
if(!other_value.rP__OriginatorAddress().is_bound()) return FALSE;
if(!single_value->field_rP__OriginatorAddress.match(other_value.rP__OriginatorAddress(), legacy))return FALSE;
if(!other_value.rP__DestinationAddress().is_bound()) return FALSE;
if(!single_value->field_rP__DestinationAddress.match(other_value.rP__DestinationAddress(), legacy))return FALSE;
if(!other_value.rP__User__Data().is_bound()) return FALSE;
if(!single_value->field_rP__User__Data.match(other_value.rP__User__Data(), 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_SMS_Types.RP_DATA_SGSN_MS.");
}
return FALSE;
}

boolean RP__DATA__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rP__MTI.is_bound()
 || single_value->field_rP__Spare.is_bound()
 || single_value->field_rP__MessageReference.is_bound()
 || single_value->field_rP__OriginatorAddress.is_bound()
 || single_value->field_rP__DestinationAddress.is_bound()
 || single_value->field_rP__User__Data.is_bound();
}

boolean RP__DATA__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rP__MTI.is_value()
 && single_value->field_rP__Spare.is_value()
 && single_value->field_rP__MessageReference.is_value()
 && single_value->field_rP__OriginatorAddress.is_value()
 && single_value->field_rP__DestinationAddress.is_value()
 && single_value->field_rP__User__Data.is_value();
}

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

RP__DATA__SGSN__MS RP__DATA__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
RP__DATA__SGSN__MS ret_val;
if (single_value->field_rP__MTI.is_bound()) {
ret_val.rP__MTI() = single_value->field_rP__MTI.valueof();
}
if (single_value->field_rP__Spare.is_bound()) {
ret_val.rP__Spare() = single_value->field_rP__Spare.valueof();
}
if (single_value->field_rP__MessageReference.is_bound()) {
ret_val.rP__MessageReference() = single_value->field_rP__MessageReference.valueof();
}
if (single_value->field_rP__OriginatorAddress.is_bound()) {
ret_val.rP__OriginatorAddress() = single_value->field_rP__OriginatorAddress.valueof();
}
if (single_value->field_rP__DestinationAddress.is_bound()) {
ret_val.rP__DestinationAddress() = single_value->field_rP__DestinationAddress.valueof();
}
if (single_value->field_rP__User__Data.is_bound()) {
ret_val.rP__User__Data() = single_value->field_rP__User__Data.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RP__DATA__SGSN__MS_template::rP__MTI()
{
set_specific();
return single_value->field_rP__MTI;
}

const BITSTRING_template& RP__DATA__SGSN__MS_template::rP__MTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_MTI of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
return single_value->field_rP__MTI;
}

BITSTRING_template& RP__DATA__SGSN__MS_template::rP__Spare()
{
set_specific();
return single_value->field_rP__Spare;
}

const BITSTRING_template& RP__DATA__SGSN__MS_template::rP__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_Spare of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
return single_value->field_rP__Spare;
}

OCTETSTRING_template& RP__DATA__SGSN__MS_template::rP__MessageReference()
{
set_specific();
return single_value->field_rP__MessageReference;
}

const OCTETSTRING_template& RP__DATA__SGSN__MS_template::rP__MessageReference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_MessageReference of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
return single_value->field_rP__MessageReference;
}

RP__OriginatorAddressLV_template& RP__DATA__SGSN__MS_template::rP__OriginatorAddress()
{
set_specific();
return single_value->field_rP__OriginatorAddress;
}

const RP__OriginatorAddressLV_template& RP__DATA__SGSN__MS_template::rP__OriginatorAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_OriginatorAddress of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
return single_value->field_rP__OriginatorAddress;
}

RP__DestinationAddressLV_template& RP__DATA__SGSN__MS_template::rP__DestinationAddress()
{
set_specific();
return single_value->field_rP__DestinationAddress;
}

const RP__DestinationAddressLV_template& RP__DATA__SGSN__MS_template::rP__DestinationAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_DestinationAddress of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
return single_value->field_rP__DestinationAddress;
}

RP__DATA__User__DataLV__SGSN__MS_template& RP__DATA__SGSN__MS_template::rP__User__Data()
{
set_specific();
return single_value->field_rP__User__Data;
}

const RP__DATA__User__DataLV__SGSN__MS_template& RP__DATA__SGSN__MS_template::rP__User__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_User_Data of a non-specific template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
return single_value->field_rP__User__Data;
}

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

void RP__DATA__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rP_MTI := ");
single_value->field_rP__MTI.log();
TTCN_Logger::log_event_str(", rP_Spare := ");
single_value->field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_MessageReference := ");
single_value->field_rP__MessageReference.log();
TTCN_Logger::log_event_str(", rP_OriginatorAddress := ");
single_value->field_rP__OriginatorAddress.log();
TTCN_Logger::log_event_str(", rP_DestinationAddress := ");
single_value->field_rP__DestinationAddress.log();
TTCN_Logger::log_event_str(", rP_User_Data := ");
single_value->field_rP__User__Data.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RP__DATA__SGSN__MS_template::log_match(const RP__DATA__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_rP__MTI.match(match_value.rP__MTI(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_MTI");
single_value->field_rP__MTI.log_match(match_value.rP__MTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__Spare.match(match_value.rP__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_Spare");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__MessageReference.match(match_value.rP__MessageReference(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_MessageReference");
single_value->field_rP__MessageReference.log_match(match_value.rP__MessageReference(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__OriginatorAddress.match(match_value.rP__OriginatorAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_OriginatorAddress");
single_value->field_rP__OriginatorAddress.log_match(match_value.rP__OriginatorAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__DestinationAddress.match(match_value.rP__DestinationAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_DestinationAddress");
single_value->field_rP__DestinationAddress.log_match(match_value.rP__DestinationAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__User__Data.match(match_value.rP__User__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_User_Data");
single_value->field_rP__User__Data.log_match(match_value.rP__User__Data(), 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("{ rP_MTI := ");
single_value->field_rP__MTI.log_match(match_value.rP__MTI(), legacy);
TTCN_Logger::log_event_str(", rP_Spare := ");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::log_event_str(", rP_MessageReference := ");
single_value->field_rP__MessageReference.log_match(match_value.rP__MessageReference(), legacy);
TTCN_Logger::log_event_str(", rP_OriginatorAddress := ");
single_value->field_rP__OriginatorAddress.log_match(match_value.rP__OriginatorAddress(), legacy);
TTCN_Logger::log_event_str(", rP_DestinationAddress := ");
single_value->field_rP__DestinationAddress.log_match(match_value.rP__DestinationAddress(), legacy);
TTCN_Logger::log_event_str(", rP_User_Data := ");
single_value->field_rP__User__Data.log_match(match_value.rP__User__Data(), 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 RP__DATA__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__MTI().is_bound()) rP__MTI().set_implicit_omit();
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__MessageReference().is_bound()) rP__MessageReference().set_implicit_omit();
if (rP__OriginatorAddress().is_bound()) rP__OriginatorAddress().set_implicit_omit();
if (rP__DestinationAddress().is_bound()) rP__DestinationAddress().set_implicit_omit();
if (rP__User__Data().is_bound()) rP__User__Data().set_implicit_omit();
}

void RP__DATA__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rP__MTI.encode_text(text_buf);
single_value->field_rP__Spare.encode_text(text_buf);
single_value->field_rP__MessageReference.encode_text(text_buf);
single_value->field_rP__OriginatorAddress.encode_text(text_buf);
single_value->field_rP__DestinationAddress.encode_text(text_buf);
single_value->field_rP__User__Data.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS.");
}
}

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

void RP__DATA__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RP__DATA__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_DATA_SGSN_MS has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) rP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__Spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__MessageReference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__OriginatorAddress().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rP__DestinationAddress().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rP__User__Data().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_MessageReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MessageReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_OriginatorAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__OriginatorAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_DestinationAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__DestinationAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_User_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__User__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.RP_DATA_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__DATA__SGSN__MS_template* precondition = new RP__DATA__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    RP__DATA__SGSN__MS_template* implied_template = new RP__DATA__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__DATA__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void RP__DATA__SGSN__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_rP__MTI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
single_value->field_rP__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
single_value->field_rP__MessageReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
single_value->field_rP__OriginatorAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
single_value->field_rP__DestinationAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
single_value->field_rP__User__Data.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_SGSN_MS");
}

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

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

RP__ACK__SGSN__MS::RP__ACK__SGSN__MS()
{
}

RP__ACK__SGSN__MS::RP__ACK__SGSN__MS(const BITSTRING& par_rP__MTI,
    const BITSTRING& par_rP__Spare,
    const OCTETSTRING& par_rP__MessageReference,
    const OPTIONAL< RP__ACK__User__DataTLV__SGSN__MS >& par_rP__User__Data)
  :   field_rP__MTI(par_rP__MTI),
  field_rP__Spare(par_rP__Spare),
  field_rP__MessageReference(par_rP__MessageReference),
  field_rP__User__Data(par_rP__User__Data)
{
}

RP__ACK__SGSN__MS::RP__ACK__SGSN__MS(const RP__ACK__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
if (other_value.rP__MTI().is_bound()) field_rP__MTI = other_value.rP__MTI();
else field_rP__MTI.clean_up();
if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
else field_rP__Spare.clean_up();
if (other_value.rP__MessageReference().is_bound()) field_rP__MessageReference = other_value.rP__MessageReference();
else field_rP__MessageReference.clean_up();
if (other_value.rP__User__Data().is_bound()) field_rP__User__Data = other_value.rP__User__Data();
else field_rP__User__Data.clean_up();
}

void RP__ACK__SGSN__MS::clean_up()
{
field_rP__MTI.clean_up();
field_rP__Spare.clean_up();
field_rP__MessageReference.clean_up();
field_rP__User__Data.clean_up();
}

const TTCN_Typedescriptor_t* RP__ACK__SGSN__MS::get_descriptor() const { return &RP__ACK__SGSN__MS_descr_; }
RP__ACK__SGSN__MS& RP__ACK__SGSN__MS::operator=(const RP__ACK__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
  if (other_value.rP__MTI().is_bound()) field_rP__MTI = other_value.rP__MTI();
  else field_rP__MTI.clean_up();
  if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
  else field_rP__Spare.clean_up();
  if (other_value.rP__MessageReference().is_bound()) field_rP__MessageReference = other_value.rP__MessageReference();
  else field_rP__MessageReference.clean_up();
  if (other_value.rP__User__Data().is_bound()) field_rP__User__Data = other_value.rP__User__Data();
  else field_rP__User__Data.clean_up();
}
return *this;
}

boolean RP__ACK__SGSN__MS::operator==(const RP__ACK__SGSN__MS& other_value) const
{
return field_rP__MTI==other_value.field_rP__MTI
  && field_rP__Spare==other_value.field_rP__Spare
  && field_rP__MessageReference==other_value.field_rP__MessageReference
  && field_rP__User__Data==other_value.field_rP__User__Data;
}

boolean RP__ACK__SGSN__MS::is_bound() const
{
return (field_rP__MTI.is_bound())
  || (field_rP__Spare.is_bound())
  || (field_rP__MessageReference.is_bound())
  || (OPTIONAL_OMIT == field_rP__User__Data.get_selection() || field_rP__User__Data.is_bound());
}
boolean RP__ACK__SGSN__MS::is_value() const
{
return field_rP__MTI.is_value()
  && field_rP__Spare.is_value()
  && field_rP__MessageReference.is_value()
  && (OPTIONAL_OMIT == field_rP__User__Data.get_selection() || field_rP__User__Data.is_value());
}
int RP__ACK__SGSN__MS::size_of() const
{
  int ret_val = 3;
  if (field_rP__User__Data.ispresent()) ret_val++;
  return ret_val;
}

void RP__ACK__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rP_MTI := ");
field_rP__MTI.log();
TTCN_Logger::log_event_str(", rP_Spare := ");
field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_MessageReference := ");
field_rP__MessageReference.log();
TTCN_Logger::log_event_str(", rP_User_Data := ");
field_rP__User__Data.log();
TTCN_Logger::log_event_str(" }");
}

void RP__ACK__SGSN__MS::set_implicit_omit()
{
if (rP__MTI().is_bound()) rP__MTI().set_implicit_omit();
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__MessageReference().is_bound()) rP__MessageReference().set_implicit_omit();
if (!rP__User__Data().is_bound()) rP__User__Data() = OMIT_VALUE;
else rP__User__Data().set_implicit_omit();
}

void RP__ACK__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS 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) rP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__Spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__MessageReference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__User__Data().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(), "rP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_MessageReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MessageReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_User_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__User__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.RP_ACK_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_ACK_SGSN_MS");
  }
}

void RP__ACK__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_rP__MTI.encode_text(text_buf);
field_rP__Spare.encode_text(text_buf);
field_rP__MessageReference.encode_text(text_buf);
field_rP__User__Data.encode_text(text_buf);
}

void RP__ACK__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_rP__MTI.decode_text(text_buf);
field_rP__Spare.decode_text(text_buf);
field_rP__MessageReference.decode_text(text_buf);
field_rP__User__Data.decode_text(text_buf);
}

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

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

int RP__ACK__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_rP__MTI.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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_rP__Spare.RAW_decode(General__Types::BIT5_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_rP__MessageReference.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_rP__User__Data = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, RP__ACK__User__DataTLV__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_rP__User__Data().RAW_decode(RP__ACK__User__DataTLV__SGSN__MS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_rP__User__Data = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_rP__User__Data=OMIT_VALUE;
  if (field_rP__MTI !=  bs_7) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__ACK__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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::BIT5_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  if (field_rP__User__Data.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RP__ACK__User__DataTLV__SGSN__MS_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_rP__MTI.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__Spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rP__MessageReference.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  if (field_rP__User__Data.ispresent()) {
  encoded_length += field_rP__User__Data().RAW_encode(RP__ACK__User__DataTLV__SGSN__MS_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_rP__MTI !=  bs_7) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_7.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 RP__ACK__SGSN__MS_template::single_value_struct {
BITSTRING_template field_rP__MTI;
BITSTRING_template field_rP__Spare;
OCTETSTRING_template field_rP__MessageReference;
RP__ACK__User__DataTLV__SGSN__MS_template field_rP__User__Data;
};

void RP__ACK__SGSN__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_rP__MTI = ANY_VALUE;
single_value->field_rP__Spare = ANY_VALUE;
single_value->field_rP__MessageReference = ANY_VALUE;
single_value->field_rP__User__Data = ANY_OR_OMIT;
}
}
}

void RP__ACK__SGSN__MS_template::copy_value(const RP__ACK__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.rP__MTI().is_bound()) {
  single_value->field_rP__MTI = other_value.rP__MTI();
} else {
  single_value->field_rP__MTI.clean_up();
}
if (other_value.rP__Spare().is_bound()) {
  single_value->field_rP__Spare = other_value.rP__Spare();
} else {
  single_value->field_rP__Spare.clean_up();
}
if (other_value.rP__MessageReference().is_bound()) {
  single_value->field_rP__MessageReference = other_value.rP__MessageReference();
} else {
  single_value->field_rP__MessageReference.clean_up();
}
if (other_value.rP__User__Data().is_bound()) {
  if (other_value.rP__User__Data().ispresent()) single_value->field_rP__User__Data = other_value.rP__User__Data()();
  else single_value->field_rP__User__Data = OMIT_VALUE;
} else {
  single_value->field_rP__User__Data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__ACK__SGSN__MS_template::copy_template(const RP__ACK__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rP__MTI().get_selection()) {
single_value->field_rP__MTI = other_value.rP__MTI();
} else {
single_value->field_rP__MTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__Spare().get_selection()) {
single_value->field_rP__Spare = other_value.rP__Spare();
} else {
single_value->field_rP__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__MessageReference().get_selection()) {
single_value->field_rP__MessageReference = other_value.rP__MessageReference();
} else {
single_value->field_rP__MessageReference.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__User__Data().get_selection()) {
single_value->field_rP__User__Data = other_value.rP__User__Data();
} else {
single_value->field_rP__User__Data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RP__ACK__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RP__ACK__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ACK__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
break;
}
set_selection(other_value);
}

RP__ACK__SGSN__MS_template::RP__ACK__SGSN__MS_template()
{
}

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

RP__ACK__SGSN__MS_template::RP__ACK__SGSN__MS_template(const RP__ACK__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__ACK__SGSN__MS_template::match(const RP__ACK__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.rP__MTI().is_bound()) return FALSE;
if(!single_value->field_rP__MTI.match(other_value.rP__MTI(), legacy))return FALSE;
if(!other_value.rP__Spare().is_bound()) return FALSE;
if(!single_value->field_rP__Spare.match(other_value.rP__Spare(), legacy))return FALSE;
if(!other_value.rP__MessageReference().is_bound()) return FALSE;
if(!single_value->field_rP__MessageReference.match(other_value.rP__MessageReference(), legacy))return FALSE;
if(!other_value.rP__User__Data().is_bound()) return FALSE;
if((other_value.rP__User__Data().ispresent() ? !single_value->field_rP__User__Data.match((const RP__ACK__User__DataTLV__SGSN__MS&)other_value.rP__User__Data(), legacy) : !single_value->field_rP__User__Data.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
}
return FALSE;
}

boolean RP__ACK__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rP__MTI.is_bound()
 || single_value->field_rP__Spare.is_bound()
 || single_value->field_rP__MessageReference.is_bound()
 || (single_value->field_rP__User__Data.is_omit() || single_value->field_rP__User__Data.is_bound());
}

boolean RP__ACK__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rP__MTI.is_value()
 && single_value->field_rP__Spare.is_value()
 && single_value->field_rP__MessageReference.is_value()
 && (single_value->field_rP__User__Data.is_omit() || single_value->field_rP__User__Data.is_value());
}

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

RP__ACK__SGSN__MS RP__ACK__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
RP__ACK__SGSN__MS ret_val;
if (single_value->field_rP__MTI.is_bound()) {
ret_val.rP__MTI() = single_value->field_rP__MTI.valueof();
}
if (single_value->field_rP__Spare.is_bound()) {
ret_val.rP__Spare() = single_value->field_rP__Spare.valueof();
}
if (single_value->field_rP__MessageReference.is_bound()) {
ret_val.rP__MessageReference() = single_value->field_rP__MessageReference.valueof();
}
if (single_value->field_rP__User__Data.is_omit()) ret_val.rP__User__Data() = OMIT_VALUE;
else if (single_value->field_rP__User__Data.is_bound()) {
ret_val.rP__User__Data() = single_value->field_rP__User__Data.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RP__ACK__SGSN__MS_template::rP__MTI()
{
set_specific();
return single_value->field_rP__MTI;
}

const BITSTRING_template& RP__ACK__SGSN__MS_template::rP__MTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_MTI of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
return single_value->field_rP__MTI;
}

BITSTRING_template& RP__ACK__SGSN__MS_template::rP__Spare()
{
set_specific();
return single_value->field_rP__Spare;
}

const BITSTRING_template& RP__ACK__SGSN__MS_template::rP__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_Spare of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
return single_value->field_rP__Spare;
}

OCTETSTRING_template& RP__ACK__SGSN__MS_template::rP__MessageReference()
{
set_specific();
return single_value->field_rP__MessageReference;
}

const OCTETSTRING_template& RP__ACK__SGSN__MS_template::rP__MessageReference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_MessageReference of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
return single_value->field_rP__MessageReference;
}

RP__ACK__User__DataTLV__SGSN__MS_template& RP__ACK__SGSN__MS_template::rP__User__Data()
{
set_specific();
return single_value->field_rP__User__Data;
}

const RP__ACK__User__DataTLV__SGSN__MS_template& RP__ACK__SGSN__MS_template::rP__User__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_User_Data of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS.");
return single_value->field_rP__User__Data;
}

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

void RP__ACK__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rP_MTI := ");
single_value->field_rP__MTI.log();
TTCN_Logger::log_event_str(", rP_Spare := ");
single_value->field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_MessageReference := ");
single_value->field_rP__MessageReference.log();
TTCN_Logger::log_event_str(", rP_User_Data := ");
single_value->field_rP__User__Data.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RP__ACK__SGSN__MS_template::log_match(const RP__ACK__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_rP__MTI.match(match_value.rP__MTI(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_MTI");
single_value->field_rP__MTI.log_match(match_value.rP__MTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__Spare.match(match_value.rP__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_Spare");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__MessageReference.match(match_value.rP__MessageReference(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_MessageReference");
single_value->field_rP__MessageReference.log_match(match_value.rP__MessageReference(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rP__User__Data().ispresent()){
if(!single_value->field_rP__User__Data.match(match_value.rP__User__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_User_Data");
single_value->field_rP__User__Data.log_match(match_value.rP__User__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rP__User__Data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rP_User_Data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rP__User__Data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ rP_MTI := ");
single_value->field_rP__MTI.log_match(match_value.rP__MTI(), legacy);
TTCN_Logger::log_event_str(", rP_Spare := ");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::log_event_str(", rP_MessageReference := ");
single_value->field_rP__MessageReference.log_match(match_value.rP__MessageReference(), legacy);
TTCN_Logger::log_event_str(", rP_User_Data := ");
if (match_value.rP__User__Data().ispresent()) {
single_value->field_rP__User__Data.log_match(match_value.rP__User__Data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rP__User__Data.log();
if (single_value->field_rP__User__Data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RP__ACK__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__MTI().is_bound()) rP__MTI().set_implicit_omit();
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__MessageReference().is_bound()) rP__MessageReference().set_implicit_omit();
if (!rP__User__Data().is_bound()) rP__User__Data() = OMIT_VALUE;
else rP__User__Data().set_implicit_omit();
}

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

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

void RP__ACK__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RP__ACK__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_ACK_SGSN_MS 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) rP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__Spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__MessageReference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__User__Data().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(), "rP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_MessageReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MessageReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_User_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__User__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.RP_ACK_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__ACK__SGSN__MS_template* precondition = new RP__ACK__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    RP__ACK__SGSN__MS_template* implied_template = new RP__ACK__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__ACK__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_ACK_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

void TPDU__RP__ACK__SGSN__MS::copy_value(const TPDU__RP__ACK__SGSN__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_sMS__SUBMIT__REPORT:
field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ACK(*other_value.field_sMS__SUBMIT__REPORT);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TPDU__RP__ACK__SGSN__MS::operator==(const TPDU__RP__ACK__SGSN__MS& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
return *field_sMS__SUBMIT__REPORT == *other_value.field_sMS__SUBMIT__REPORT;
default:
return FALSE;
}
}

SMS__SUBMIT__REPORT__in__RP__ACK& TPDU__RP__ACK__SGSN__MS::sMS__SUBMIT__REPORT()
{
if (union_selection != ALT_sMS__SUBMIT__REPORT) {
clean_up();
field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ACK;
union_selection = ALT_sMS__SUBMIT__REPORT;
}
return *field_sMS__SUBMIT__REPORT;
}

const SMS__SUBMIT__REPORT__in__RP__ACK& TPDU__RP__ACK__SGSN__MS::sMS__SUBMIT__REPORT() const
{
if (union_selection != ALT_sMS__SUBMIT__REPORT) TTCN_error("Using non-selected field sMS_SUBMIT_REPORT in a value of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
return *field_sMS__SUBMIT__REPORT;
}

boolean TPDU__RP__ACK__SGSN__MS::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_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
return union_selection == checked_selection;
}

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

boolean TPDU__RP__ACK__SGSN__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_sMS__SUBMIT__REPORT: return field_sMS__SUBMIT__REPORT->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TPDU__RP__ACK__SGSN__MS::clean_up()
{
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
  delete field_sMS__SUBMIT__REPORT;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TPDU__RP__ACK__SGSN__MS::log() const
{
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
TTCN_Logger::log_event_str("{ sMS_SUBMIT_REPORT := ");
field_sMS__SUBMIT__REPORT->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TPDU__RP__ACK__SGSN__MS::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, "sMS_SUBMIT_REPORT")) {
    sMS__SUBMIT__REPORT().set_param(*mp_last);
    if (!sMS__SUBMIT__REPORT().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.", last_name);
}

void TPDU__RP__ACK__SGSN__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
field_sMS__SUBMIT__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__ACK__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
field_sMS__SUBMIT__REPORT->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
}

void TPDU__RP__ACK__SGSN__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_sMS__SUBMIT__REPORT:
sMS__SUBMIT__REPORT().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
}

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

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

int TPDU__RP__ACK__SGSN__MS::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int 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, SMS__SUBMIT__REPORT__in__RP__ACK_descr_.raw->forceomit);
      decoded_length = sMS__SUBMIT__REPORT().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ACK_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 {
    boolean already_failed = FALSE;
    already_failed = FALSE;
    if (!already_failed) {
      BITSTRING temporal_0;
      int decoded_0_length;
      p_buf.set_pos_bit(starting_pos + 0);
      decoded_0_length = temporal_0.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_0) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, SMS__SUBMIT__REPORT__in__RP__ACK_descr_.raw->forceomit);
          decoded_length = sMS__SUBMIT__REPORT().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ACK_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__SUBMIT__REPORT).tP__MTI() ==  bs_0) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int TPDU__RP__ACK__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 1;  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  memset(myleaf.body.node.nodes, 0, 1 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_sMS__SUBMIT__REPORT:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SMS__SUBMIT__REPORT__in__RP__ACK_descr_.raw);
    encoded_length = field_sMS__SUBMIT__REPORT->RAW_encode(SMS__SUBMIT__REPORT__in__RP__ACK_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SMS__SUBMIT__REPORT__in__RP__ACK_descr_;
    if ((*field_sMS__SUBMIT__REPORT).tP__MTI() !=  bs_0) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT2_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);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TPDU__RP__ACK__SGSN__MS_template::copy_value(const TPDU__RP__ACK__SGSN__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ACK_template(other_value.sMS__SUBMIT__REPORT());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void TPDU__RP__ACK__SGSN__MS_template::copy_template(const TPDU__RP__ACK__SGSN__MS_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 TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ACK_template(*other_value.single_value.field_sMS__SUBMIT__REPORT);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
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 TPDU__RP__ACK__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TPDU__RP__ACK__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new TPDU__RP__ACK__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
set_selection(other_value);
}

TPDU__RP__ACK__SGSN__MS_template::TPDU__RP__ACK__SGSN__MS_template()
{
}

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

TPDU__RP__ACK__SGSN__MS_template::TPDU__RP__ACK__SGSN__MS_template(const TPDU__RP__ACK__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void TPDU__RP__ACK__SGSN__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
delete single_value.field_sMS__SUBMIT__REPORT;
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;
}

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

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

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

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

boolean TPDU__RP__ACK__SGSN__MS_template::match(const TPDU__RP__ACK__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
TPDU__RP__ACK__SGSN__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TPDU__RP__ACK__SGSN__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
return single_value.field_sMS__SUBMIT__REPORT->match(other_value.sMS__SUBMIT__REPORT(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
}
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_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
return FALSE;
}

boolean TPDU__RP__ACK__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
return single_value.field_sMS__SUBMIT__REPORT->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_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
}

TPDU__RP__ACK__SGSN__MS TPDU__RP__ACK__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
TPDU__RP__ACK__SGSN__MS ret_val;
switch (single_value.union_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
ret_val.sMS__SUBMIT__REPORT() = single_value.field_sMS__SUBMIT__REPORT->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
return ret_val;
}

TPDU__RP__ACK__SGSN__MS_template& TPDU__RP__ACK__SGSN__MS_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_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
return value_list.list_value[list_index];
}
void TPDU__RP__ACK__SGSN__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TPDU__RP__ACK__SGSN__MS_template[list_length];
}

SMS__SUBMIT__REPORT__in__RP__ACK_template& TPDU__RP__ACK__SGSN__MS_template::sMS__SUBMIT__REPORT()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ACK_template(ANY_VALUE);
else single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ACK_template;
single_value.union_selection = TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__SUBMIT__REPORT;
}

const SMS__SUBMIT__REPORT__in__RP__ACK_template& TPDU__RP__ACK__SGSN__MS_template::sMS__SUBMIT__REPORT() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_SUBMIT_REPORT in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
if (single_value.union_selection != TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT) TTCN_error("Accessing non-selected field sMS_SUBMIT_REPORT in a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
return *single_value.field_sMS__SUBMIT__REPORT;
}

boolean TPDU__RP__ACK__SGSN__MS_template::ischosen(TPDU__RP__ACK__SGSN__MS::union_selection_type checked_selection) const
{
if (checked_selection == TPDU__RP__ACK__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TPDU__RP__ACK__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
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_SMS_Types.TPDU_RP_ACK_SGSN_MS 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 TPDU__RP__ACK__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
TTCN_Logger::log_event_str("{ sMS_SUBMIT_REPORT := ");
single_value.field_sMS__SUBMIT__REPORT->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 TPDU__RP__ACK__SGSN__MS_template::log_match(const TPDU__RP__ACK__SGSN__MS& 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 TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_SUBMIT_REPORT");
single_value.field_sMS__SUBMIT__REPORT->log_match(match_value.sMS__SUBMIT__REPORT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_SUBMIT_REPORT := ");
single_value.field_sMS__SUBMIT__REPORT->log_match(match_value.sMS__SUBMIT__REPORT(), 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 TPDU__RP__ACK__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__ACK__SGSN__MS_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 TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
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_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
}

void TPDU__RP__ACK__SGSN__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TPDU__RP__ACK__SGSN__MS::UNBOUND_VALUE;
TPDU__RP__ACK__SGSN__MS::union_selection_type new_selection = (TPDU__RP__ACK__SGSN__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ACK_template;
single_value.field_sMS__SUBMIT__REPORT->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
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 TPDU__RP__ACK__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
}

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

boolean TPDU__RP__ACK__SGSN__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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 TPDU__RP__ACK__SGSN__MS_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_SMS_Types.TPDU_RP_ACK_SGSN_MS'");
    }
    if (strcmp("sMS_SUBMIT_REPORT", param_field) == 0) {
      sMS__SUBMIT__REPORT().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS'", 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: {
    TPDU__RP__ACK__SGSN__MS_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_SMS_Types.TPDU_RP_ACK_SGSN_MS");
    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, "sMS_SUBMIT_REPORT")) {
      sMS__SUBMIT__REPORT().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TPDU__RP__ACK__SGSN__MS_template* precondition = new TPDU__RP__ACK__SGSN__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    TPDU__RP__ACK__SGSN__MS_template* implied_template = new TPDU__RP__ACK__SGSN__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TPDU__RP__ACK__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void TPDU__RP__ACK__SGSN__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case TPDU__RP__ACK__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS.");
}
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_SMS_Types.TPDU_RP_ACK_SGSN_MS");
}

SMS__SUBMIT__REPORT__in__RP__ACK::SMS__SUBMIT__REPORT__in__RP__ACK()
{
}

SMS__SUBMIT__REPORT__in__RP__ACK::SMS__SUBMIT__REPORT__in__RP__ACK(const BITSTRING& par_tP__MTI,
    const BITSTRING& par_tP__Spare1,
    const BITSTRING& par_tP__UDHI,
    const BITSTRING& par_tP__Spare2,
    const BITSTRING& par_tP__PresenceBitTP__PID,
    const BITSTRING& par_tP__PresenceBitTP__DCS,
    const BITSTRING& par_tP__PresenceBitTP__UDL,
    const BITSTRING& par_tP__Reserved,
    const BITSTRING& par_tP__ExtensionBit,
    const OCTETSTRING& par_tP__SCTS,
    const OPTIONAL< OCTETSTRING >& par_tP__PID,
    const OPTIONAL< OCTETSTRING >& par_tP__DCS,
    const OPTIONAL< TP__UDL__UD >& par_tP__UDL__UD)
  :   field_tP__MTI(par_tP__MTI),
  field_tP__Spare1(par_tP__Spare1),
  field_tP__UDHI(par_tP__UDHI),
  field_tP__Spare2(par_tP__Spare2),
  field_tP__PresenceBitTP__PID(par_tP__PresenceBitTP__PID),
  field_tP__PresenceBitTP__DCS(par_tP__PresenceBitTP__DCS),
  field_tP__PresenceBitTP__UDL(par_tP__PresenceBitTP__UDL),
  field_tP__Reserved(par_tP__Reserved),
  field_tP__ExtensionBit(par_tP__ExtensionBit),
  field_tP__SCTS(par_tP__SCTS),
  field_tP__PID(par_tP__PID),
  field_tP__DCS(par_tP__DCS),
  field_tP__UDL__UD(par_tP__UDL__UD)
{
}

SMS__SUBMIT__REPORT__in__RP__ACK::SMS__SUBMIT__REPORT__in__RP__ACK(const SMS__SUBMIT__REPORT__in__RP__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
else field_tP__MTI.clean_up();
if (other_value.tP__Spare1().is_bound()) field_tP__Spare1 = other_value.tP__Spare1();
else field_tP__Spare1.clean_up();
if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
else field_tP__UDHI.clean_up();
if (other_value.tP__Spare2().is_bound()) field_tP__Spare2 = other_value.tP__Spare2();
else field_tP__Spare2.clean_up();
if (other_value.tP__PresenceBitTP__PID().is_bound()) field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
else field_tP__PresenceBitTP__PID.clean_up();
if (other_value.tP__PresenceBitTP__DCS().is_bound()) field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
else field_tP__PresenceBitTP__DCS.clean_up();
if (other_value.tP__PresenceBitTP__UDL().is_bound()) field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
else field_tP__PresenceBitTP__UDL.clean_up();
if (other_value.tP__Reserved().is_bound()) field_tP__Reserved = other_value.tP__Reserved();
else field_tP__Reserved.clean_up();
if (other_value.tP__ExtensionBit().is_bound()) field_tP__ExtensionBit = other_value.tP__ExtensionBit();
else field_tP__ExtensionBit.clean_up();
if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
else field_tP__SCTS.clean_up();
if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
else field_tP__PID.clean_up();
if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
else field_tP__DCS.clean_up();
if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
else field_tP__UDL__UD.clean_up();
}

void SMS__SUBMIT__REPORT__in__RP__ACK::clean_up()
{
field_tP__MTI.clean_up();
field_tP__Spare1.clean_up();
field_tP__UDHI.clean_up();
field_tP__Spare2.clean_up();
field_tP__PresenceBitTP__PID.clean_up();
field_tP__PresenceBitTP__DCS.clean_up();
field_tP__PresenceBitTP__UDL.clean_up();
field_tP__Reserved.clean_up();
field_tP__ExtensionBit.clean_up();
field_tP__SCTS.clean_up();
field_tP__PID.clean_up();
field_tP__DCS.clean_up();
field_tP__UDL__UD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__SUBMIT__REPORT__in__RP__ACK::get_descriptor() const { return &SMS__SUBMIT__REPORT__in__RP__ACK_descr_; }
SMS__SUBMIT__REPORT__in__RP__ACK& SMS__SUBMIT__REPORT__in__RP__ACK::operator=(const SMS__SUBMIT__REPORT__in__RP__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
  if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
  else field_tP__MTI.clean_up();
  if (other_value.tP__Spare1().is_bound()) field_tP__Spare1 = other_value.tP__Spare1();
  else field_tP__Spare1.clean_up();
  if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
  else field_tP__UDHI.clean_up();
  if (other_value.tP__Spare2().is_bound()) field_tP__Spare2 = other_value.tP__Spare2();
  else field_tP__Spare2.clean_up();
  if (other_value.tP__PresenceBitTP__PID().is_bound()) field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
  else field_tP__PresenceBitTP__PID.clean_up();
  if (other_value.tP__PresenceBitTP__DCS().is_bound()) field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
  else field_tP__PresenceBitTP__DCS.clean_up();
  if (other_value.tP__PresenceBitTP__UDL().is_bound()) field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
  else field_tP__PresenceBitTP__UDL.clean_up();
  if (other_value.tP__Reserved().is_bound()) field_tP__Reserved = other_value.tP__Reserved();
  else field_tP__Reserved.clean_up();
  if (other_value.tP__ExtensionBit().is_bound()) field_tP__ExtensionBit = other_value.tP__ExtensionBit();
  else field_tP__ExtensionBit.clean_up();
  if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
  else field_tP__SCTS.clean_up();
  if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
  else field_tP__PID.clean_up();
  if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
  else field_tP__DCS.clean_up();
  if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
  else field_tP__UDL__UD.clean_up();
}
return *this;
}

boolean SMS__SUBMIT__REPORT__in__RP__ACK::operator==(const SMS__SUBMIT__REPORT__in__RP__ACK& other_value) const
{
return field_tP__MTI==other_value.field_tP__MTI
  && field_tP__Spare1==other_value.field_tP__Spare1
  && field_tP__UDHI==other_value.field_tP__UDHI
  && field_tP__Spare2==other_value.field_tP__Spare2
  && field_tP__PresenceBitTP__PID==other_value.field_tP__PresenceBitTP__PID
  && field_tP__PresenceBitTP__DCS==other_value.field_tP__PresenceBitTP__DCS
  && field_tP__PresenceBitTP__UDL==other_value.field_tP__PresenceBitTP__UDL
  && field_tP__Reserved==other_value.field_tP__Reserved
  && field_tP__ExtensionBit==other_value.field_tP__ExtensionBit
  && field_tP__SCTS==other_value.field_tP__SCTS
  && field_tP__PID==other_value.field_tP__PID
  && field_tP__DCS==other_value.field_tP__DCS
  && field_tP__UDL__UD==other_value.field_tP__UDL__UD;
}

boolean SMS__SUBMIT__REPORT__in__RP__ACK::is_bound() const
{
return (field_tP__MTI.is_bound())
  || (field_tP__Spare1.is_bound())
  || (field_tP__UDHI.is_bound())
  || (field_tP__Spare2.is_bound())
  || (field_tP__PresenceBitTP__PID.is_bound())
  || (field_tP__PresenceBitTP__DCS.is_bound())
  || (field_tP__PresenceBitTP__UDL.is_bound())
  || (field_tP__Reserved.is_bound())
  || (field_tP__ExtensionBit.is_bound())
  || (field_tP__SCTS.is_bound())
  || (OPTIONAL_OMIT == field_tP__PID.get_selection() || field_tP__PID.is_bound())
  || (OPTIONAL_OMIT == field_tP__DCS.get_selection() || field_tP__DCS.is_bound())
  || (OPTIONAL_OMIT == field_tP__UDL__UD.get_selection() || field_tP__UDL__UD.is_bound());
}
boolean SMS__SUBMIT__REPORT__in__RP__ACK::is_value() const
{
return field_tP__MTI.is_value()
  && field_tP__Spare1.is_value()
  && field_tP__UDHI.is_value()
  && field_tP__Spare2.is_value()
  && field_tP__PresenceBitTP__PID.is_value()
  && field_tP__PresenceBitTP__DCS.is_value()
  && field_tP__PresenceBitTP__UDL.is_value()
  && field_tP__Reserved.is_value()
  && field_tP__ExtensionBit.is_value()
  && field_tP__SCTS.is_value()
  && (OPTIONAL_OMIT == field_tP__PID.get_selection() || field_tP__PID.is_value())
  && (OPTIONAL_OMIT == field_tP__DCS.get_selection() || field_tP__DCS.is_value())
  && (OPTIONAL_OMIT == field_tP__UDL__UD.get_selection() || field_tP__UDL__UD.is_value());
}
int SMS__SUBMIT__REPORT__in__RP__ACK::size_of() const
{
  int ret_val = 10;
  if (field_tP__PID.ispresent()) ret_val++;
  if (field_tP__DCS.ispresent()) ret_val++;
  if (field_tP__UDL__UD.ispresent()) ret_val++;
  return ret_val;
}

void SMS__SUBMIT__REPORT__in__RP__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_MTI := ");
field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_Spare1 := ");
field_tP__Spare1.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_Spare2 := ");
field_tP__Spare2.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
field_tP__PresenceBitTP__PID.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
field_tP__PresenceBitTP__DCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
field_tP__PresenceBitTP__UDL.log();
TTCN_Logger::log_event_str(", tP_Reserved := ");
field_tP__Reserved.log();
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
field_tP__ExtensionBit.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_PID := ");
field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
field_tP__UDL__UD.log();
TTCN_Logger::log_event_str(" }");
}

void SMS__SUBMIT__REPORT__in__RP__ACK::set_implicit_omit()
{
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__Spare1().is_bound()) tP__Spare1().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__Spare2().is_bound()) tP__Spare2().set_implicit_omit();
if (tP__PresenceBitTP__PID().is_bound()) tP__PresenceBitTP__PID().set_implicit_omit();
if (tP__PresenceBitTP__DCS().is_bound()) tP__PresenceBitTP__DCS().set_implicit_omit();
if (tP__PresenceBitTP__UDL().is_bound()) tP__PresenceBitTP__UDL().set_implicit_omit();
if (tP__Reserved().is_bound()) tP__Reserved().set_implicit_omit();
if (tP__ExtensionBit().is_bound()) tP__ExtensionBit().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (!tP__PID().is_bound()) tP__PID() = OMIT_VALUE;
else tP__PID().set_implicit_omit();
if (!tP__DCS().is_bound()) tP__DCS() = OMIT_VALUE;
else tP__DCS().set_implicit_omit();
if (!tP__UDL__UD().is_bound()) tP__UDL__UD() = OMIT_VALUE;
else tP__UDL__UD().set_implicit_omit();
}

void SMS__SUBMIT__REPORT__in__RP__ACK::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (13<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__Spare1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__PID().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__DCS().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__UDL().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__Reserved().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__ExtensionBit().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_PresenceBitTP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_UDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__UDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__Reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ExtensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ExtensionBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
  }
}

void SMS__SUBMIT__REPORT__in__RP__ACK::encode_text(Text_Buf& text_buf) const
{
field_tP__MTI.encode_text(text_buf);
field_tP__Spare1.encode_text(text_buf);
field_tP__UDHI.encode_text(text_buf);
field_tP__Spare2.encode_text(text_buf);
field_tP__PresenceBitTP__PID.encode_text(text_buf);
field_tP__PresenceBitTP__DCS.encode_text(text_buf);
field_tP__PresenceBitTP__UDL.encode_text(text_buf);
field_tP__Reserved.encode_text(text_buf);
field_tP__ExtensionBit.encode_text(text_buf);
field_tP__SCTS.encode_text(text_buf);
field_tP__PID.encode_text(text_buf);
field_tP__DCS.encode_text(text_buf);
field_tP__UDL__UD.encode_text(text_buf);
}

void SMS__SUBMIT__REPORT__in__RP__ACK::decode_text(Text_Buf& text_buf)
{
field_tP__MTI.decode_text(text_buf);
field_tP__Spare1.decode_text(text_buf);
field_tP__UDHI.decode_text(text_buf);
field_tP__Spare2.decode_text(text_buf);
field_tP__PresenceBitTP__PID.decode_text(text_buf);
field_tP__PresenceBitTP__DCS.decode_text(text_buf);
field_tP__PresenceBitTP__UDL.decode_text(text_buf);
field_tP__Reserved.decode_text(text_buf);
field_tP__ExtensionBit.decode_text(text_buf);
field_tP__SCTS.decode_text(text_buf);
field_tP__PID.decode_text(text_buf);
field_tP__DCS.decode_text(text_buf);
field_tP__UDL__UD.decode_text(text_buf);
}

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

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

int SMS__SUBMIT__REPORT__in__RP__ACK::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_tP__MTI.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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_tP__Spare1.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_tP__UDHI.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_tP__Spare2.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_tP__PresenceBitTP__PID.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_tP__PresenceBitTP__DCS.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_tP__PresenceBitTP__UDL.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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_tP__Reserved.RAW_decode(General__Types::BIT4_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_tP__ExtensionBit.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::OCT7_descr_.raw->forceomit);
  decoded_field_length = field_tP__SCTS.RAW_decode(General__Types::OCT7_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());
  if (limit > 0 && field_tP__PresenceBitTP__PID ==  bs_4){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_tP__PID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_descr_.raw->forceomit);
  decoded_field_length = field_tP__PID().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_tP__PID = 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_tP__PID=OMIT_VALUE;
  if (limit > 0 && field_tP__PresenceBitTP__DCS ==  bs_4){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_tP__DCS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_descr_.raw->forceomit);
  decoded_field_length = field_tP__DCS().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_tP__DCS = 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_tP__DCS=OMIT_VALUE;
  if (limit > 0 && field_tP__PresenceBitTP__UDL ==  bs_4){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_tP__UDL__UD = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_descr_.raw->forceomit);
  decoded_field_length = field_tP__UDL__UD().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_tP__UDL__UD = 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_tP__UDL__UD=OMIT_VALUE;
  if (field_tP__MTI !=  bs_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 SMS__SUBMIT__REPORT__in__RP__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 13;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(13);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT2_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);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT4_descr_.raw);
  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::OCT7_descr_.raw);
  if (field_tP__PID.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_tP__DCS.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_tP__UDL__UD.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  encoded_length += field_tP__MTI.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tP__Spare1.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__UDHI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tP__Spare2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__PresenceBitTP__PID.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_tP__PresenceBitTP__DCS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tP__PresenceBitTP__UDL.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_tP__Reserved.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_tP__ExtensionBit.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_tP__SCTS.RAW_encode(General__Types::OCT7_descr_, *myleaf.body.node.nodes[9]);
  if (field_tP__PID.ispresent()) {
  encoded_length += field_tP__PID().RAW_encode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_tP__DCS.ispresent()) {
  encoded_length += field_tP__DCS().RAW_encode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_tP__UDL__UD.ispresent()) {
  encoded_length += field_tP__UDL__UD().RAW_encode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_tP__PID.ispresent() && (field_tP__PresenceBitTP__PID !=  bs_4)) {
  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_4.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_tP__DCS.ispresent() && (field_tP__PresenceBitTP__DCS !=  bs_4)) {
  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_4.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_tP__UDL__UD.ispresent() && (field_tP__PresenceBitTP__UDL !=  bs_4)) {
  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_4.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_tP__MTI !=  bs_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){
   bs_0.RAW_encode(General__Types::BIT2_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 SMS__SUBMIT__REPORT__in__RP__ACK_template::single_value_struct {
BITSTRING_template field_tP__MTI;
BITSTRING_template field_tP__Spare1;
BITSTRING_template field_tP__UDHI;
BITSTRING_template field_tP__Spare2;
BITSTRING_template field_tP__PresenceBitTP__PID;
BITSTRING_template field_tP__PresenceBitTP__DCS;
BITSTRING_template field_tP__PresenceBitTP__UDL;
BITSTRING_template field_tP__Reserved;
BITSTRING_template field_tP__ExtensionBit;
OCTETSTRING_template field_tP__SCTS;
OCTETSTRING_template field_tP__PID;
OCTETSTRING_template field_tP__DCS;
TP__UDL__UD_template field_tP__UDL__UD;
};

void SMS__SUBMIT__REPORT__in__RP__ACK_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_tP__MTI = ANY_VALUE;
single_value->field_tP__Spare1 = ANY_VALUE;
single_value->field_tP__UDHI = ANY_VALUE;
single_value->field_tP__Spare2 = ANY_VALUE;
single_value->field_tP__PresenceBitTP__PID = ANY_VALUE;
single_value->field_tP__PresenceBitTP__DCS = ANY_VALUE;
single_value->field_tP__PresenceBitTP__UDL = ANY_VALUE;
single_value->field_tP__Reserved = ANY_VALUE;
single_value->field_tP__ExtensionBit = ANY_VALUE;
single_value->field_tP__SCTS = ANY_VALUE;
single_value->field_tP__PID = ANY_OR_OMIT;
single_value->field_tP__DCS = ANY_OR_OMIT;
single_value->field_tP__UDL__UD = ANY_OR_OMIT;
}
}
}

void SMS__SUBMIT__REPORT__in__RP__ACK_template::copy_value(const SMS__SUBMIT__REPORT__in__RP__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__MTI().is_bound()) {
  single_value->field_tP__MTI = other_value.tP__MTI();
} else {
  single_value->field_tP__MTI.clean_up();
}
if (other_value.tP__Spare1().is_bound()) {
  single_value->field_tP__Spare1 = other_value.tP__Spare1();
} else {
  single_value->field_tP__Spare1.clean_up();
}
if (other_value.tP__UDHI().is_bound()) {
  single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
  single_value->field_tP__UDHI.clean_up();
}
if (other_value.tP__Spare2().is_bound()) {
  single_value->field_tP__Spare2 = other_value.tP__Spare2();
} else {
  single_value->field_tP__Spare2.clean_up();
}
if (other_value.tP__PresenceBitTP__PID().is_bound()) {
  single_value->field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
} else {
  single_value->field_tP__PresenceBitTP__PID.clean_up();
}
if (other_value.tP__PresenceBitTP__DCS().is_bound()) {
  single_value->field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
} else {
  single_value->field_tP__PresenceBitTP__DCS.clean_up();
}
if (other_value.tP__PresenceBitTP__UDL().is_bound()) {
  single_value->field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
} else {
  single_value->field_tP__PresenceBitTP__UDL.clean_up();
}
if (other_value.tP__Reserved().is_bound()) {
  single_value->field_tP__Reserved = other_value.tP__Reserved();
} else {
  single_value->field_tP__Reserved.clean_up();
}
if (other_value.tP__ExtensionBit().is_bound()) {
  single_value->field_tP__ExtensionBit = other_value.tP__ExtensionBit();
} else {
  single_value->field_tP__ExtensionBit.clean_up();
}
if (other_value.tP__SCTS().is_bound()) {
  single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
  single_value->field_tP__SCTS.clean_up();
}
if (other_value.tP__PID().is_bound()) {
  if (other_value.tP__PID().ispresent()) single_value->field_tP__PID = other_value.tP__PID()();
  else single_value->field_tP__PID = OMIT_VALUE;
} else {
  single_value->field_tP__PID.clean_up();
}
if (other_value.tP__DCS().is_bound()) {
  if (other_value.tP__DCS().ispresent()) single_value->field_tP__DCS = other_value.tP__DCS()();
  else single_value->field_tP__DCS = OMIT_VALUE;
} else {
  single_value->field_tP__DCS.clean_up();
}
if (other_value.tP__UDL__UD().is_bound()) {
  if (other_value.tP__UDL__UD().ispresent()) single_value->field_tP__UDL__UD = other_value.tP__UDL__UD()();
  else single_value->field_tP__UDL__UD = OMIT_VALUE;
} else {
  single_value->field_tP__UDL__UD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SMS__SUBMIT__REPORT__in__RP__ACK_template::copy_template(const SMS__SUBMIT__REPORT__in__RP__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__MTI().get_selection()) {
single_value->field_tP__MTI = other_value.tP__MTI();
} else {
single_value->field_tP__MTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Spare1().get_selection()) {
single_value->field_tP__Spare1 = other_value.tP__Spare1();
} else {
single_value->field_tP__Spare1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDHI().get_selection()) {
single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
single_value->field_tP__UDHI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Spare2().get_selection()) {
single_value->field_tP__Spare2 = other_value.tP__Spare2();
} else {
single_value->field_tP__Spare2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__PID().get_selection()) {
single_value->field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
} else {
single_value->field_tP__PresenceBitTP__PID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__DCS().get_selection()) {
single_value->field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
} else {
single_value->field_tP__PresenceBitTP__DCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__UDL().get_selection()) {
single_value->field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
} else {
single_value->field_tP__PresenceBitTP__UDL.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Reserved().get_selection()) {
single_value->field_tP__Reserved = other_value.tP__Reserved();
} else {
single_value->field_tP__Reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__ExtensionBit().get_selection()) {
single_value->field_tP__ExtensionBit = other_value.tP__ExtensionBit();
} else {
single_value->field_tP__ExtensionBit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__SCTS().get_selection()) {
single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
single_value->field_tP__SCTS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PID().get_selection()) {
single_value->field_tP__PID = other_value.tP__PID();
} else {
single_value->field_tP__PID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__DCS().get_selection()) {
single_value->field_tP__DCS = other_value.tP__DCS();
} else {
single_value->field_tP__DCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDL__UD().get_selection()) {
single_value->field_tP__UDL__UD = other_value.tP__UDL__UD();
} else {
single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new SMS__SUBMIT__REPORT__in__RP__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__SUBMIT__REPORT__in__RP__ACK_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
break;
}
set_selection(other_value);
}

SMS__SUBMIT__REPORT__in__RP__ACK_template::SMS__SUBMIT__REPORT__in__RP__ACK_template()
{
}

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

SMS__SUBMIT__REPORT__in__RP__ACK_template::SMS__SUBMIT__REPORT__in__RP__ACK_template(const SMS__SUBMIT__REPORT__in__RP__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMS__SUBMIT__REPORT__in__RP__ACK_template::match(const SMS__SUBMIT__REPORT__in__RP__ACK& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.tP__MTI().is_bound()) return FALSE;
if(!single_value->field_tP__MTI.match(other_value.tP__MTI(), legacy))return FALSE;
if(!other_value.tP__Spare1().is_bound()) return FALSE;
if(!single_value->field_tP__Spare1.match(other_value.tP__Spare1(), legacy))return FALSE;
if(!other_value.tP__UDHI().is_bound()) return FALSE;
if(!single_value->field_tP__UDHI.match(other_value.tP__UDHI(), legacy))return FALSE;
if(!other_value.tP__Spare2().is_bound()) return FALSE;
if(!single_value->field_tP__Spare2.match(other_value.tP__Spare2(), legacy))return FALSE;
if(!other_value.tP__PresenceBitTP__PID().is_bound()) return FALSE;
if(!single_value->field_tP__PresenceBitTP__PID.match(other_value.tP__PresenceBitTP__PID(), legacy))return FALSE;
if(!other_value.tP__PresenceBitTP__DCS().is_bound()) return FALSE;
if(!single_value->field_tP__PresenceBitTP__DCS.match(other_value.tP__PresenceBitTP__DCS(), legacy))return FALSE;
if(!other_value.tP__PresenceBitTP__UDL().is_bound()) return FALSE;
if(!single_value->field_tP__PresenceBitTP__UDL.match(other_value.tP__PresenceBitTP__UDL(), legacy))return FALSE;
if(!other_value.tP__Reserved().is_bound()) return FALSE;
if(!single_value->field_tP__Reserved.match(other_value.tP__Reserved(), legacy))return FALSE;
if(!other_value.tP__ExtensionBit().is_bound()) return FALSE;
if(!single_value->field_tP__ExtensionBit.match(other_value.tP__ExtensionBit(), legacy))return FALSE;
if(!other_value.tP__SCTS().is_bound()) return FALSE;
if(!single_value->field_tP__SCTS.match(other_value.tP__SCTS(), legacy))return FALSE;
if(!other_value.tP__PID().is_bound()) return FALSE;
if((other_value.tP__PID().ispresent() ? !single_value->field_tP__PID.match((const OCTETSTRING&)other_value.tP__PID(), legacy) : !single_value->field_tP__PID.match_omit(legacy)))return FALSE;
if(!other_value.tP__DCS().is_bound()) return FALSE;
if((other_value.tP__DCS().ispresent() ? !single_value->field_tP__DCS.match((const OCTETSTRING&)other_value.tP__DCS(), legacy) : !single_value->field_tP__DCS.match_omit(legacy)))return FALSE;
if(!other_value.tP__UDL__UD().is_bound()) return FALSE;
if((other_value.tP__UDL__UD().ispresent() ? !single_value->field_tP__UDL__UD.match((const TP__UDL__UD&)other_value.tP__UDL__UD(), legacy) : !single_value->field_tP__UDL__UD.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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
}
return FALSE;
}

boolean SMS__SUBMIT__REPORT__in__RP__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tP__MTI.is_bound()
 || single_value->field_tP__Spare1.is_bound()
 || single_value->field_tP__UDHI.is_bound()
 || single_value->field_tP__Spare2.is_bound()
 || single_value->field_tP__PresenceBitTP__PID.is_bound()
 || single_value->field_tP__PresenceBitTP__DCS.is_bound()
 || single_value->field_tP__PresenceBitTP__UDL.is_bound()
 || single_value->field_tP__Reserved.is_bound()
 || single_value->field_tP__ExtensionBit.is_bound()
 || single_value->field_tP__SCTS.is_bound()
 || (single_value->field_tP__PID.is_omit() || single_value->field_tP__PID.is_bound())
 || (single_value->field_tP__DCS.is_omit() || single_value->field_tP__DCS.is_bound())
 || (single_value->field_tP__UDL__UD.is_omit() || single_value->field_tP__UDL__UD.is_bound());
}

boolean SMS__SUBMIT__REPORT__in__RP__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__MTI.is_value()
 && single_value->field_tP__Spare1.is_value()
 && single_value->field_tP__UDHI.is_value()
 && single_value->field_tP__Spare2.is_value()
 && single_value->field_tP__PresenceBitTP__PID.is_value()
 && single_value->field_tP__PresenceBitTP__DCS.is_value()
 && single_value->field_tP__PresenceBitTP__UDL.is_value()
 && single_value->field_tP__Reserved.is_value()
 && single_value->field_tP__ExtensionBit.is_value()
 && single_value->field_tP__SCTS.is_value()
 && (single_value->field_tP__PID.is_omit() || single_value->field_tP__PID.is_value())
 && (single_value->field_tP__DCS.is_omit() || single_value->field_tP__DCS.is_value())
 && (single_value->field_tP__UDL__UD.is_omit() || single_value->field_tP__UDL__UD.is_value());
}

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

SMS__SUBMIT__REPORT__in__RP__ACK SMS__SUBMIT__REPORT__in__RP__ACK_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
SMS__SUBMIT__REPORT__in__RP__ACK ret_val;
if (single_value->field_tP__MTI.is_bound()) {
ret_val.tP__MTI() = single_value->field_tP__MTI.valueof();
}
if (single_value->field_tP__Spare1.is_bound()) {
ret_val.tP__Spare1() = single_value->field_tP__Spare1.valueof();
}
if (single_value->field_tP__UDHI.is_bound()) {
ret_val.tP__UDHI() = single_value->field_tP__UDHI.valueof();
}
if (single_value->field_tP__Spare2.is_bound()) {
ret_val.tP__Spare2() = single_value->field_tP__Spare2.valueof();
}
if (single_value->field_tP__PresenceBitTP__PID.is_bound()) {
ret_val.tP__PresenceBitTP__PID() = single_value->field_tP__PresenceBitTP__PID.valueof();
}
if (single_value->field_tP__PresenceBitTP__DCS.is_bound()) {
ret_val.tP__PresenceBitTP__DCS() = single_value->field_tP__PresenceBitTP__DCS.valueof();
}
if (single_value->field_tP__PresenceBitTP__UDL.is_bound()) {
ret_val.tP__PresenceBitTP__UDL() = single_value->field_tP__PresenceBitTP__UDL.valueof();
}
if (single_value->field_tP__Reserved.is_bound()) {
ret_val.tP__Reserved() = single_value->field_tP__Reserved.valueof();
}
if (single_value->field_tP__ExtensionBit.is_bound()) {
ret_val.tP__ExtensionBit() = single_value->field_tP__ExtensionBit.valueof();
}
if (single_value->field_tP__SCTS.is_bound()) {
ret_val.tP__SCTS() = single_value->field_tP__SCTS.valueof();
}
if (single_value->field_tP__PID.is_omit()) ret_val.tP__PID() = OMIT_VALUE;
else if (single_value->field_tP__PID.is_bound()) {
ret_val.tP__PID() = single_value->field_tP__PID.valueof();
}
if (single_value->field_tP__DCS.is_omit()) ret_val.tP__DCS() = OMIT_VALUE;
else if (single_value->field_tP__DCS.is_bound()) {
ret_val.tP__DCS() = single_value->field_tP__DCS.valueof();
}
if (single_value->field_tP__UDL__UD.is_omit()) ret_val.tP__UDL__UD() = OMIT_VALUE;
else if (single_value->field_tP__UDL__UD.is_bound()) {
ret_val.tP__UDL__UD() = single_value->field_tP__UDL__UD.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__MTI()
{
set_specific();
return single_value->field_tP__MTI;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__MTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MTI of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__MTI;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__Spare1()
{
set_specific();
return single_value->field_tP__Spare1;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__Spare1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Spare1 of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__Spare1;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__UDHI()
{
set_specific();
return single_value->field_tP__UDHI;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__UDHI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDHI of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__UDHI;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__Spare2()
{
set_specific();
return single_value->field_tP__Spare2;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__Spare2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Spare2 of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__Spare2;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PresenceBitTP__PID()
{
set_specific();
return single_value->field_tP__PresenceBitTP__PID;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PresenceBitTP__PID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_PID of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__PresenceBitTP__PID;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PresenceBitTP__DCS()
{
set_specific();
return single_value->field_tP__PresenceBitTP__DCS;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PresenceBitTP__DCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_DCS of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__PresenceBitTP__DCS;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PresenceBitTP__UDL()
{
set_specific();
return single_value->field_tP__PresenceBitTP__UDL;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PresenceBitTP__UDL() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_UDL of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__PresenceBitTP__UDL;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__Reserved()
{
set_specific();
return single_value->field_tP__Reserved;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__Reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Reserved of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__Reserved;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__ExtensionBit()
{
set_specific();
return single_value->field_tP__ExtensionBit;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__ExtensionBit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_ExtensionBit of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__ExtensionBit;
}

OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__SCTS()
{
set_specific();
return single_value->field_tP__SCTS;
}

const OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__SCTS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SCTS of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__SCTS;
}

OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PID()
{
set_specific();
return single_value->field_tP__PID;
}

const OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__PID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PID of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__PID;
}

OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__DCS()
{
set_specific();
return single_value->field_tP__DCS;
}

const OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__DCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DCS of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__DCS;
}

TP__UDL__UD_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__UDL__UD()
{
set_specific();
return single_value->field_tP__UDL__UD;
}

const TP__UDL__UD_template& SMS__SUBMIT__REPORT__in__RP__ACK_template::tP__UDL__UD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDL_UD of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
return single_value->field_tP__UDL__UD;
}

int SMS__SUBMIT__REPORT__in__RP__ACK_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 10;
      if (single_value->field_tP__PID.is_present()) ret_val++;
      if (single_value->field_tP__DCS.is_present()) ret_val++;
      if (single_value->field_tP__UDL__UD.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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
  }
  return 0;
}

void SMS__SUBMIT__REPORT__in__RP__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_MTI := ");
single_value->field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_Spare1 := ");
single_value->field_tP__Spare1.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_Spare2 := ");
single_value->field_tP__Spare2.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
single_value->field_tP__PresenceBitTP__PID.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
single_value->field_tP__PresenceBitTP__DCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
single_value->field_tP__PresenceBitTP__UDL.log();
TTCN_Logger::log_event_str(", tP_Reserved := ");
single_value->field_tP__Reserved.log();
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
single_value->field_tP__ExtensionBit.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_PID := ");
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
single_value->field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ACK_template::log_match(const SMS__SUBMIT__REPORT__in__RP__ACK& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_tP__MTI.match(match_value.tP__MTI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MTI");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Spare1.match(match_value.tP__Spare1(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Spare1");
single_value->field_tP__Spare1.log_match(match_value.tP__Spare1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__UDHI.match(match_value.tP__UDHI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDHI");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Spare2.match(match_value.tP__Spare2(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Spare2");
single_value->field_tP__Spare2.log_match(match_value.tP__Spare2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__PresenceBitTP__PID.match(match_value.tP__PresenceBitTP__PID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_PID");
single_value->field_tP__PresenceBitTP__PID.log_match(match_value.tP__PresenceBitTP__PID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__PresenceBitTP__DCS.match(match_value.tP__PresenceBitTP__DCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_DCS");
single_value->field_tP__PresenceBitTP__DCS.log_match(match_value.tP__PresenceBitTP__DCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__PresenceBitTP__UDL.match(match_value.tP__PresenceBitTP__UDL(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_UDL");
single_value->field_tP__PresenceBitTP__UDL.log_match(match_value.tP__PresenceBitTP__UDL(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Reserved.match(match_value.tP__Reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Reserved");
single_value->field_tP__Reserved.log_match(match_value.tP__Reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__ExtensionBit.match(match_value.tP__ExtensionBit(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_ExtensionBit");
single_value->field_tP__ExtensionBit.log_match(match_value.tP__ExtensionBit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__SCTS.match(match_value.tP__SCTS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SCTS");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tP__PID().ispresent()){
if(!single_value->field_tP__PID.match(match_value.tP__PID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PID");
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__PID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_PID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__DCS().ispresent()){
if(!single_value->field_tP__DCS.match(match_value.tP__DCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DCS");
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__DCS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_DCS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__DCS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__UDL__UD().ispresent()){
if(!single_value->field_tP__UDL__UD.match(match_value.tP__UDL__UD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDL_UD");
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__UDL__UD.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_UDL_UD := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__UDL__UD.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("{ tP_MTI := ");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::log_event_str(", tP_Spare1 := ");
single_value->field_tP__Spare1.log_match(match_value.tP__Spare1(), legacy);
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::log_event_str(", tP_Spare2 := ");
single_value->field_tP__Spare2.log_match(match_value.tP__Spare2(), legacy);
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
single_value->field_tP__PresenceBitTP__PID.log_match(match_value.tP__PresenceBitTP__PID(), legacy);
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
single_value->field_tP__PresenceBitTP__DCS.log_match(match_value.tP__PresenceBitTP__DCS(), legacy);
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
single_value->field_tP__PresenceBitTP__UDL.log_match(match_value.tP__PresenceBitTP__UDL(), legacy);
TTCN_Logger::log_event_str(", tP_Reserved := ");
single_value->field_tP__Reserved.log_match(match_value.tP__Reserved(), legacy);
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
single_value->field_tP__ExtensionBit.log_match(match_value.tP__ExtensionBit(), legacy);
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::log_event_str(", tP_PID := ");
if (match_value.tP__PID().ispresent()) {
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__PID.log();
if (single_value->field_tP__PID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_DCS := ");
if (match_value.tP__DCS().ispresent()) {
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__DCS.log();
if (single_value->field_tP__DCS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
if (match_value.tP__UDL__UD().ispresent()) {
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__UDL__UD.log();
if (single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ACK_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__Spare1().is_bound()) tP__Spare1().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__Spare2().is_bound()) tP__Spare2().set_implicit_omit();
if (tP__PresenceBitTP__PID().is_bound()) tP__PresenceBitTP__PID().set_implicit_omit();
if (tP__PresenceBitTP__DCS().is_bound()) tP__PresenceBitTP__DCS().set_implicit_omit();
if (tP__PresenceBitTP__UDL().is_bound()) tP__PresenceBitTP__UDL().set_implicit_omit();
if (tP__Reserved().is_bound()) tP__Reserved().set_implicit_omit();
if (tP__ExtensionBit().is_bound()) tP__ExtensionBit().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (!tP__PID().is_bound()) tP__PID() = OMIT_VALUE;
else tP__PID().set_implicit_omit();
if (!tP__DCS().is_bound()) tP__DCS() = OMIT_VALUE;
else tP__DCS().set_implicit_omit();
if (!tP__UDL__UD().is_bound()) tP__UDL__UD() = OMIT_VALUE;
else tP__UDL__UD().set_implicit_omit();
}

void SMS__SUBMIT__REPORT__in__RP__ACK_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__MTI.encode_text(text_buf);
single_value->field_tP__Spare1.encode_text(text_buf);
single_value->field_tP__UDHI.encode_text(text_buf);
single_value->field_tP__Spare2.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__PID.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__DCS.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__UDL.encode_text(text_buf);
single_value->field_tP__Reserved.encode_text(text_buf);
single_value->field_tP__ExtensionBit.encode_text(text_buf);
single_value->field_tP__SCTS.encode_text(text_buf);
single_value->field_tP__PID.encode_text(text_buf);
single_value->field_tP__DCS.encode_text(text_buf);
single_value->field_tP__UDL__UD.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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
}
}

void SMS__SUBMIT__REPORT__in__RP__ACK_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_tP__MTI.decode_text(text_buf);
single_value->field_tP__Spare1.decode_text(text_buf);
single_value->field_tP__UDHI.decode_text(text_buf);
single_value->field_tP__Spare2.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__PID.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__DCS.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__UDL.decode_text(text_buf);
single_value->field_tP__Reserved.decode_text(text_buf);
single_value->field_tP__ExtensionBit.decode_text(text_buf);
single_value->field_tP__SCTS.decode_text(text_buf);
single_value->field_tP__PID.decode_text(text_buf);
single_value->field_tP__DCS.decode_text(text_buf);
single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.");
}
}

void SMS__SUBMIT__REPORT__in__RP__ACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    SMS__SUBMIT__REPORT__in__RP__ACK_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (13<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__Spare1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__PID().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__DCS().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__UDL().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__Reserved().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__ExtensionBit().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_PresenceBitTP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_UDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__UDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__Reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ExtensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ExtensionBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__SUBMIT__REPORT__in__RP__ACK_template* precondition = new SMS__SUBMIT__REPORT__in__RP__ACK_template;
    precondition->set_param(*param.get_elem(0));
    SMS__SUBMIT__REPORT__in__RP__ACK_template* implied_template = new SMS__SUBMIT__REPORT__in__RP__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__SUBMIT__REPORT__in__RP__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__SUBMIT__REPORT__in__RP__ACK_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_tP__MTI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__Spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__Spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__PresenceBitTP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__PresenceBitTP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__PresenceBitTP__UDL.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__Reserved.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__ExtensionBit.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__SCTS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
single_value->field_tP__UDL__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK");
}

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

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

RP__ACK__User__DataTLV__SGSN__MS::RP__ACK__User__DataTLV__SGSN__MS()
{
}

RP__ACK__User__DataTLV__SGSN__MS::RP__ACK__User__DataTLV__SGSN__MS(const BITSTRING& par_rP__Spare,
    const BITSTRING& par_rP__UserDataIEI,
    const INTEGER& par_rP__LengthIndicator,
    const TPDU__RP__ACK__SGSN__MS& par_rP__TPDU)
  :   field_rP__Spare(par_rP__Spare),
  field_rP__UserDataIEI(par_rP__UserDataIEI),
  field_rP__LengthIndicator(par_rP__LengthIndicator),
  field_rP__TPDU(par_rP__TPDU)
{
}

RP__ACK__User__DataTLV__SGSN__MS::RP__ACK__User__DataTLV__SGSN__MS(const RP__ACK__User__DataTLV__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
else field_rP__Spare.clean_up();
if (other_value.rP__UserDataIEI().is_bound()) field_rP__UserDataIEI = other_value.rP__UserDataIEI();
else field_rP__UserDataIEI.clean_up();
if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
else field_rP__LengthIndicator.clean_up();
if (other_value.rP__TPDU().is_bound()) field_rP__TPDU = other_value.rP__TPDU();
else field_rP__TPDU.clean_up();
}

void RP__ACK__User__DataTLV__SGSN__MS::clean_up()
{
field_rP__Spare.clean_up();
field_rP__UserDataIEI.clean_up();
field_rP__LengthIndicator.clean_up();
field_rP__TPDU.clean_up();
}

const TTCN_Typedescriptor_t* RP__ACK__User__DataTLV__SGSN__MS::get_descriptor() const { return &RP__ACK__User__DataTLV__SGSN__MS_descr_; }
RP__ACK__User__DataTLV__SGSN__MS& RP__ACK__User__DataTLV__SGSN__MS::operator=(const RP__ACK__User__DataTLV__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
  if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
  else field_rP__Spare.clean_up();
  if (other_value.rP__UserDataIEI().is_bound()) field_rP__UserDataIEI = other_value.rP__UserDataIEI();
  else field_rP__UserDataIEI.clean_up();
  if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
  else field_rP__LengthIndicator.clean_up();
  if (other_value.rP__TPDU().is_bound()) field_rP__TPDU = other_value.rP__TPDU();
  else field_rP__TPDU.clean_up();
}
return *this;
}

boolean RP__ACK__User__DataTLV__SGSN__MS::operator==(const RP__ACK__User__DataTLV__SGSN__MS& other_value) const
{
return field_rP__Spare==other_value.field_rP__Spare
  && field_rP__UserDataIEI==other_value.field_rP__UserDataIEI
  && field_rP__LengthIndicator==other_value.field_rP__LengthIndicator
  && field_rP__TPDU==other_value.field_rP__TPDU;
}

boolean RP__ACK__User__DataTLV__SGSN__MS::is_bound() const
{
return (field_rP__Spare.is_bound())
  || (field_rP__UserDataIEI.is_bound())
  || (field_rP__LengthIndicator.is_bound())
  || (field_rP__TPDU.is_bound());
}
boolean RP__ACK__User__DataTLV__SGSN__MS::is_value() const
{
return field_rP__Spare.is_value()
  && field_rP__UserDataIEI.is_value()
  && field_rP__LengthIndicator.is_value()
  && field_rP__TPDU.is_value();
}
void RP__ACK__User__DataTLV__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rP_Spare := ");
field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_UserDataIEI := ");
field_rP__UserDataIEI.log();
TTCN_Logger::log_event_str(", rP_LengthIndicator := ");
field_rP__LengthIndicator.log();
TTCN_Logger::log_event_str(", rP_TPDU := ");
field_rP__TPDU.log();
TTCN_Logger::log_event_str(" }");
}

void RP__ACK__User__DataTLV__SGSN__MS::set_implicit_omit()
{
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__UserDataIEI().is_bound()) rP__UserDataIEI().set_implicit_omit();
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__TPDU().is_bound()) rP__TPDU().set_implicit_omit();
}

void RP__ACK__User__DataTLV__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS 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) rP__Spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__UserDataIEI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__LengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__TPDU().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(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_UserDataIEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__UserDataIEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_TPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__TPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS");
  }
}

void RP__ACK__User__DataTLV__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_rP__Spare.encode_text(text_buf);
field_rP__UserDataIEI.encode_text(text_buf);
field_rP__LengthIndicator.encode_text(text_buf);
field_rP__TPDU.encode_text(text_buf);
}

void RP__ACK__User__DataTLV__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_rP__Spare.decode_text(text_buf);
field_rP__UserDataIEI.decode_text(text_buf);
field_rP__LengthIndicator.decode_text(text_buf);
field_rP__TPDU.decode_text(text_buf);
}

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

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

int RP__ACK__User__DataTLV__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_descr_.raw->forceomit);
  decoded_field_length = field_rP__Spare.RAW_decode(RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_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, RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_.raw->forceomit);
  decoded_field_length = field_rP__UserDataIEI.RAW_decode(RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_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, RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_rP__LengthIndicator.RAW_decode(RP__ACK__User__DataTLV__SGSN__MS_rP__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_rP__LengthIndicator.convert_to_Integer(RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_);
  field_rP__LengthIndicator = tmp2;
  value_of_length_field2 += tmp2.get_long_long_val() * 8;
  RAW_Force_Omit field_3_force_omit(3, force_omit, TPDU__RP__ACK__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_rP__TPDU.RAW_decode(TPDU__RP__ACK__SGSN__MS_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_rP__UserDataIEI !=  bs_6) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__ACK__User__DataTLV__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TPDU__RP__ACK__SGSN__MS_descr_.raw);
  encoded_length += field_rP__Spare.RAW_encode(RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__UserDataIEI.RAW_encode(RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->coding_descr = &RP__ACK__User__DataTLV__SGSN__MS_rP__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_rP__TPDU.RAW_encode(TPDU__RP__ACK__SGSN__MS_descr_, *myleaf.body.node.nodes[3]);
  if (field_rP__UserDataIEI !=  bs_6) {
  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_6.RAW_encode(RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_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 RP__ACK__User__DataTLV__SGSN__MS_template::single_value_struct {
BITSTRING_template field_rP__Spare;
BITSTRING_template field_rP__UserDataIEI;
INTEGER_template field_rP__LengthIndicator;
TPDU__RP__ACK__SGSN__MS_template field_rP__TPDU;
};

void RP__ACK__User__DataTLV__SGSN__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_rP__Spare = ANY_VALUE;
single_value->field_rP__UserDataIEI = ANY_VALUE;
single_value->field_rP__LengthIndicator = ANY_VALUE;
single_value->field_rP__TPDU = ANY_VALUE;
}
}
}

void RP__ACK__User__DataTLV__SGSN__MS_template::copy_value(const RP__ACK__User__DataTLV__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.rP__Spare().is_bound()) {
  single_value->field_rP__Spare = other_value.rP__Spare();
} else {
  single_value->field_rP__Spare.clean_up();
}
if (other_value.rP__UserDataIEI().is_bound()) {
  single_value->field_rP__UserDataIEI = other_value.rP__UserDataIEI();
} else {
  single_value->field_rP__UserDataIEI.clean_up();
}
if (other_value.rP__LengthIndicator().is_bound()) {
  single_value->field_rP__LengthIndicator = other_value.rP__LengthIndicator();
} else {
  single_value->field_rP__LengthIndicator.clean_up();
}
if (other_value.rP__TPDU().is_bound()) {
  single_value->field_rP__TPDU = other_value.rP__TPDU();
} else {
  single_value->field_rP__TPDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__ACK__User__DataTLV__SGSN__MS_template::copy_template(const RP__ACK__User__DataTLV__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rP__Spare().get_selection()) {
single_value->field_rP__Spare = other_value.rP__Spare();
} else {
single_value->field_rP__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__UserDataIEI().get_selection()) {
single_value->field_rP__UserDataIEI = other_value.rP__UserDataIEI();
} else {
single_value->field_rP__UserDataIEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__LengthIndicator().get_selection()) {
single_value->field_rP__LengthIndicator = other_value.rP__LengthIndicator();
} else {
single_value->field_rP__LengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__TPDU().get_selection()) {
single_value->field_rP__TPDU = other_value.rP__TPDU();
} else {
single_value->field_rP__TPDU.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 RP__ACK__User__DataTLV__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RP__ACK__User__DataTLV__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ACK__User__DataTLV__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
break;
}
set_selection(other_value);
}

RP__ACK__User__DataTLV__SGSN__MS_template::RP__ACK__User__DataTLV__SGSN__MS_template()
{
}

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

RP__ACK__User__DataTLV__SGSN__MS_template::RP__ACK__User__DataTLV__SGSN__MS_template(const RP__ACK__User__DataTLV__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__ACK__User__DataTLV__SGSN__MS_template::match(const RP__ACK__User__DataTLV__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.rP__Spare().is_bound()) return FALSE;
if(!single_value->field_rP__Spare.match(other_value.rP__Spare(), legacy))return FALSE;
if(!other_value.rP__UserDataIEI().is_bound()) return FALSE;
if(!single_value->field_rP__UserDataIEI.match(other_value.rP__UserDataIEI(), legacy))return FALSE;
if(!other_value.rP__LengthIndicator().is_bound()) return FALSE;
if(!single_value->field_rP__LengthIndicator.match(other_value.rP__LengthIndicator(), legacy))return FALSE;
if(!other_value.rP__TPDU().is_bound()) return FALSE;
if(!single_value->field_rP__TPDU.match(other_value.rP__TPDU(), 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_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
}
return FALSE;
}

boolean RP__ACK__User__DataTLV__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rP__Spare.is_bound()
 || single_value->field_rP__UserDataIEI.is_bound()
 || single_value->field_rP__LengthIndicator.is_bound()
 || single_value->field_rP__TPDU.is_bound();
}

boolean RP__ACK__User__DataTLV__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rP__Spare.is_value()
 && single_value->field_rP__UserDataIEI.is_value()
 && single_value->field_rP__LengthIndicator.is_value()
 && single_value->field_rP__TPDU.is_value();
}

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

RP__ACK__User__DataTLV__SGSN__MS RP__ACK__User__DataTLV__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
RP__ACK__User__DataTLV__SGSN__MS ret_val;
if (single_value->field_rP__Spare.is_bound()) {
ret_val.rP__Spare() = single_value->field_rP__Spare.valueof();
}
if (single_value->field_rP__UserDataIEI.is_bound()) {
ret_val.rP__UserDataIEI() = single_value->field_rP__UserDataIEI.valueof();
}
if (single_value->field_rP__LengthIndicator.is_bound()) {
ret_val.rP__LengthIndicator() = single_value->field_rP__LengthIndicator.valueof();
}
if (single_value->field_rP__TPDU.is_bound()) {
ret_val.rP__TPDU() = single_value->field_rP__TPDU.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__Spare()
{
set_specific();
return single_value->field_rP__Spare;
}

const BITSTRING_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_Spare of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
return single_value->field_rP__Spare;
}

BITSTRING_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__UserDataIEI()
{
set_specific();
return single_value->field_rP__UserDataIEI;
}

const BITSTRING_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__UserDataIEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_UserDataIEI of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
return single_value->field_rP__UserDataIEI;
}

INTEGER_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__LengthIndicator()
{
set_specific();
return single_value->field_rP__LengthIndicator;
}

const INTEGER_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__LengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_LengthIndicator of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
return single_value->field_rP__LengthIndicator;
}

TPDU__RP__ACK__SGSN__MS_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__TPDU()
{
set_specific();
return single_value->field_rP__TPDU;
}

const TPDU__RP__ACK__SGSN__MS_template& RP__ACK__User__DataTLV__SGSN__MS_template::rP__TPDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_TPDU of a non-specific template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
return single_value->field_rP__TPDU;
}

int RP__ACK__User__DataTLV__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS 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_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
  }
  return 0;
}

void RP__ACK__User__DataTLV__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rP_Spare := ");
single_value->field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_UserDataIEI := ");
single_value->field_rP__UserDataIEI.log();
TTCN_Logger::log_event_str(", rP_LengthIndicator := ");
single_value->field_rP__LengthIndicator.log();
TTCN_Logger::log_event_str(", rP_TPDU := ");
single_value->field_rP__TPDU.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 RP__ACK__User__DataTLV__SGSN__MS_template::log_match(const RP__ACK__User__DataTLV__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_rP__Spare.match(match_value.rP__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_Spare");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__UserDataIEI.match(match_value.rP__UserDataIEI(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_UserDataIEI");
single_value->field_rP__UserDataIEI.log_match(match_value.rP__UserDataIEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__LengthIndicator.match(match_value.rP__LengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_LengthIndicator");
single_value->field_rP__LengthIndicator.log_match(match_value.rP__LengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__TPDU.match(match_value.rP__TPDU(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_TPDU");
single_value->field_rP__TPDU.log_match(match_value.rP__TPDU(), 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("{ rP_Spare := ");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::log_event_str(", rP_UserDataIEI := ");
single_value->field_rP__UserDataIEI.log_match(match_value.rP__UserDataIEI(), legacy);
TTCN_Logger::log_event_str(", rP_LengthIndicator := ");
single_value->field_rP__LengthIndicator.log_match(match_value.rP__LengthIndicator(), legacy);
TTCN_Logger::log_event_str(", rP_TPDU := ");
single_value->field_rP__TPDU.log_match(match_value.rP__TPDU(), 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 RP__ACK__User__DataTLV__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__UserDataIEI().is_bound()) rP__UserDataIEI().set_implicit_omit();
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__TPDU().is_bound()) rP__TPDU().set_implicit_omit();
}

void RP__ACK__User__DataTLV__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rP__Spare.encode_text(text_buf);
single_value->field_rP__UserDataIEI.encode_text(text_buf);
single_value->field_rP__LengthIndicator.encode_text(text_buf);
single_value->field_rP__TPDU.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_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.");
}
}

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

void RP__ACK__User__DataTLV__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RP__ACK__User__DataTLV__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS 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) rP__Spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__UserDataIEI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__LengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__TPDU().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(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_UserDataIEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__UserDataIEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_TPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__TPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__ACK__User__DataTLV__SGSN__MS_template* precondition = new RP__ACK__User__DataTLV__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    RP__ACK__User__DataTLV__SGSN__MS_template* implied_template = new RP__ACK__User__DataTLV__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__ACK__User__DataTLV__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

RP__ERROR__SGSN__MS::RP__ERROR__SGSN__MS()
{
}

RP__ERROR__SGSN__MS::RP__ERROR__SGSN__MS(const BITSTRING& par_rP__MTI,
    const BITSTRING& par_rP__Spare,
    const OCTETSTRING& par_rP__Message__Reference,
    const RP__CauseLV& par_rP__CauseLV,
    const OPTIONAL< RP__ERROR__User__DataTLV__SGSN__MS >& par_rP__User__Data)
  :   field_rP__MTI(par_rP__MTI),
  field_rP__Spare(par_rP__Spare),
  field_rP__Message__Reference(par_rP__Message__Reference),
  field_rP__CauseLV(par_rP__CauseLV),
  field_rP__User__Data(par_rP__User__Data)
{
}

RP__ERROR__SGSN__MS::RP__ERROR__SGSN__MS(const RP__ERROR__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
if (other_value.rP__MTI().is_bound()) field_rP__MTI = other_value.rP__MTI();
else field_rP__MTI.clean_up();
if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
else field_rP__Spare.clean_up();
if (other_value.rP__Message__Reference().is_bound()) field_rP__Message__Reference = other_value.rP__Message__Reference();
else field_rP__Message__Reference.clean_up();
if (other_value.rP__CauseLV().is_bound()) field_rP__CauseLV = other_value.rP__CauseLV();
else field_rP__CauseLV.clean_up();
if (other_value.rP__User__Data().is_bound()) field_rP__User__Data = other_value.rP__User__Data();
else field_rP__User__Data.clean_up();
}

void RP__ERROR__SGSN__MS::clean_up()
{
field_rP__MTI.clean_up();
field_rP__Spare.clean_up();
field_rP__Message__Reference.clean_up();
field_rP__CauseLV.clean_up();
field_rP__User__Data.clean_up();
}

const TTCN_Typedescriptor_t* RP__ERROR__SGSN__MS::get_descriptor() const { return &RP__ERROR__SGSN__MS_descr_; }
RP__ERROR__SGSN__MS& RP__ERROR__SGSN__MS::operator=(const RP__ERROR__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
  if (other_value.rP__MTI().is_bound()) field_rP__MTI = other_value.rP__MTI();
  else field_rP__MTI.clean_up();
  if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
  else field_rP__Spare.clean_up();
  if (other_value.rP__Message__Reference().is_bound()) field_rP__Message__Reference = other_value.rP__Message__Reference();
  else field_rP__Message__Reference.clean_up();
  if (other_value.rP__CauseLV().is_bound()) field_rP__CauseLV = other_value.rP__CauseLV();
  else field_rP__CauseLV.clean_up();
  if (other_value.rP__User__Data().is_bound()) field_rP__User__Data = other_value.rP__User__Data();
  else field_rP__User__Data.clean_up();
}
return *this;
}

boolean RP__ERROR__SGSN__MS::operator==(const RP__ERROR__SGSN__MS& other_value) const
{
return field_rP__MTI==other_value.field_rP__MTI
  && field_rP__Spare==other_value.field_rP__Spare
  && field_rP__Message__Reference==other_value.field_rP__Message__Reference
  && field_rP__CauseLV==other_value.field_rP__CauseLV
  && field_rP__User__Data==other_value.field_rP__User__Data;
}

boolean RP__ERROR__SGSN__MS::is_bound() const
{
return (field_rP__MTI.is_bound())
  || (field_rP__Spare.is_bound())
  || (field_rP__Message__Reference.is_bound())
  || (field_rP__CauseLV.is_bound())
  || (OPTIONAL_OMIT == field_rP__User__Data.get_selection() || field_rP__User__Data.is_bound());
}
boolean RP__ERROR__SGSN__MS::is_value() const
{
return field_rP__MTI.is_value()
  && field_rP__Spare.is_value()
  && field_rP__Message__Reference.is_value()
  && field_rP__CauseLV.is_value()
  && (OPTIONAL_OMIT == field_rP__User__Data.get_selection() || field_rP__User__Data.is_value());
}
int RP__ERROR__SGSN__MS::size_of() const
{
  int ret_val = 4;
  if (field_rP__User__Data.ispresent()) ret_val++;
  return ret_val;
}

void RP__ERROR__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rP_MTI := ");
field_rP__MTI.log();
TTCN_Logger::log_event_str(", rP_Spare := ");
field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_Message_Reference := ");
field_rP__Message__Reference.log();
TTCN_Logger::log_event_str(", rP_CauseLV := ");
field_rP__CauseLV.log();
TTCN_Logger::log_event_str(", rP_User_Data := ");
field_rP__User__Data.log();
TTCN_Logger::log_event_str(" }");
}

void RP__ERROR__SGSN__MS::set_implicit_omit()
{
if (rP__MTI().is_bound()) rP__MTI().set_implicit_omit();
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__Message__Reference().is_bound()) rP__Message__Reference().set_implicit_omit();
if (rP__CauseLV().is_bound()) rP__CauseLV().set_implicit_omit();
if (!rP__User__Data().is_bound()) rP__User__Data() = OMIT_VALUE;
else rP__User__Data().set_implicit_omit();
}

void RP__ERROR__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS 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) rP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__Spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__Message__Reference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__CauseLV().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rP__User__Data().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(), "rP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_Message_Reference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__Message__Reference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_CauseLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__CauseLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_User_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__User__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_ERROR_SGSN_MS");
  }
}

void RP__ERROR__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_rP__MTI.encode_text(text_buf);
field_rP__Spare.encode_text(text_buf);
field_rP__Message__Reference.encode_text(text_buf);
field_rP__CauseLV.encode_text(text_buf);
field_rP__User__Data.encode_text(text_buf);
}

void RP__ERROR__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_rP__MTI.decode_text(text_buf);
field_rP__Spare.decode_text(text_buf);
field_rP__Message__Reference.decode_text(text_buf);
field_rP__CauseLV.decode_text(text_buf);
field_rP__User__Data.decode_text(text_buf);
}

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

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

int RP__ERROR__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_rP__MTI.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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_rP__Spare.RAW_decode(General__Types::BIT5_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_rP__Message__Reference.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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, RP__CauseLV_descr_.raw->forceomit);
  decoded_field_length = field_rP__CauseLV.RAW_decode(RP__CauseLV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_rP__User__Data = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, RP__ERROR__User__DataTLV__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_rP__User__Data().RAW_decode(RP__ERROR__User__DataTLV__SGSN__MS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_rP__User__Data = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_rP__User__Data=OMIT_VALUE;
  if (field_rP__MTI !=  bs_8) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__ERROR__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT5_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, RP__CauseLV_descr_.raw);
  if (field_rP__User__Data.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RP__ERROR__User__DataTLV__SGSN__MS_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_rP__MTI.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__Spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rP__Message__Reference.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rP__CauseLV.RAW_encode(RP__CauseLV_descr_, *myleaf.body.node.nodes[3]);
  if (field_rP__User__Data.ispresent()) {
  encoded_length += field_rP__User__Data().RAW_encode(RP__ERROR__User__DataTLV__SGSN__MS_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_rP__MTI !=  bs_8) {
  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_8.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 RP__ERROR__SGSN__MS_template::single_value_struct {
BITSTRING_template field_rP__MTI;
BITSTRING_template field_rP__Spare;
OCTETSTRING_template field_rP__Message__Reference;
RP__CauseLV_template field_rP__CauseLV;
RP__ERROR__User__DataTLV__SGSN__MS_template field_rP__User__Data;
};

void RP__ERROR__SGSN__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_rP__MTI = ANY_VALUE;
single_value->field_rP__Spare = ANY_VALUE;
single_value->field_rP__Message__Reference = ANY_VALUE;
single_value->field_rP__CauseLV = ANY_VALUE;
single_value->field_rP__User__Data = ANY_OR_OMIT;
}
}
}

void RP__ERROR__SGSN__MS_template::copy_value(const RP__ERROR__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.rP__MTI().is_bound()) {
  single_value->field_rP__MTI = other_value.rP__MTI();
} else {
  single_value->field_rP__MTI.clean_up();
}
if (other_value.rP__Spare().is_bound()) {
  single_value->field_rP__Spare = other_value.rP__Spare();
} else {
  single_value->field_rP__Spare.clean_up();
}
if (other_value.rP__Message__Reference().is_bound()) {
  single_value->field_rP__Message__Reference = other_value.rP__Message__Reference();
} else {
  single_value->field_rP__Message__Reference.clean_up();
}
if (other_value.rP__CauseLV().is_bound()) {
  single_value->field_rP__CauseLV = other_value.rP__CauseLV();
} else {
  single_value->field_rP__CauseLV.clean_up();
}
if (other_value.rP__User__Data().is_bound()) {
  if (other_value.rP__User__Data().ispresent()) single_value->field_rP__User__Data = other_value.rP__User__Data()();
  else single_value->field_rP__User__Data = OMIT_VALUE;
} else {
  single_value->field_rP__User__Data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__ERROR__SGSN__MS_template::copy_template(const RP__ERROR__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rP__MTI().get_selection()) {
single_value->field_rP__MTI = other_value.rP__MTI();
} else {
single_value->field_rP__MTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__Spare().get_selection()) {
single_value->field_rP__Spare = other_value.rP__Spare();
} else {
single_value->field_rP__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__Message__Reference().get_selection()) {
single_value->field_rP__Message__Reference = other_value.rP__Message__Reference();
} else {
single_value->field_rP__Message__Reference.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__CauseLV().get_selection()) {
single_value->field_rP__CauseLV = other_value.rP__CauseLV();
} else {
single_value->field_rP__CauseLV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__User__Data().get_selection()) {
single_value->field_rP__User__Data = other_value.rP__User__Data();
} else {
single_value->field_rP__User__Data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RP__ERROR__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RP__ERROR__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ERROR__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
break;
}
set_selection(other_value);
}

RP__ERROR__SGSN__MS_template::RP__ERROR__SGSN__MS_template()
{
}

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

RP__ERROR__SGSN__MS_template::RP__ERROR__SGSN__MS_template(const RP__ERROR__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__ERROR__SGSN__MS_template::match(const RP__ERROR__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.rP__MTI().is_bound()) return FALSE;
if(!single_value->field_rP__MTI.match(other_value.rP__MTI(), legacy))return FALSE;
if(!other_value.rP__Spare().is_bound()) return FALSE;
if(!single_value->field_rP__Spare.match(other_value.rP__Spare(), legacy))return FALSE;
if(!other_value.rP__Message__Reference().is_bound()) return FALSE;
if(!single_value->field_rP__Message__Reference.match(other_value.rP__Message__Reference(), legacy))return FALSE;
if(!other_value.rP__CauseLV().is_bound()) return FALSE;
if(!single_value->field_rP__CauseLV.match(other_value.rP__CauseLV(), legacy))return FALSE;
if(!other_value.rP__User__Data().is_bound()) return FALSE;
if((other_value.rP__User__Data().ispresent() ? !single_value->field_rP__User__Data.match((const RP__ERROR__User__DataTLV__SGSN__MS&)other_value.rP__User__Data(), legacy) : !single_value->field_rP__User__Data.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
}
return FALSE;
}

boolean RP__ERROR__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rP__MTI.is_bound()
 || single_value->field_rP__Spare.is_bound()
 || single_value->field_rP__Message__Reference.is_bound()
 || single_value->field_rP__CauseLV.is_bound()
 || (single_value->field_rP__User__Data.is_omit() || single_value->field_rP__User__Data.is_bound());
}

boolean RP__ERROR__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rP__MTI.is_value()
 && single_value->field_rP__Spare.is_value()
 && single_value->field_rP__Message__Reference.is_value()
 && single_value->field_rP__CauseLV.is_value()
 && (single_value->field_rP__User__Data.is_omit() || single_value->field_rP__User__Data.is_value());
}

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

RP__ERROR__SGSN__MS RP__ERROR__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
RP__ERROR__SGSN__MS ret_val;
if (single_value->field_rP__MTI.is_bound()) {
ret_val.rP__MTI() = single_value->field_rP__MTI.valueof();
}
if (single_value->field_rP__Spare.is_bound()) {
ret_val.rP__Spare() = single_value->field_rP__Spare.valueof();
}
if (single_value->field_rP__Message__Reference.is_bound()) {
ret_val.rP__Message__Reference() = single_value->field_rP__Message__Reference.valueof();
}
if (single_value->field_rP__CauseLV.is_bound()) {
ret_val.rP__CauseLV() = single_value->field_rP__CauseLV.valueof();
}
if (single_value->field_rP__User__Data.is_omit()) ret_val.rP__User__Data() = OMIT_VALUE;
else if (single_value->field_rP__User__Data.is_bound()) {
ret_val.rP__User__Data() = single_value->field_rP__User__Data.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RP__ERROR__SGSN__MS_template::rP__MTI()
{
set_specific();
return single_value->field_rP__MTI;
}

const BITSTRING_template& RP__ERROR__SGSN__MS_template::rP__MTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_MTI of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
return single_value->field_rP__MTI;
}

BITSTRING_template& RP__ERROR__SGSN__MS_template::rP__Spare()
{
set_specific();
return single_value->field_rP__Spare;
}

const BITSTRING_template& RP__ERROR__SGSN__MS_template::rP__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_Spare of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
return single_value->field_rP__Spare;
}

OCTETSTRING_template& RP__ERROR__SGSN__MS_template::rP__Message__Reference()
{
set_specific();
return single_value->field_rP__Message__Reference;
}

const OCTETSTRING_template& RP__ERROR__SGSN__MS_template::rP__Message__Reference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_Message_Reference of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
return single_value->field_rP__Message__Reference;
}

RP__CauseLV_template& RP__ERROR__SGSN__MS_template::rP__CauseLV()
{
set_specific();
return single_value->field_rP__CauseLV;
}

const RP__CauseLV_template& RP__ERROR__SGSN__MS_template::rP__CauseLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_CauseLV of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
return single_value->field_rP__CauseLV;
}

RP__ERROR__User__DataTLV__SGSN__MS_template& RP__ERROR__SGSN__MS_template::rP__User__Data()
{
set_specific();
return single_value->field_rP__User__Data;
}

const RP__ERROR__User__DataTLV__SGSN__MS_template& RP__ERROR__SGSN__MS_template::rP__User__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_User_Data of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS.");
return single_value->field_rP__User__Data;
}

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

void RP__ERROR__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rP_MTI := ");
single_value->field_rP__MTI.log();
TTCN_Logger::log_event_str(", rP_Spare := ");
single_value->field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_Message_Reference := ");
single_value->field_rP__Message__Reference.log();
TTCN_Logger::log_event_str(", rP_CauseLV := ");
single_value->field_rP__CauseLV.log();
TTCN_Logger::log_event_str(", rP_User_Data := ");
single_value->field_rP__User__Data.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RP__ERROR__SGSN__MS_template::log_match(const RP__ERROR__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_rP__MTI.match(match_value.rP__MTI(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_MTI");
single_value->field_rP__MTI.log_match(match_value.rP__MTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__Spare.match(match_value.rP__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_Spare");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__Message__Reference.match(match_value.rP__Message__Reference(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_Message_Reference");
single_value->field_rP__Message__Reference.log_match(match_value.rP__Message__Reference(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__CauseLV.match(match_value.rP__CauseLV(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_CauseLV");
single_value->field_rP__CauseLV.log_match(match_value.rP__CauseLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rP__User__Data().ispresent()){
if(!single_value->field_rP__User__Data.match(match_value.rP__User__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_User_Data");
single_value->field_rP__User__Data.log_match(match_value.rP__User__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rP__User__Data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rP_User_Data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rP__User__Data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ rP_MTI := ");
single_value->field_rP__MTI.log_match(match_value.rP__MTI(), legacy);
TTCN_Logger::log_event_str(", rP_Spare := ");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::log_event_str(", rP_Message_Reference := ");
single_value->field_rP__Message__Reference.log_match(match_value.rP__Message__Reference(), legacy);
TTCN_Logger::log_event_str(", rP_CauseLV := ");
single_value->field_rP__CauseLV.log_match(match_value.rP__CauseLV(), legacy);
TTCN_Logger::log_event_str(", rP_User_Data := ");
if (match_value.rP__User__Data().ispresent()) {
single_value->field_rP__User__Data.log_match(match_value.rP__User__Data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rP__User__Data.log();
if (single_value->field_rP__User__Data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RP__ERROR__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__MTI().is_bound()) rP__MTI().set_implicit_omit();
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__Message__Reference().is_bound()) rP__Message__Reference().set_implicit_omit();
if (rP__CauseLV().is_bound()) rP__CauseLV().set_implicit_omit();
if (!rP__User__Data().is_bound()) rP__User__Data() = OMIT_VALUE;
else rP__User__Data().set_implicit_omit();
}

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

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

void RP__ERROR__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RP__ERROR__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS 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) rP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__Spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__Message__Reference().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__CauseLV().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rP__User__Data().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(), "rP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_Message_Reference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__Message__Reference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_CauseLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__CauseLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_User_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__User__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.RP_ERROR_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__ERROR__SGSN__MS_template* precondition = new RP__ERROR__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    RP__ERROR__SGSN__MS_template* implied_template = new RP__ERROR__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__ERROR__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_ERROR_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

void TPDU__RP__ERROR__SGSN__MS::copy_value(const TPDU__RP__ERROR__SGSN__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_sMS__SUBMIT__REPORT:
field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ERROR(*other_value.field_sMS__SUBMIT__REPORT);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TPDU__RP__ERROR__SGSN__MS::operator==(const TPDU__RP__ERROR__SGSN__MS& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
return *field_sMS__SUBMIT__REPORT == *other_value.field_sMS__SUBMIT__REPORT;
default:
return FALSE;
}
}

SMS__SUBMIT__REPORT__in__RP__ERROR& TPDU__RP__ERROR__SGSN__MS::sMS__SUBMIT__REPORT()
{
if (union_selection != ALT_sMS__SUBMIT__REPORT) {
clean_up();
field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ERROR;
union_selection = ALT_sMS__SUBMIT__REPORT;
}
return *field_sMS__SUBMIT__REPORT;
}

const SMS__SUBMIT__REPORT__in__RP__ERROR& TPDU__RP__ERROR__SGSN__MS::sMS__SUBMIT__REPORT() const
{
if (union_selection != ALT_sMS__SUBMIT__REPORT) TTCN_error("Using non-selected field sMS_SUBMIT_REPORT in a value of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
return *field_sMS__SUBMIT__REPORT;
}

boolean TPDU__RP__ERROR__SGSN__MS::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_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
return union_selection == checked_selection;
}

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

boolean TPDU__RP__ERROR__SGSN__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_sMS__SUBMIT__REPORT: return field_sMS__SUBMIT__REPORT->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TPDU__RP__ERROR__SGSN__MS::clean_up()
{
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
  delete field_sMS__SUBMIT__REPORT;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TPDU__RP__ERROR__SGSN__MS::log() const
{
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
TTCN_Logger::log_event_str("{ sMS_SUBMIT_REPORT := ");
field_sMS__SUBMIT__REPORT->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TPDU__RP__ERROR__SGSN__MS::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, "sMS_SUBMIT_REPORT")) {
    sMS__SUBMIT__REPORT().set_param(*mp_last);
    if (!sMS__SUBMIT__REPORT().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.", last_name);
}

void TPDU__RP__ERROR__SGSN__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
field_sMS__SUBMIT__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__ERROR__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_sMS__SUBMIT__REPORT:
field_sMS__SUBMIT__REPORT->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
}

void TPDU__RP__ERROR__SGSN__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_sMS__SUBMIT__REPORT:
sMS__SUBMIT__REPORT().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
}

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

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

int TPDU__RP__ERROR__SGSN__MS::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int 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, SMS__SUBMIT__REPORT__in__RP__ERROR_descr_.raw->forceomit);
      decoded_length = sMS__SUBMIT__REPORT().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ERROR_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 {
    boolean already_failed = FALSE;
    already_failed = FALSE;
    if (!already_failed) {
      BITSTRING temporal_0;
      int decoded_0_length;
      p_buf.set_pos_bit(starting_pos + 0);
      decoded_0_length = temporal_0.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_0) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, SMS__SUBMIT__REPORT__in__RP__ERROR_descr_.raw->forceomit);
          decoded_length = sMS__SUBMIT__REPORT().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ERROR_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__SUBMIT__REPORT).tP__MTI() ==  bs_0) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int TPDU__RP__ERROR__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 1;  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  memset(myleaf.body.node.nodes, 0, 1 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_sMS__SUBMIT__REPORT:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_descr_.raw);
    encoded_length = field_sMS__SUBMIT__REPORT->RAW_encode(SMS__SUBMIT__REPORT__in__RP__ERROR_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SMS__SUBMIT__REPORT__in__RP__ERROR_descr_;
    if ((*field_sMS__SUBMIT__REPORT).tP__MTI() !=  bs_0) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT2_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);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TPDU__RP__ERROR__SGSN__MS_template::copy_value(const TPDU__RP__ERROR__SGSN__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ERROR_template(other_value.sMS__SUBMIT__REPORT());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void TPDU__RP__ERROR__SGSN__MS_template::copy_template(const TPDU__RP__ERROR__SGSN__MS_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 TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ERROR_template(*other_value.single_value.field_sMS__SUBMIT__REPORT);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
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 TPDU__RP__ERROR__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TPDU__RP__ERROR__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new TPDU__RP__ERROR__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
set_selection(other_value);
}

TPDU__RP__ERROR__SGSN__MS_template::TPDU__RP__ERROR__SGSN__MS_template()
{
}

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

TPDU__RP__ERROR__SGSN__MS_template::TPDU__RP__ERROR__SGSN__MS_template(const TPDU__RP__ERROR__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void TPDU__RP__ERROR__SGSN__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
delete single_value.field_sMS__SUBMIT__REPORT;
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;
}

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

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

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

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

boolean TPDU__RP__ERROR__SGSN__MS_template::match(const TPDU__RP__ERROR__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
TPDU__RP__ERROR__SGSN__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TPDU__RP__ERROR__SGSN__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
return single_value.field_sMS__SUBMIT__REPORT->match(other_value.sMS__SUBMIT__REPORT(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
}
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_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
return FALSE;
}

boolean TPDU__RP__ERROR__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
return single_value.field_sMS__SUBMIT__REPORT->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_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
}

TPDU__RP__ERROR__SGSN__MS TPDU__RP__ERROR__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
TPDU__RP__ERROR__SGSN__MS ret_val;
switch (single_value.union_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
ret_val.sMS__SUBMIT__REPORT() = single_value.field_sMS__SUBMIT__REPORT->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
return ret_val;
}

TPDU__RP__ERROR__SGSN__MS_template& TPDU__RP__ERROR__SGSN__MS_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_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
return value_list.list_value[list_index];
}
void TPDU__RP__ERROR__SGSN__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TPDU__RP__ERROR__SGSN__MS_template[list_length];
}

SMS__SUBMIT__REPORT__in__RP__ERROR_template& TPDU__RP__ERROR__SGSN__MS_template::sMS__SUBMIT__REPORT()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ERROR_template(ANY_VALUE);
else single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ERROR_template;
single_value.union_selection = TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__SUBMIT__REPORT;
}

const SMS__SUBMIT__REPORT__in__RP__ERROR_template& TPDU__RP__ERROR__SGSN__MS_template::sMS__SUBMIT__REPORT() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_SUBMIT_REPORT in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
if (single_value.union_selection != TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT) TTCN_error("Accessing non-selected field sMS_SUBMIT_REPORT in a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
return *single_value.field_sMS__SUBMIT__REPORT;
}

boolean TPDU__RP__ERROR__SGSN__MS_template::ischosen(TPDU__RP__ERROR__SGSN__MS::union_selection_type checked_selection) const
{
if (checked_selection == TPDU__RP__ERROR__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TPDU__RP__ERROR__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
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_SMS_Types.TPDU_RP_ERROR_SGSN_MS 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 TPDU__RP__ERROR__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
TTCN_Logger::log_event_str("{ sMS_SUBMIT_REPORT := ");
single_value.field_sMS__SUBMIT__REPORT->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 TPDU__RP__ERROR__SGSN__MS_template::log_match(const TPDU__RP__ERROR__SGSN__MS& 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 TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_SUBMIT_REPORT");
single_value.field_sMS__SUBMIT__REPORT->log_match(match_value.sMS__SUBMIT__REPORT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_SUBMIT_REPORT := ");
single_value.field_sMS__SUBMIT__REPORT->log_match(match_value.sMS__SUBMIT__REPORT(), 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 TPDU__RP__ERROR__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__ERROR__SGSN__MS_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 TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
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_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
}

void TPDU__RP__ERROR__SGSN__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TPDU__RP__ERROR__SGSN__MS::UNBOUND_VALUE;
TPDU__RP__ERROR__SGSN__MS::union_selection_type new_selection = (TPDU__RP__ERROR__SGSN__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT = new SMS__SUBMIT__REPORT__in__RP__ERROR_template;
single_value.field_sMS__SUBMIT__REPORT->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
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 TPDU__RP__ERROR__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
}

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

boolean TPDU__RP__ERROR__SGSN__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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 TPDU__RP__ERROR__SGSN__MS_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_SMS_Types.TPDU_RP_ERROR_SGSN_MS'");
    }
    if (strcmp("sMS_SUBMIT_REPORT", param_field) == 0) {
      sMS__SUBMIT__REPORT().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS'", 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: {
    TPDU__RP__ERROR__SGSN__MS_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_SMS_Types.TPDU_RP_ERROR_SGSN_MS");
    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, "sMS_SUBMIT_REPORT")) {
      sMS__SUBMIT__REPORT().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TPDU__RP__ERROR__SGSN__MS_template* precondition = new TPDU__RP__ERROR__SGSN__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    TPDU__RP__ERROR__SGSN__MS_template* implied_template = new TPDU__RP__ERROR__SGSN__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TPDU__RP__ERROR__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void TPDU__RP__ERROR__SGSN__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case TPDU__RP__ERROR__SGSN__MS::ALT_sMS__SUBMIT__REPORT:
single_value.field_sMS__SUBMIT__REPORT->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS.");
}
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_SMS_Types.TPDU_RP_ERROR_SGSN_MS");
}

SMS__SUBMIT__REPORT__in__RP__ERROR::SMS__SUBMIT__REPORT__in__RP__ERROR()
{
}

SMS__SUBMIT__REPORT__in__RP__ERROR::SMS__SUBMIT__REPORT__in__RP__ERROR(const BITSTRING& par_tP__MTI,
    const BITSTRING& par_tP__Spare1,
    const BITSTRING& par_tP__UDHI,
    const BITSTRING& par_tP__Spare2,
    const OCTETSTRING& par_tP__FCS,
    const BITSTRING& par_tP__PresenceBitTP__PID,
    const BITSTRING& par_tP__PresenceBitTP__DCS,
    const BITSTRING& par_tP__PresenceBitTP__UDL,
    const BITSTRING& par_tP__Reserved,
    const BITSTRING& par_tP__ExtensionBit,
    const OCTETSTRING& par_tP__SCTS,
    const OPTIONAL< OCTETSTRING >& par_tP__PID,
    const OPTIONAL< OCTETSTRING >& par_tP__DCS,
    const OPTIONAL< TP__UDL__UD >& par_tP__UDL__UD)
  :   field_tP__MTI(par_tP__MTI),
  field_tP__Spare1(par_tP__Spare1),
  field_tP__UDHI(par_tP__UDHI),
  field_tP__Spare2(par_tP__Spare2),
  field_tP__FCS(par_tP__FCS),
  field_tP__PresenceBitTP__PID(par_tP__PresenceBitTP__PID),
  field_tP__PresenceBitTP__DCS(par_tP__PresenceBitTP__DCS),
  field_tP__PresenceBitTP__UDL(par_tP__PresenceBitTP__UDL),
  field_tP__Reserved(par_tP__Reserved),
  field_tP__ExtensionBit(par_tP__ExtensionBit),
  field_tP__SCTS(par_tP__SCTS),
  field_tP__PID(par_tP__PID),
  field_tP__DCS(par_tP__DCS),
  field_tP__UDL__UD(par_tP__UDL__UD)
{
}

SMS__SUBMIT__REPORT__in__RP__ERROR::SMS__SUBMIT__REPORT__in__RP__ERROR(const SMS__SUBMIT__REPORT__in__RP__ERROR& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
else field_tP__MTI.clean_up();
if (other_value.tP__Spare1().is_bound()) field_tP__Spare1 = other_value.tP__Spare1();
else field_tP__Spare1.clean_up();
if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
else field_tP__UDHI.clean_up();
if (other_value.tP__Spare2().is_bound()) field_tP__Spare2 = other_value.tP__Spare2();
else field_tP__Spare2.clean_up();
if (other_value.tP__FCS().is_bound()) field_tP__FCS = other_value.tP__FCS();
else field_tP__FCS.clean_up();
if (other_value.tP__PresenceBitTP__PID().is_bound()) field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
else field_tP__PresenceBitTP__PID.clean_up();
if (other_value.tP__PresenceBitTP__DCS().is_bound()) field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
else field_tP__PresenceBitTP__DCS.clean_up();
if (other_value.tP__PresenceBitTP__UDL().is_bound()) field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
else field_tP__PresenceBitTP__UDL.clean_up();
if (other_value.tP__Reserved().is_bound()) field_tP__Reserved = other_value.tP__Reserved();
else field_tP__Reserved.clean_up();
if (other_value.tP__ExtensionBit().is_bound()) field_tP__ExtensionBit = other_value.tP__ExtensionBit();
else field_tP__ExtensionBit.clean_up();
if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
else field_tP__SCTS.clean_up();
if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
else field_tP__PID.clean_up();
if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
else field_tP__DCS.clean_up();
if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
else field_tP__UDL__UD.clean_up();
}

void SMS__SUBMIT__REPORT__in__RP__ERROR::clean_up()
{
field_tP__MTI.clean_up();
field_tP__Spare1.clean_up();
field_tP__UDHI.clean_up();
field_tP__Spare2.clean_up();
field_tP__FCS.clean_up();
field_tP__PresenceBitTP__PID.clean_up();
field_tP__PresenceBitTP__DCS.clean_up();
field_tP__PresenceBitTP__UDL.clean_up();
field_tP__Reserved.clean_up();
field_tP__ExtensionBit.clean_up();
field_tP__SCTS.clean_up();
field_tP__PID.clean_up();
field_tP__DCS.clean_up();
field_tP__UDL__UD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__SUBMIT__REPORT__in__RP__ERROR::get_descriptor() const { return &SMS__SUBMIT__REPORT__in__RP__ERROR_descr_; }
SMS__SUBMIT__REPORT__in__RP__ERROR& SMS__SUBMIT__REPORT__in__RP__ERROR::operator=(const SMS__SUBMIT__REPORT__in__RP__ERROR& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
  if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
  else field_tP__MTI.clean_up();
  if (other_value.tP__Spare1().is_bound()) field_tP__Spare1 = other_value.tP__Spare1();
  else field_tP__Spare1.clean_up();
  if (other_value.tP__UDHI().is_bound()) field_tP__UDHI = other_value.tP__UDHI();
  else field_tP__UDHI.clean_up();
  if (other_value.tP__Spare2().is_bound()) field_tP__Spare2 = other_value.tP__Spare2();
  else field_tP__Spare2.clean_up();
  if (other_value.tP__FCS().is_bound()) field_tP__FCS = other_value.tP__FCS();
  else field_tP__FCS.clean_up();
  if (other_value.tP__PresenceBitTP__PID().is_bound()) field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
  else field_tP__PresenceBitTP__PID.clean_up();
  if (other_value.tP__PresenceBitTP__DCS().is_bound()) field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
  else field_tP__PresenceBitTP__DCS.clean_up();
  if (other_value.tP__PresenceBitTP__UDL().is_bound()) field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
  else field_tP__PresenceBitTP__UDL.clean_up();
  if (other_value.tP__Reserved().is_bound()) field_tP__Reserved = other_value.tP__Reserved();
  else field_tP__Reserved.clean_up();
  if (other_value.tP__ExtensionBit().is_bound()) field_tP__ExtensionBit = other_value.tP__ExtensionBit();
  else field_tP__ExtensionBit.clean_up();
  if (other_value.tP__SCTS().is_bound()) field_tP__SCTS = other_value.tP__SCTS();
  else field_tP__SCTS.clean_up();
  if (other_value.tP__PID().is_bound()) field_tP__PID = other_value.tP__PID();
  else field_tP__PID.clean_up();
  if (other_value.tP__DCS().is_bound()) field_tP__DCS = other_value.tP__DCS();
  else field_tP__DCS.clean_up();
  if (other_value.tP__UDL__UD().is_bound()) field_tP__UDL__UD = other_value.tP__UDL__UD();
  else field_tP__UDL__UD.clean_up();
}
return *this;
}

boolean SMS__SUBMIT__REPORT__in__RP__ERROR::operator==(const SMS__SUBMIT__REPORT__in__RP__ERROR& other_value) const
{
return field_tP__MTI==other_value.field_tP__MTI
  && field_tP__Spare1==other_value.field_tP__Spare1
  && field_tP__UDHI==other_value.field_tP__UDHI
  && field_tP__Spare2==other_value.field_tP__Spare2
  && field_tP__FCS==other_value.field_tP__FCS
  && field_tP__PresenceBitTP__PID==other_value.field_tP__PresenceBitTP__PID
  && field_tP__PresenceBitTP__DCS==other_value.field_tP__PresenceBitTP__DCS
  && field_tP__PresenceBitTP__UDL==other_value.field_tP__PresenceBitTP__UDL
  && field_tP__Reserved==other_value.field_tP__Reserved
  && field_tP__ExtensionBit==other_value.field_tP__ExtensionBit
  && field_tP__SCTS==other_value.field_tP__SCTS
  && field_tP__PID==other_value.field_tP__PID
  && field_tP__DCS==other_value.field_tP__DCS
  && field_tP__UDL__UD==other_value.field_tP__UDL__UD;
}

boolean SMS__SUBMIT__REPORT__in__RP__ERROR::is_bound() const
{
return (field_tP__MTI.is_bound())
  || (field_tP__Spare1.is_bound())
  || (field_tP__UDHI.is_bound())
  || (field_tP__Spare2.is_bound())
  || (field_tP__FCS.is_bound())
  || (field_tP__PresenceBitTP__PID.is_bound())
  || (field_tP__PresenceBitTP__DCS.is_bound())
  || (field_tP__PresenceBitTP__UDL.is_bound())
  || (field_tP__Reserved.is_bound())
  || (field_tP__ExtensionBit.is_bound())
  || (field_tP__SCTS.is_bound())
  || (OPTIONAL_OMIT == field_tP__PID.get_selection() || field_tP__PID.is_bound())
  || (OPTIONAL_OMIT == field_tP__DCS.get_selection() || field_tP__DCS.is_bound())
  || (OPTIONAL_OMIT == field_tP__UDL__UD.get_selection() || field_tP__UDL__UD.is_bound());
}
boolean SMS__SUBMIT__REPORT__in__RP__ERROR::is_value() const
{
return field_tP__MTI.is_value()
  && field_tP__Spare1.is_value()
  && field_tP__UDHI.is_value()
  && field_tP__Spare2.is_value()
  && field_tP__FCS.is_value()
  && field_tP__PresenceBitTP__PID.is_value()
  && field_tP__PresenceBitTP__DCS.is_value()
  && field_tP__PresenceBitTP__UDL.is_value()
  && field_tP__Reserved.is_value()
  && field_tP__ExtensionBit.is_value()
  && field_tP__SCTS.is_value()
  && (OPTIONAL_OMIT == field_tP__PID.get_selection() || field_tP__PID.is_value())
  && (OPTIONAL_OMIT == field_tP__DCS.get_selection() || field_tP__DCS.is_value())
  && (OPTIONAL_OMIT == field_tP__UDL__UD.get_selection() || field_tP__UDL__UD.is_value());
}
int SMS__SUBMIT__REPORT__in__RP__ERROR::size_of() const
{
  int ret_val = 11;
  if (field_tP__PID.ispresent()) ret_val++;
  if (field_tP__DCS.ispresent()) ret_val++;
  if (field_tP__UDL__UD.ispresent()) ret_val++;
  return ret_val;
}

void SMS__SUBMIT__REPORT__in__RP__ERROR::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_MTI := ");
field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_Spare1 := ");
field_tP__Spare1.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_Spare2 := ");
field_tP__Spare2.log();
TTCN_Logger::log_event_str(", tP_FCS := ");
field_tP__FCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
field_tP__PresenceBitTP__PID.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
field_tP__PresenceBitTP__DCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
field_tP__PresenceBitTP__UDL.log();
TTCN_Logger::log_event_str(", tP_Reserved := ");
field_tP__Reserved.log();
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
field_tP__ExtensionBit.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_PID := ");
field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
field_tP__UDL__UD.log();
TTCN_Logger::log_event_str(" }");
}

void SMS__SUBMIT__REPORT__in__RP__ERROR::set_implicit_omit()
{
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__Spare1().is_bound()) tP__Spare1().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__Spare2().is_bound()) tP__Spare2().set_implicit_omit();
if (tP__FCS().is_bound()) tP__FCS().set_implicit_omit();
if (tP__PresenceBitTP__PID().is_bound()) tP__PresenceBitTP__PID().set_implicit_omit();
if (tP__PresenceBitTP__DCS().is_bound()) tP__PresenceBitTP__DCS().set_implicit_omit();
if (tP__PresenceBitTP__UDL().is_bound()) tP__PresenceBitTP__UDL().set_implicit_omit();
if (tP__Reserved().is_bound()) tP__Reserved().set_implicit_omit();
if (tP__ExtensionBit().is_bound()) tP__ExtensionBit().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (!tP__PID().is_bound()) tP__PID() = OMIT_VALUE;
else tP__PID().set_implicit_omit();
if (!tP__DCS().is_bound()) tP__DCS() = OMIT_VALUE;
else tP__DCS().set_implicit_omit();
if (!tP__UDL__UD().is_bound()) tP__UDL__UD() = OMIT_VALUE;
else tP__UDL__UD().set_implicit_omit();
}

void SMS__SUBMIT__REPORT__in__RP__ERROR::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 (14<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR has 14 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__Spare1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__FCS().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__PID().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__DCS().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__UDL().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__Reserved().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__ExtensionBit().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(13));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_FCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__FCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_UDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__UDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__Reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ExtensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ExtensionBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
  }
}

void SMS__SUBMIT__REPORT__in__RP__ERROR::encode_text(Text_Buf& text_buf) const
{
field_tP__MTI.encode_text(text_buf);
field_tP__Spare1.encode_text(text_buf);
field_tP__UDHI.encode_text(text_buf);
field_tP__Spare2.encode_text(text_buf);
field_tP__FCS.encode_text(text_buf);
field_tP__PresenceBitTP__PID.encode_text(text_buf);
field_tP__PresenceBitTP__DCS.encode_text(text_buf);
field_tP__PresenceBitTP__UDL.encode_text(text_buf);
field_tP__Reserved.encode_text(text_buf);
field_tP__ExtensionBit.encode_text(text_buf);
field_tP__SCTS.encode_text(text_buf);
field_tP__PID.encode_text(text_buf);
field_tP__DCS.encode_text(text_buf);
field_tP__UDL__UD.encode_text(text_buf);
}

void SMS__SUBMIT__REPORT__in__RP__ERROR::decode_text(Text_Buf& text_buf)
{
field_tP__MTI.decode_text(text_buf);
field_tP__Spare1.decode_text(text_buf);
field_tP__UDHI.decode_text(text_buf);
field_tP__Spare2.decode_text(text_buf);
field_tP__FCS.decode_text(text_buf);
field_tP__PresenceBitTP__PID.decode_text(text_buf);
field_tP__PresenceBitTP__DCS.decode_text(text_buf);
field_tP__PresenceBitTP__UDL.decode_text(text_buf);
field_tP__Reserved.decode_text(text_buf);
field_tP__ExtensionBit.decode_text(text_buf);
field_tP__SCTS.decode_text(text_buf);
field_tP__PID.decode_text(text_buf);
field_tP__DCS.decode_text(text_buf);
field_tP__UDL__UD.decode_text(text_buf);
}

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

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

int SMS__SUBMIT__REPORT__in__RP__ERROR::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_tP__MTI.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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_tP__Spare1.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_tP__UDHI.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_tP__Spare2.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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__FCS.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__PresenceBitTP__PID.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_tP__PresenceBitTP__DCS.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_tP__PresenceBitTP__UDL.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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_tP__Reserved.RAW_decode(General__Types::BIT4_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_tP__ExtensionBit.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::OCT7_descr_.raw->forceomit);
  decoded_field_length = field_tP__SCTS.RAW_decode(General__Types::OCT7_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());
  if (limit > 0 && field_tP__PresenceBitTP__PID ==  bs_4){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_tP__PID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_descr_.raw->forceomit);
  decoded_field_length = field_tP__PID().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_tP__PID = 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_tP__PID=OMIT_VALUE;
  if (limit > 0 && field_tP__PresenceBitTP__DCS ==  bs_4){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_tP__DCS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_descr_.raw->forceomit);
  decoded_field_length = field_tP__DCS().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_tP__DCS = 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_tP__DCS=OMIT_VALUE;
  if (limit > 0 && field_tP__PresenceBitTP__UDL ==  bs_4){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_tP__UDL__UD = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_descr_.raw->forceomit);
  decoded_field_length = field_tP__UDL__UD().RAW_decode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_tP__UDL__UD = 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_tP__UDL__UD=OMIT_VALUE;
  if (field_tP__MTI !=  bs_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 SMS__SUBMIT__REPORT__in__RP__ERROR::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 = 14;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(14);
  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::BIT4_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::OCT1_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::BIT4_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::OCT7_descr_.raw);
  if (field_tP__PID.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_tP__DCS.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_tP__UDL__UD.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  encoded_length += field_tP__MTI.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tP__Spare1.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__UDHI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tP__Spare2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__FCS.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_tP__PresenceBitTP__PID.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tP__PresenceBitTP__DCS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_tP__PresenceBitTP__UDL.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_tP__Reserved.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_tP__ExtensionBit.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_tP__SCTS.RAW_encode(General__Types::OCT7_descr_, *myleaf.body.node.nodes[10]);
  if (field_tP__PID.ispresent()) {
  encoded_length += field_tP__PID().RAW_encode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_tP__DCS.ispresent()) {
  encoded_length += field_tP__DCS().RAW_encode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_tP__UDL__UD.ispresent()) {
  encoded_length += field_tP__UDL__UD().RAW_encode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_tP__PID.ispresent() && (field_tP__PresenceBitTP__PID !=  bs_4)) {
  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_4.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_tP__DCS.ispresent() && (field_tP__PresenceBitTP__DCS !=  bs_4)) {
  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_4.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_tP__UDL__UD.ispresent() && (field_tP__PresenceBitTP__UDL !=  bs_4)) {
  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_4.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_tP__MTI !=  bs_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){
   bs_0.RAW_encode(General__Types::BIT2_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 SMS__SUBMIT__REPORT__in__RP__ERROR_template::single_value_struct {
BITSTRING_template field_tP__MTI;
BITSTRING_template field_tP__Spare1;
BITSTRING_template field_tP__UDHI;
BITSTRING_template field_tP__Spare2;
OCTETSTRING_template field_tP__FCS;
BITSTRING_template field_tP__PresenceBitTP__PID;
BITSTRING_template field_tP__PresenceBitTP__DCS;
BITSTRING_template field_tP__PresenceBitTP__UDL;
BITSTRING_template field_tP__Reserved;
BITSTRING_template field_tP__ExtensionBit;
OCTETSTRING_template field_tP__SCTS;
OCTETSTRING_template field_tP__PID;
OCTETSTRING_template field_tP__DCS;
TP__UDL__UD_template field_tP__UDL__UD;
};

void SMS__SUBMIT__REPORT__in__RP__ERROR_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_tP__MTI = ANY_VALUE;
single_value->field_tP__Spare1 = ANY_VALUE;
single_value->field_tP__UDHI = ANY_VALUE;
single_value->field_tP__Spare2 = ANY_VALUE;
single_value->field_tP__FCS = ANY_VALUE;
single_value->field_tP__PresenceBitTP__PID = ANY_VALUE;
single_value->field_tP__PresenceBitTP__DCS = ANY_VALUE;
single_value->field_tP__PresenceBitTP__UDL = ANY_VALUE;
single_value->field_tP__Reserved = ANY_VALUE;
single_value->field_tP__ExtensionBit = ANY_VALUE;
single_value->field_tP__SCTS = ANY_VALUE;
single_value->field_tP__PID = ANY_OR_OMIT;
single_value->field_tP__DCS = ANY_OR_OMIT;
single_value->field_tP__UDL__UD = ANY_OR_OMIT;
}
}
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_template::copy_value(const SMS__SUBMIT__REPORT__in__RP__ERROR& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__MTI().is_bound()) {
  single_value->field_tP__MTI = other_value.tP__MTI();
} else {
  single_value->field_tP__MTI.clean_up();
}
if (other_value.tP__Spare1().is_bound()) {
  single_value->field_tP__Spare1 = other_value.tP__Spare1();
} else {
  single_value->field_tP__Spare1.clean_up();
}
if (other_value.tP__UDHI().is_bound()) {
  single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
  single_value->field_tP__UDHI.clean_up();
}
if (other_value.tP__Spare2().is_bound()) {
  single_value->field_tP__Spare2 = other_value.tP__Spare2();
} else {
  single_value->field_tP__Spare2.clean_up();
}
if (other_value.tP__FCS().is_bound()) {
  single_value->field_tP__FCS = other_value.tP__FCS();
} else {
  single_value->field_tP__FCS.clean_up();
}
if (other_value.tP__PresenceBitTP__PID().is_bound()) {
  single_value->field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
} else {
  single_value->field_tP__PresenceBitTP__PID.clean_up();
}
if (other_value.tP__PresenceBitTP__DCS().is_bound()) {
  single_value->field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
} else {
  single_value->field_tP__PresenceBitTP__DCS.clean_up();
}
if (other_value.tP__PresenceBitTP__UDL().is_bound()) {
  single_value->field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
} else {
  single_value->field_tP__PresenceBitTP__UDL.clean_up();
}
if (other_value.tP__Reserved().is_bound()) {
  single_value->field_tP__Reserved = other_value.tP__Reserved();
} else {
  single_value->field_tP__Reserved.clean_up();
}
if (other_value.tP__ExtensionBit().is_bound()) {
  single_value->field_tP__ExtensionBit = other_value.tP__ExtensionBit();
} else {
  single_value->field_tP__ExtensionBit.clean_up();
}
if (other_value.tP__SCTS().is_bound()) {
  single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
  single_value->field_tP__SCTS.clean_up();
}
if (other_value.tP__PID().is_bound()) {
  if (other_value.tP__PID().ispresent()) single_value->field_tP__PID = other_value.tP__PID()();
  else single_value->field_tP__PID = OMIT_VALUE;
} else {
  single_value->field_tP__PID.clean_up();
}
if (other_value.tP__DCS().is_bound()) {
  if (other_value.tP__DCS().ispresent()) single_value->field_tP__DCS = other_value.tP__DCS()();
  else single_value->field_tP__DCS = OMIT_VALUE;
} else {
  single_value->field_tP__DCS.clean_up();
}
if (other_value.tP__UDL__UD().is_bound()) {
  if (other_value.tP__UDL__UD().ispresent()) single_value->field_tP__UDL__UD = other_value.tP__UDL__UD()();
  else single_value->field_tP__UDL__UD = OMIT_VALUE;
} else {
  single_value->field_tP__UDL__UD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_template::copy_template(const SMS__SUBMIT__REPORT__in__RP__ERROR_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__MTI().get_selection()) {
single_value->field_tP__MTI = other_value.tP__MTI();
} else {
single_value->field_tP__MTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Spare1().get_selection()) {
single_value->field_tP__Spare1 = other_value.tP__Spare1();
} else {
single_value->field_tP__Spare1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDHI().get_selection()) {
single_value->field_tP__UDHI = other_value.tP__UDHI();
} else {
single_value->field_tP__UDHI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Spare2().get_selection()) {
single_value->field_tP__Spare2 = other_value.tP__Spare2();
} else {
single_value->field_tP__Spare2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__FCS().get_selection()) {
single_value->field_tP__FCS = other_value.tP__FCS();
} else {
single_value->field_tP__FCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__PID().get_selection()) {
single_value->field_tP__PresenceBitTP__PID = other_value.tP__PresenceBitTP__PID();
} else {
single_value->field_tP__PresenceBitTP__PID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__DCS().get_selection()) {
single_value->field_tP__PresenceBitTP__DCS = other_value.tP__PresenceBitTP__DCS();
} else {
single_value->field_tP__PresenceBitTP__DCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PresenceBitTP__UDL().get_selection()) {
single_value->field_tP__PresenceBitTP__UDL = other_value.tP__PresenceBitTP__UDL();
} else {
single_value->field_tP__PresenceBitTP__UDL.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__Reserved().get_selection()) {
single_value->field_tP__Reserved = other_value.tP__Reserved();
} else {
single_value->field_tP__Reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__ExtensionBit().get_selection()) {
single_value->field_tP__ExtensionBit = other_value.tP__ExtensionBit();
} else {
single_value->field_tP__ExtensionBit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__SCTS().get_selection()) {
single_value->field_tP__SCTS = other_value.tP__SCTS();
} else {
single_value->field_tP__SCTS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__PID().get_selection()) {
single_value->field_tP__PID = other_value.tP__PID();
} else {
single_value->field_tP__PID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__DCS().get_selection()) {
single_value->field_tP__DCS = other_value.tP__DCS();
} else {
single_value->field_tP__DCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__UDL__UD().get_selection()) {
single_value->field_tP__UDL__UD = other_value.tP__UDL__UD();
} else {
single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ERROR_template[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 SMS__SUBMIT__REPORT__in__RP__ERROR_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__SUBMIT__REPORT__in__RP__ERROR_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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
break;
}
set_selection(other_value);
}

SMS__SUBMIT__REPORT__in__RP__ERROR_template::SMS__SUBMIT__REPORT__in__RP__ERROR_template()
{
}

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

SMS__SUBMIT__REPORT__in__RP__ERROR_template::SMS__SUBMIT__REPORT__in__RP__ERROR_template(const SMS__SUBMIT__REPORT__in__RP__ERROR& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMS__SUBMIT__REPORT__in__RP__ERROR_template::match(const SMS__SUBMIT__REPORT__in__RP__ERROR& 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.tP__MTI().is_bound()) return FALSE;
if(!single_value->field_tP__MTI.match(other_value.tP__MTI(), legacy))return FALSE;
if(!other_value.tP__Spare1().is_bound()) return FALSE;
if(!single_value->field_tP__Spare1.match(other_value.tP__Spare1(), legacy))return FALSE;
if(!other_value.tP__UDHI().is_bound()) return FALSE;
if(!single_value->field_tP__UDHI.match(other_value.tP__UDHI(), legacy))return FALSE;
if(!other_value.tP__Spare2().is_bound()) return FALSE;
if(!single_value->field_tP__Spare2.match(other_value.tP__Spare2(), legacy))return FALSE;
if(!other_value.tP__FCS().is_bound()) return FALSE;
if(!single_value->field_tP__FCS.match(other_value.tP__FCS(), legacy))return FALSE;
if(!other_value.tP__PresenceBitTP__PID().is_bound()) return FALSE;
if(!single_value->field_tP__PresenceBitTP__PID.match(other_value.tP__PresenceBitTP__PID(), legacy))return FALSE;
if(!other_value.tP__PresenceBitTP__DCS().is_bound()) return FALSE;
if(!single_value->field_tP__PresenceBitTP__DCS.match(other_value.tP__PresenceBitTP__DCS(), legacy))return FALSE;
if(!other_value.tP__PresenceBitTP__UDL().is_bound()) return FALSE;
if(!single_value->field_tP__PresenceBitTP__UDL.match(other_value.tP__PresenceBitTP__UDL(), legacy))return FALSE;
if(!other_value.tP__Reserved().is_bound()) return FALSE;
if(!single_value->field_tP__Reserved.match(other_value.tP__Reserved(), legacy))return FALSE;
if(!other_value.tP__ExtensionBit().is_bound()) return FALSE;
if(!single_value->field_tP__ExtensionBit.match(other_value.tP__ExtensionBit(), legacy))return FALSE;
if(!other_value.tP__SCTS().is_bound()) return FALSE;
if(!single_value->field_tP__SCTS.match(other_value.tP__SCTS(), legacy))return FALSE;
if(!other_value.tP__PID().is_bound()) return FALSE;
if((other_value.tP__PID().ispresent() ? !single_value->field_tP__PID.match((const OCTETSTRING&)other_value.tP__PID(), legacy) : !single_value->field_tP__PID.match_omit(legacy)))return FALSE;
if(!other_value.tP__DCS().is_bound()) return FALSE;
if((other_value.tP__DCS().ispresent() ? !single_value->field_tP__DCS.match((const OCTETSTRING&)other_value.tP__DCS(), legacy) : !single_value->field_tP__DCS.match_omit(legacy)))return FALSE;
if(!other_value.tP__UDL__UD().is_bound()) return FALSE;
if((other_value.tP__UDL__UD().ispresent() ? !single_value->field_tP__UDL__UD.match((const TP__UDL__UD&)other_value.tP__UDL__UD(), legacy) : !single_value->field_tP__UDL__UD.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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
}
return FALSE;
}

boolean SMS__SUBMIT__REPORT__in__RP__ERROR_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tP__MTI.is_bound()
 || single_value->field_tP__Spare1.is_bound()
 || single_value->field_tP__UDHI.is_bound()
 || single_value->field_tP__Spare2.is_bound()
 || single_value->field_tP__FCS.is_bound()
 || single_value->field_tP__PresenceBitTP__PID.is_bound()
 || single_value->field_tP__PresenceBitTP__DCS.is_bound()
 || single_value->field_tP__PresenceBitTP__UDL.is_bound()
 || single_value->field_tP__Reserved.is_bound()
 || single_value->field_tP__ExtensionBit.is_bound()
 || single_value->field_tP__SCTS.is_bound()
 || (single_value->field_tP__PID.is_omit() || single_value->field_tP__PID.is_bound())
 || (single_value->field_tP__DCS.is_omit() || single_value->field_tP__DCS.is_bound())
 || (single_value->field_tP__UDL__UD.is_omit() || single_value->field_tP__UDL__UD.is_bound());
}

boolean SMS__SUBMIT__REPORT__in__RP__ERROR_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__MTI.is_value()
 && single_value->field_tP__Spare1.is_value()
 && single_value->field_tP__UDHI.is_value()
 && single_value->field_tP__Spare2.is_value()
 && single_value->field_tP__FCS.is_value()
 && single_value->field_tP__PresenceBitTP__PID.is_value()
 && single_value->field_tP__PresenceBitTP__DCS.is_value()
 && single_value->field_tP__PresenceBitTP__UDL.is_value()
 && single_value->field_tP__Reserved.is_value()
 && single_value->field_tP__ExtensionBit.is_value()
 && single_value->field_tP__SCTS.is_value()
 && (single_value->field_tP__PID.is_omit() || single_value->field_tP__PID.is_value())
 && (single_value->field_tP__DCS.is_omit() || single_value->field_tP__DCS.is_value())
 && (single_value->field_tP__UDL__UD.is_omit() || single_value->field_tP__UDL__UD.is_value());
}

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

SMS__SUBMIT__REPORT__in__RP__ERROR SMS__SUBMIT__REPORT__in__RP__ERROR_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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
SMS__SUBMIT__REPORT__in__RP__ERROR ret_val;
if (single_value->field_tP__MTI.is_bound()) {
ret_val.tP__MTI() = single_value->field_tP__MTI.valueof();
}
if (single_value->field_tP__Spare1.is_bound()) {
ret_val.tP__Spare1() = single_value->field_tP__Spare1.valueof();
}
if (single_value->field_tP__UDHI.is_bound()) {
ret_val.tP__UDHI() = single_value->field_tP__UDHI.valueof();
}
if (single_value->field_tP__Spare2.is_bound()) {
ret_val.tP__Spare2() = single_value->field_tP__Spare2.valueof();
}
if (single_value->field_tP__FCS.is_bound()) {
ret_val.tP__FCS() = single_value->field_tP__FCS.valueof();
}
if (single_value->field_tP__PresenceBitTP__PID.is_bound()) {
ret_val.tP__PresenceBitTP__PID() = single_value->field_tP__PresenceBitTP__PID.valueof();
}
if (single_value->field_tP__PresenceBitTP__DCS.is_bound()) {
ret_val.tP__PresenceBitTP__DCS() = single_value->field_tP__PresenceBitTP__DCS.valueof();
}
if (single_value->field_tP__PresenceBitTP__UDL.is_bound()) {
ret_val.tP__PresenceBitTP__UDL() = single_value->field_tP__PresenceBitTP__UDL.valueof();
}
if (single_value->field_tP__Reserved.is_bound()) {
ret_val.tP__Reserved() = single_value->field_tP__Reserved.valueof();
}
if (single_value->field_tP__ExtensionBit.is_bound()) {
ret_val.tP__ExtensionBit() = single_value->field_tP__ExtensionBit.valueof();
}
if (single_value->field_tP__SCTS.is_bound()) {
ret_val.tP__SCTS() = single_value->field_tP__SCTS.valueof();
}
if (single_value->field_tP__PID.is_omit()) ret_val.tP__PID() = OMIT_VALUE;
else if (single_value->field_tP__PID.is_bound()) {
ret_val.tP__PID() = single_value->field_tP__PID.valueof();
}
if (single_value->field_tP__DCS.is_omit()) ret_val.tP__DCS() = OMIT_VALUE;
else if (single_value->field_tP__DCS.is_bound()) {
ret_val.tP__DCS() = single_value->field_tP__DCS.valueof();
}
if (single_value->field_tP__UDL__UD.is_omit()) ret_val.tP__UDL__UD() = OMIT_VALUE;
else if (single_value->field_tP__UDL__UD.is_bound()) {
ret_val.tP__UDL__UD() = single_value->field_tP__UDL__UD.valueof();
}
return ret_val;
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SMS__SUBMIT__REPORT__in__RP__ERROR_template[list_length];
}

SMS__SUBMIT__REPORT__in__RP__ERROR_template& SMS__SUBMIT__REPORT__in__RP__ERROR_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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return value_list.list_value[list_index];
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__MTI()
{
set_specific();
return single_value->field_tP__MTI;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__MTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MTI of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__MTI;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__Spare1()
{
set_specific();
return single_value->field_tP__Spare1;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__Spare1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Spare1 of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__Spare1;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__UDHI()
{
set_specific();
return single_value->field_tP__UDHI;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__UDHI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDHI of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__UDHI;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__Spare2()
{
set_specific();
return single_value->field_tP__Spare2;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__Spare2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Spare2 of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__Spare2;
}

OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__FCS()
{
set_specific();
return single_value->field_tP__FCS;
}

const OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__FCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_FCS of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__FCS;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PresenceBitTP__PID()
{
set_specific();
return single_value->field_tP__PresenceBitTP__PID;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PresenceBitTP__PID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_PID of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__PresenceBitTP__PID;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PresenceBitTP__DCS()
{
set_specific();
return single_value->field_tP__PresenceBitTP__DCS;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PresenceBitTP__DCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_DCS of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__PresenceBitTP__DCS;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PresenceBitTP__UDL()
{
set_specific();
return single_value->field_tP__PresenceBitTP__UDL;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PresenceBitTP__UDL() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PresenceBitTP_UDL of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__PresenceBitTP__UDL;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__Reserved()
{
set_specific();
return single_value->field_tP__Reserved;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__Reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_Reserved of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__Reserved;
}

BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__ExtensionBit()
{
set_specific();
return single_value->field_tP__ExtensionBit;
}

const BITSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__ExtensionBit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_ExtensionBit of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__ExtensionBit;
}

OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__SCTS()
{
set_specific();
return single_value->field_tP__SCTS;
}

const OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__SCTS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SCTS of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__SCTS;
}

OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PID()
{
set_specific();
return single_value->field_tP__PID;
}

const OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__PID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_PID of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__PID;
}

OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__DCS()
{
set_specific();
return single_value->field_tP__DCS;
}

const OCTETSTRING_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__DCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DCS of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__DCS;
}

TP__UDL__UD_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__UDL__UD()
{
set_specific();
return single_value->field_tP__UDL__UD;
}

const TP__UDL__UD_template& SMS__SUBMIT__REPORT__in__RP__ERROR_template::tP__UDL__UD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UDL_UD of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
return single_value->field_tP__UDL__UD;
}

int SMS__SUBMIT__REPORT__in__RP__ERROR_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 11;
      if (single_value->field_tP__PID.is_present()) ret_val++;
      if (single_value->field_tP__DCS.is_present()) ret_val++;
      if (single_value->field_tP__UDL__UD.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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR 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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
  }
  return 0;
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_MTI := ");
single_value->field_tP__MTI.log();
TTCN_Logger::log_event_str(", tP_Spare1 := ");
single_value->field_tP__Spare1.log();
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log();
TTCN_Logger::log_event_str(", tP_Spare2 := ");
single_value->field_tP__Spare2.log();
TTCN_Logger::log_event_str(", tP_FCS := ");
single_value->field_tP__FCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
single_value->field_tP__PresenceBitTP__PID.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
single_value->field_tP__PresenceBitTP__DCS.log();
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
single_value->field_tP__PresenceBitTP__UDL.log();
TTCN_Logger::log_event_str(", tP_Reserved := ");
single_value->field_tP__Reserved.log();
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
single_value->field_tP__ExtensionBit.log();
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log();
TTCN_Logger::log_event_str(", tP_PID := ");
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_DCS := ");
single_value->field_tP__DCS.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ERROR_template::log_match(const SMS__SUBMIT__REPORT__in__RP__ERROR& 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_tP__MTI.match(match_value.tP__MTI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MTI");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Spare1.match(match_value.tP__Spare1(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Spare1");
single_value->field_tP__Spare1.log_match(match_value.tP__Spare1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__UDHI.match(match_value.tP__UDHI(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDHI");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Spare2.match(match_value.tP__Spare2(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Spare2");
single_value->field_tP__Spare2.log_match(match_value.tP__Spare2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__FCS.match(match_value.tP__FCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_FCS");
single_value->field_tP__FCS.log_match(match_value.tP__FCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__PresenceBitTP__PID.match(match_value.tP__PresenceBitTP__PID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_PID");
single_value->field_tP__PresenceBitTP__PID.log_match(match_value.tP__PresenceBitTP__PID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__PresenceBitTP__DCS.match(match_value.tP__PresenceBitTP__DCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_DCS");
single_value->field_tP__PresenceBitTP__DCS.log_match(match_value.tP__PresenceBitTP__DCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__PresenceBitTP__UDL.match(match_value.tP__PresenceBitTP__UDL(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PresenceBitTP_UDL");
single_value->field_tP__PresenceBitTP__UDL.log_match(match_value.tP__PresenceBitTP__UDL(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__Reserved.match(match_value.tP__Reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_Reserved");
single_value->field_tP__Reserved.log_match(match_value.tP__Reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__ExtensionBit.match(match_value.tP__ExtensionBit(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_ExtensionBit");
single_value->field_tP__ExtensionBit.log_match(match_value.tP__ExtensionBit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__SCTS.match(match_value.tP__SCTS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SCTS");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tP__PID().ispresent()){
if(!single_value->field_tP__PID.match(match_value.tP__PID(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_PID");
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__PID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_PID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__DCS().ispresent()){
if(!single_value->field_tP__DCS.match(match_value.tP__DCS(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DCS");
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__DCS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_DCS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__DCS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tP__UDL__UD().ispresent()){
if(!single_value->field_tP__UDL__UD.match(match_value.tP__UDL__UD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UDL_UD");
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__UDL__UD.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_UDL_UD := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__UDL__UD.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("{ tP_MTI := ");
single_value->field_tP__MTI.log_match(match_value.tP__MTI(), legacy);
TTCN_Logger::log_event_str(", tP_Spare1 := ");
single_value->field_tP__Spare1.log_match(match_value.tP__Spare1(), legacy);
TTCN_Logger::log_event_str(", tP_UDHI := ");
single_value->field_tP__UDHI.log_match(match_value.tP__UDHI(), legacy);
TTCN_Logger::log_event_str(", tP_Spare2 := ");
single_value->field_tP__Spare2.log_match(match_value.tP__Spare2(), legacy);
TTCN_Logger::log_event_str(", tP_FCS := ");
single_value->field_tP__FCS.log_match(match_value.tP__FCS(), legacy);
TTCN_Logger::log_event_str(", tP_PresenceBitTP_PID := ");
single_value->field_tP__PresenceBitTP__PID.log_match(match_value.tP__PresenceBitTP__PID(), legacy);
TTCN_Logger::log_event_str(", tP_PresenceBitTP_DCS := ");
single_value->field_tP__PresenceBitTP__DCS.log_match(match_value.tP__PresenceBitTP__DCS(), legacy);
TTCN_Logger::log_event_str(", tP_PresenceBitTP_UDL := ");
single_value->field_tP__PresenceBitTP__UDL.log_match(match_value.tP__PresenceBitTP__UDL(), legacy);
TTCN_Logger::log_event_str(", tP_Reserved := ");
single_value->field_tP__Reserved.log_match(match_value.tP__Reserved(), legacy);
TTCN_Logger::log_event_str(", tP_ExtensionBit := ");
single_value->field_tP__ExtensionBit.log_match(match_value.tP__ExtensionBit(), legacy);
TTCN_Logger::log_event_str(", tP_SCTS := ");
single_value->field_tP__SCTS.log_match(match_value.tP__SCTS(), legacy);
TTCN_Logger::log_event_str(", tP_PID := ");
if (match_value.tP__PID().ispresent()) {
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__PID.log();
if (single_value->field_tP__PID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_DCS := ");
if (match_value.tP__DCS().ispresent()) {
single_value->field_tP__DCS.log_match(match_value.tP__DCS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__DCS.log();
if (single_value->field_tP__DCS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
if (match_value.tP__UDL__UD().ispresent()) {
single_value->field_tP__UDL__UD.log_match(match_value.tP__UDL__UD(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__UDL__UD.log();
if (single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ERROR_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__Spare1().is_bound()) tP__Spare1().set_implicit_omit();
if (tP__UDHI().is_bound()) tP__UDHI().set_implicit_omit();
if (tP__Spare2().is_bound()) tP__Spare2().set_implicit_omit();
if (tP__FCS().is_bound()) tP__FCS().set_implicit_omit();
if (tP__PresenceBitTP__PID().is_bound()) tP__PresenceBitTP__PID().set_implicit_omit();
if (tP__PresenceBitTP__DCS().is_bound()) tP__PresenceBitTP__DCS().set_implicit_omit();
if (tP__PresenceBitTP__UDL().is_bound()) tP__PresenceBitTP__UDL().set_implicit_omit();
if (tP__Reserved().is_bound()) tP__Reserved().set_implicit_omit();
if (tP__ExtensionBit().is_bound()) tP__ExtensionBit().set_implicit_omit();
if (tP__SCTS().is_bound()) tP__SCTS().set_implicit_omit();
if (!tP__PID().is_bound()) tP__PID() = OMIT_VALUE;
else tP__PID().set_implicit_omit();
if (!tP__DCS().is_bound()) tP__DCS() = OMIT_VALUE;
else tP__DCS().set_implicit_omit();
if (!tP__UDL__UD().is_bound()) tP__UDL__UD() = OMIT_VALUE;
else tP__UDL__UD().set_implicit_omit();
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__MTI.encode_text(text_buf);
single_value->field_tP__Spare1.encode_text(text_buf);
single_value->field_tP__UDHI.encode_text(text_buf);
single_value->field_tP__Spare2.encode_text(text_buf);
single_value->field_tP__FCS.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__PID.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__DCS.encode_text(text_buf);
single_value->field_tP__PresenceBitTP__UDL.encode_text(text_buf);
single_value->field_tP__Reserved.encode_text(text_buf);
single_value->field_tP__ExtensionBit.encode_text(text_buf);
single_value->field_tP__SCTS.encode_text(text_buf);
single_value->field_tP__PID.encode_text(text_buf);
single_value->field_tP__DCS.encode_text(text_buf);
single_value->field_tP__UDL__UD.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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
}
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_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_tP__MTI.decode_text(text_buf);
single_value->field_tP__Spare1.decode_text(text_buf);
single_value->field_tP__UDHI.decode_text(text_buf);
single_value->field_tP__Spare2.decode_text(text_buf);
single_value->field_tP__FCS.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__PID.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__DCS.decode_text(text_buf);
single_value->field_tP__PresenceBitTP__UDL.decode_text(text_buf);
single_value->field_tP__Reserved.decode_text(text_buf);
single_value->field_tP__ExtensionBit.decode_text(text_buf);
single_value->field_tP__SCTS.decode_text(text_buf);
single_value->field_tP__PID.decode_text(text_buf);
single_value->field_tP__DCS.decode_text(text_buf);
single_value->field_tP__UDL__UD.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 SMS__SUBMIT__REPORT__in__RP__ERROR_template[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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.");
}
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_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: {
    SMS__SUBMIT__REPORT__in__RP__ERROR_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 (14<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR has 14 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tP__MTI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__Spare1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__FCS().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__PID().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__DCS().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__PresenceBitTP__UDL().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__Reserved().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__ExtensionBit().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__SCTS().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) tP__UDL__UD().set_param(*param.get_elem(13));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_MTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_UDHI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDHI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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(), "tP_FCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__FCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PresenceBitTP_UDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PresenceBitTP__UDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_Reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__Reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_ExtensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__ExtensionBit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_SCTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SCTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_PID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__PID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_DCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DCS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tP_UDL_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__UDL__UD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__SUBMIT__REPORT__in__RP__ERROR_template* precondition = new SMS__SUBMIT__REPORT__in__RP__ERROR_template;
    precondition->set_param(*param.get_elem(0));
    SMS__SUBMIT__REPORT__in__RP__ERROR_template* implied_template = new SMS__SUBMIT__REPORT__in__RP__ERROR_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__SUBMIT__REPORT__in__RP__ERROR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_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_tP__MTI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__Spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__Spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__FCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__PresenceBitTP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__PresenceBitTP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__PresenceBitTP__UDL.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__Reserved.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__ExtensionBit.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__SCTS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
single_value->field_tP__UDL__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
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_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR");
}

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

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

RP__ERROR__User__DataTLV__SGSN__MS::RP__ERROR__User__DataTLV__SGSN__MS()
{
}

RP__ERROR__User__DataTLV__SGSN__MS::RP__ERROR__User__DataTLV__SGSN__MS(const BITSTRING& par_rP__Spare,
    const BITSTRING& par_rP__UserDataIEI,
    const INTEGER& par_rP__LengthIndicator,
    const TPDU__RP__ERROR__SGSN__MS& par_rP__TPDU)
  :   field_rP__Spare(par_rP__Spare),
  field_rP__UserDataIEI(par_rP__UserDataIEI),
  field_rP__LengthIndicator(par_rP__LengthIndicator),
  field_rP__TPDU(par_rP__TPDU)
{
}

RP__ERROR__User__DataTLV__SGSN__MS::RP__ERROR__User__DataTLV__SGSN__MS(const RP__ERROR__User__DataTLV__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
else field_rP__Spare.clean_up();
if (other_value.rP__UserDataIEI().is_bound()) field_rP__UserDataIEI = other_value.rP__UserDataIEI();
else field_rP__UserDataIEI.clean_up();
if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
else field_rP__LengthIndicator.clean_up();
if (other_value.rP__TPDU().is_bound()) field_rP__TPDU = other_value.rP__TPDU();
else field_rP__TPDU.clean_up();
}

void RP__ERROR__User__DataTLV__SGSN__MS::clean_up()
{
field_rP__Spare.clean_up();
field_rP__UserDataIEI.clean_up();
field_rP__LengthIndicator.clean_up();
field_rP__TPDU.clean_up();
}

const TTCN_Typedescriptor_t* RP__ERROR__User__DataTLV__SGSN__MS::get_descriptor() const { return &RP__ERROR__User__DataTLV__SGSN__MS_descr_; }
RP__ERROR__User__DataTLV__SGSN__MS& RP__ERROR__User__DataTLV__SGSN__MS::operator=(const RP__ERROR__User__DataTLV__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
  if (other_value.rP__Spare().is_bound()) field_rP__Spare = other_value.rP__Spare();
  else field_rP__Spare.clean_up();
  if (other_value.rP__UserDataIEI().is_bound()) field_rP__UserDataIEI = other_value.rP__UserDataIEI();
  else field_rP__UserDataIEI.clean_up();
  if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
  else field_rP__LengthIndicator.clean_up();
  if (other_value.rP__TPDU().is_bound()) field_rP__TPDU = other_value.rP__TPDU();
  else field_rP__TPDU.clean_up();
}
return *this;
}

boolean RP__ERROR__User__DataTLV__SGSN__MS::operator==(const RP__ERROR__User__DataTLV__SGSN__MS& other_value) const
{
return field_rP__Spare==other_value.field_rP__Spare
  && field_rP__UserDataIEI==other_value.field_rP__UserDataIEI
  && field_rP__LengthIndicator==other_value.field_rP__LengthIndicator
  && field_rP__TPDU==other_value.field_rP__TPDU;
}

boolean RP__ERROR__User__DataTLV__SGSN__MS::is_bound() const
{
return (field_rP__Spare.is_bound())
  || (field_rP__UserDataIEI.is_bound())
  || (field_rP__LengthIndicator.is_bound())
  || (field_rP__TPDU.is_bound());
}
boolean RP__ERROR__User__DataTLV__SGSN__MS::is_value() const
{
return field_rP__Spare.is_value()
  && field_rP__UserDataIEI.is_value()
  && field_rP__LengthIndicator.is_value()
  && field_rP__TPDU.is_value();
}
void RP__ERROR__User__DataTLV__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rP_Spare := ");
field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_UserDataIEI := ");
field_rP__UserDataIEI.log();
TTCN_Logger::log_event_str(", rP_LengthIndicator := ");
field_rP__LengthIndicator.log();
TTCN_Logger::log_event_str(", rP_TPDU := ");
field_rP__TPDU.log();
TTCN_Logger::log_event_str(" }");
}

void RP__ERROR__User__DataTLV__SGSN__MS::set_implicit_omit()
{
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__UserDataIEI().is_bound()) rP__UserDataIEI().set_implicit_omit();
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__TPDU().is_bound()) rP__TPDU().set_implicit_omit();
}

void RP__ERROR__User__DataTLV__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS 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) rP__Spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__UserDataIEI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__LengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__TPDU().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(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_UserDataIEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__UserDataIEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_TPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__TPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS");
  }
}

void RP__ERROR__User__DataTLV__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_rP__Spare.encode_text(text_buf);
field_rP__UserDataIEI.encode_text(text_buf);
field_rP__LengthIndicator.encode_text(text_buf);
field_rP__TPDU.encode_text(text_buf);
}

void RP__ERROR__User__DataTLV__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_rP__Spare.decode_text(text_buf);
field_rP__UserDataIEI.decode_text(text_buf);
field_rP__LengthIndicator.decode_text(text_buf);
field_rP__TPDU.decode_text(text_buf);
}

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

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

int RP__ERROR__User__DataTLV__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_descr_.raw->forceomit);
  decoded_field_length = field_rP__Spare.RAW_decode(RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_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, RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_.raw->forceomit);
  decoded_field_length = field_rP__UserDataIEI.RAW_decode(RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_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, RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_rP__LengthIndicator.RAW_decode(RP__ERROR__User__DataTLV__SGSN__MS_rP__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_rP__LengthIndicator.convert_to_Integer(RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_);
  field_rP__LengthIndicator = tmp2;
  value_of_length_field2 += tmp2.get_long_long_val() * 8;
  RAW_Force_Omit field_3_force_omit(3, force_omit, TPDU__RP__ERROR__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_rP__TPDU.RAW_decode(TPDU__RP__ERROR__SGSN__MS_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_rP__UserDataIEI !=  bs_6) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__ERROR__User__DataTLV__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TPDU__RP__ERROR__SGSN__MS_descr_.raw);
  encoded_length += field_rP__Spare.RAW_encode(RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__UserDataIEI.RAW_encode(RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->coding_descr = &RP__ERROR__User__DataTLV__SGSN__MS_rP__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_rP__TPDU.RAW_encode(TPDU__RP__ERROR__SGSN__MS_descr_, *myleaf.body.node.nodes[3]);
  if (field_rP__UserDataIEI !=  bs_6) {
  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_6.RAW_encode(RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_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 RP__ERROR__User__DataTLV__SGSN__MS_template::single_value_struct {
BITSTRING_template field_rP__Spare;
BITSTRING_template field_rP__UserDataIEI;
INTEGER_template field_rP__LengthIndicator;
TPDU__RP__ERROR__SGSN__MS_template field_rP__TPDU;
};

void RP__ERROR__User__DataTLV__SGSN__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_rP__Spare = ANY_VALUE;
single_value->field_rP__UserDataIEI = ANY_VALUE;
single_value->field_rP__LengthIndicator = ANY_VALUE;
single_value->field_rP__TPDU = ANY_VALUE;
}
}
}

void RP__ERROR__User__DataTLV__SGSN__MS_template::copy_value(const RP__ERROR__User__DataTLV__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.rP__Spare().is_bound()) {
  single_value->field_rP__Spare = other_value.rP__Spare();
} else {
  single_value->field_rP__Spare.clean_up();
}
if (other_value.rP__UserDataIEI().is_bound()) {
  single_value->field_rP__UserDataIEI = other_value.rP__UserDataIEI();
} else {
  single_value->field_rP__UserDataIEI.clean_up();
}
if (other_value.rP__LengthIndicator().is_bound()) {
  single_value->field_rP__LengthIndicator = other_value.rP__LengthIndicator();
} else {
  single_value->field_rP__LengthIndicator.clean_up();
}
if (other_value.rP__TPDU().is_bound()) {
  single_value->field_rP__TPDU = other_value.rP__TPDU();
} else {
  single_value->field_rP__TPDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__ERROR__User__DataTLV__SGSN__MS_template::copy_template(const RP__ERROR__User__DataTLV__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rP__Spare().get_selection()) {
single_value->field_rP__Spare = other_value.rP__Spare();
} else {
single_value->field_rP__Spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__UserDataIEI().get_selection()) {
single_value->field_rP__UserDataIEI = other_value.rP__UserDataIEI();
} else {
single_value->field_rP__UserDataIEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__LengthIndicator().get_selection()) {
single_value->field_rP__LengthIndicator = other_value.rP__LengthIndicator();
} else {
single_value->field_rP__LengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__TPDU().get_selection()) {
single_value->field_rP__TPDU = other_value.rP__TPDU();
} else {
single_value->field_rP__TPDU.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 RP__ERROR__User__DataTLV__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RP__ERROR__User__DataTLV__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ERROR__User__DataTLV__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
break;
}
set_selection(other_value);
}

RP__ERROR__User__DataTLV__SGSN__MS_template::RP__ERROR__User__DataTLV__SGSN__MS_template()
{
}

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

RP__ERROR__User__DataTLV__SGSN__MS_template::RP__ERROR__User__DataTLV__SGSN__MS_template(const RP__ERROR__User__DataTLV__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__ERROR__User__DataTLV__SGSN__MS_template::match(const RP__ERROR__User__DataTLV__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.rP__Spare().is_bound()) return FALSE;
if(!single_value->field_rP__Spare.match(other_value.rP__Spare(), legacy))return FALSE;
if(!other_value.rP__UserDataIEI().is_bound()) return FALSE;
if(!single_value->field_rP__UserDataIEI.match(other_value.rP__UserDataIEI(), legacy))return FALSE;
if(!other_value.rP__LengthIndicator().is_bound()) return FALSE;
if(!single_value->field_rP__LengthIndicator.match(other_value.rP__LengthIndicator(), legacy))return FALSE;
if(!other_value.rP__TPDU().is_bound()) return FALSE;
if(!single_value->field_rP__TPDU.match(other_value.rP__TPDU(), 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_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
}
return FALSE;
}

boolean RP__ERROR__User__DataTLV__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rP__Spare.is_bound()
 || single_value->field_rP__UserDataIEI.is_bound()
 || single_value->field_rP__LengthIndicator.is_bound()
 || single_value->field_rP__TPDU.is_bound();
}

boolean RP__ERROR__User__DataTLV__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rP__Spare.is_value()
 && single_value->field_rP__UserDataIEI.is_value()
 && single_value->field_rP__LengthIndicator.is_value()
 && single_value->field_rP__TPDU.is_value();
}

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

RP__ERROR__User__DataTLV__SGSN__MS RP__ERROR__User__DataTLV__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
RP__ERROR__User__DataTLV__SGSN__MS ret_val;
if (single_value->field_rP__Spare.is_bound()) {
ret_val.rP__Spare() = single_value->field_rP__Spare.valueof();
}
if (single_value->field_rP__UserDataIEI.is_bound()) {
ret_val.rP__UserDataIEI() = single_value->field_rP__UserDataIEI.valueof();
}
if (single_value->field_rP__LengthIndicator.is_bound()) {
ret_val.rP__LengthIndicator() = single_value->field_rP__LengthIndicator.valueof();
}
if (single_value->field_rP__TPDU.is_bound()) {
ret_val.rP__TPDU() = single_value->field_rP__TPDU.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__Spare()
{
set_specific();
return single_value->field_rP__Spare;
}

const BITSTRING_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__Spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_Spare of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
return single_value->field_rP__Spare;
}

BITSTRING_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__UserDataIEI()
{
set_specific();
return single_value->field_rP__UserDataIEI;
}

const BITSTRING_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__UserDataIEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_UserDataIEI of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
return single_value->field_rP__UserDataIEI;
}

INTEGER_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__LengthIndicator()
{
set_specific();
return single_value->field_rP__LengthIndicator;
}

const INTEGER_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__LengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_LengthIndicator of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
return single_value->field_rP__LengthIndicator;
}

TPDU__RP__ERROR__SGSN__MS_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__TPDU()
{
set_specific();
return single_value->field_rP__TPDU;
}

const TPDU__RP__ERROR__SGSN__MS_template& RP__ERROR__User__DataTLV__SGSN__MS_template::rP__TPDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_TPDU of a non-specific template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
return single_value->field_rP__TPDU;
}

int RP__ERROR__User__DataTLV__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS 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_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
  }
  return 0;
}

void RP__ERROR__User__DataTLV__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rP_Spare := ");
single_value->field_rP__Spare.log();
TTCN_Logger::log_event_str(", rP_UserDataIEI := ");
single_value->field_rP__UserDataIEI.log();
TTCN_Logger::log_event_str(", rP_LengthIndicator := ");
single_value->field_rP__LengthIndicator.log();
TTCN_Logger::log_event_str(", rP_TPDU := ");
single_value->field_rP__TPDU.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 RP__ERROR__User__DataTLV__SGSN__MS_template::log_match(const RP__ERROR__User__DataTLV__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_rP__Spare.match(match_value.rP__Spare(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_Spare");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__UserDataIEI.match(match_value.rP__UserDataIEI(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_UserDataIEI");
single_value->field_rP__UserDataIEI.log_match(match_value.rP__UserDataIEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__LengthIndicator.match(match_value.rP__LengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_LengthIndicator");
single_value->field_rP__LengthIndicator.log_match(match_value.rP__LengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__TPDU.match(match_value.rP__TPDU(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_TPDU");
single_value->field_rP__TPDU.log_match(match_value.rP__TPDU(), 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("{ rP_Spare := ");
single_value->field_rP__Spare.log_match(match_value.rP__Spare(), legacy);
TTCN_Logger::log_event_str(", rP_UserDataIEI := ");
single_value->field_rP__UserDataIEI.log_match(match_value.rP__UserDataIEI(), legacy);
TTCN_Logger::log_event_str(", rP_LengthIndicator := ");
single_value->field_rP__LengthIndicator.log_match(match_value.rP__LengthIndicator(), legacy);
TTCN_Logger::log_event_str(", rP_TPDU := ");
single_value->field_rP__TPDU.log_match(match_value.rP__TPDU(), 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 RP__ERROR__User__DataTLV__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__Spare().is_bound()) rP__Spare().set_implicit_omit();
if (rP__UserDataIEI().is_bound()) rP__UserDataIEI().set_implicit_omit();
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__TPDU().is_bound()) rP__TPDU().set_implicit_omit();
}

void RP__ERROR__User__DataTLV__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rP__Spare.encode_text(text_buf);
single_value->field_rP__UserDataIEI.encode_text(text_buf);
single_value->field_rP__LengthIndicator.encode_text(text_buf);
single_value->field_rP__TPDU.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_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.");
}
}

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

void RP__ERROR__User__DataTLV__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RP__ERROR__User__DataTLV__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS 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) rP__Spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__UserDataIEI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__LengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__TPDU().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(), "rP_Spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_UserDataIEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__UserDataIEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_LengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_TPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__TPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__ERROR__User__DataTLV__SGSN__MS_template* precondition = new RP__ERROR__User__DataTLV__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    RP__ERROR__User__DataTLV__SGSN__MS_template* implied_template = new RP__ERROR__User__DataTLV__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__ERROR__User__DataTLV__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

CP__User__DataLV__SGSN__MS::CP__User__DataLV__SGSN__MS()
{
}

CP__User__DataLV__SGSN__MS::CP__User__DataLV__SGSN__MS(const INTEGER& par_lengthIndicator,
    const RPDU__SGSN__MS& par_cP__RPDU)
  :   field_lengthIndicator(par_lengthIndicator),
  field_cP__RPDU(par_cP__RPDU)
{
}

CP__User__DataLV__SGSN__MS::CP__User__DataLV__SGSN__MS(const CP__User__DataLV__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.cP__RPDU().is_bound()) field_cP__RPDU = other_value.cP__RPDU();
else field_cP__RPDU.clean_up();
}

void CP__User__DataLV__SGSN__MS::clean_up()
{
field_lengthIndicator.clean_up();
field_cP__RPDU.clean_up();
}

const TTCN_Typedescriptor_t* CP__User__DataLV__SGSN__MS::get_descriptor() const { return &CP__User__DataLV__SGSN__MS_descr_; }
CP__User__DataLV__SGSN__MS& CP__User__DataLV__SGSN__MS::operator=(const CP__User__DataLV__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.cP__RPDU().is_bound()) field_cP__RPDU = other_value.cP__RPDU();
  else field_cP__RPDU.clean_up();
}
return *this;
}

boolean CP__User__DataLV__SGSN__MS::operator==(const CP__User__DataLV__SGSN__MS& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_cP__RPDU==other_value.field_cP__RPDU;
}

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

void CP__User__DataLV__SGSN__MS::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (cP__RPDU().is_bound()) cP__RPDU().set_implicit_omit();
}

void CP__User__DataLV__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS 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) cP__RPDU().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(), "cP_RPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cP__RPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.CP_User_DataLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS");
  }
}

void CP__User__DataLV__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_cP__RPDU.encode_text(text_buf);
}

void CP__User__DataLV__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_cP__RPDU.decode_text(text_buf);
}

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

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

int CP__User__DataLV__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, CP__User__DataLV__SGSN__MS_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(CP__User__DataLV__SGSN__MS_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(CP__User__DataLV__SGSN__MS_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, RPDU__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_cP__RPDU.RAW_decode(RPDU__SGSN__MS_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 CP__User__DataLV__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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, CP__User__DataLV__SGSN__MS_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RPDU__SGSN__MS_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &CP__User__DataLV__SGSN__MS_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_cP__RPDU.RAW_encode(RPDU__SGSN__MS_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct CP__User__DataLV__SGSN__MS_template::single_value_struct {
INTEGER_template field_lengthIndicator;
RPDU__SGSN__MS_template field_cP__RPDU;
};

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

void CP__User__DataLV__SGSN__MS_template::copy_value(const CP__User__DataLV__SGSN__MS& 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.cP__RPDU().is_bound()) {
  single_value->field_cP__RPDU = other_value.cP__RPDU();
} else {
  single_value->field_cP__RPDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CP__User__DataLV__SGSN__MS_template::copy_template(const CP__User__DataLV__SGSN__MS_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.cP__RPDU().get_selection()) {
single_value->field_cP__RPDU = other_value.cP__RPDU();
} else {
single_value->field_cP__RPDU.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 CP__User__DataLV__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new CP__User__DataLV__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new CP__User__DataLV__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS.");
break;
}
set_selection(other_value);
}

CP__User__DataLV__SGSN__MS_template::CP__User__DataLV__SGSN__MS_template()
{
}

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

CP__User__DataLV__SGSN__MS_template::CP__User__DataLV__SGSN__MS_template(const CP__User__DataLV__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CP__User__DataLV__SGSN__MS_template::match(const CP__User__DataLV__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.cP__RPDU().is_bound()) return FALSE;
if(!single_value->field_cP__RPDU.match(other_value.cP__RPDU(), 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_SMS_Types.CP_User_DataLV_SGSN_MS.");
}
return FALSE;
}

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

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

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

CP__User__DataLV__SGSN__MS CP__User__DataLV__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS.");
CP__User__DataLV__SGSN__MS ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_cP__RPDU.is_bound()) {
ret_val.cP__RPDU() = single_value->field_cP__RPDU.valueof();
}
return ret_val;
}

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

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

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

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

RPDU__SGSN__MS_template& CP__User__DataLV__SGSN__MS_template::cP__RPDU()
{
set_specific();
return single_value->field_cP__RPDU;
}

const RPDU__SGSN__MS_template& CP__User__DataLV__SGSN__MS_template::cP__RPDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cP_RPDU of a non-specific template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS.");
return single_value->field_cP__RPDU;
}

int CP__User__DataLV__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS 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_SMS_Types.CP_User_DataLV_SGSN_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS.");
  }
  return 0;
}

void CP__User__DataLV__SGSN__MS_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(", cP_RPDU := ");
single_value->field_cP__RPDU.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 CP__User__DataLV__SGSN__MS_template::log_match(const CP__User__DataLV__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_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_cP__RPDU.match(match_value.cP__RPDU(), legacy)){
TTCN_Logger::log_logmatch_info(".cP_RPDU");
single_value->field_cP__RPDU.log_match(match_value.cP__RPDU(), 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(", cP_RPDU := ");
single_value->field_cP__RPDU.log_match(match_value.cP__RPDU(), 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 CP__User__DataLV__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (cP__RPDU().is_bound()) cP__RPDU().set_implicit_omit();
}

void CP__User__DataLV__SGSN__MS_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_cP__RPDU.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_SMS_Types.CP_User_DataLV_SGSN_MS.");
}
}

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

void CP__User__DataLV__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CP__User__DataLV__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS 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) cP__RPDU().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(), "cP_RPDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cP__RPDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_SMS_Types.CP_User_DataLV_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CP__User__DataLV__SGSN__MS_template* precondition = new CP__User__DataLV__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    CP__User__DataLV__SGSN__MS_template* implied_template = new CP__User__DataLV__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CP__User__DataLV__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

CP__DATA__SGSN__MS::CP__DATA__SGSN__MS()
{
}

CP__DATA__SGSN__MS::CP__DATA__SGSN__MS(const BITSTRING& par_cP__messageType,
    const CP__User__DataLV__SGSN__MS& par_cP__User__Data)
  :   field_cP__messageType(par_cP__messageType),
  field_cP__User__Data(par_cP__User__Data)
{
}

CP__DATA__SGSN__MS::CP__DATA__SGSN__MS(const CP__DATA__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS.");
if (other_value.cP__messageType().is_bound()) field_cP__messageType = other_value.cP__messageType();
else field_cP__messageType.clean_up();
if (other_value.cP__User__Data().is_bound()) field_cP__User__Data = other_value.cP__User__Data();
else field_cP__User__Data.clean_up();
}

void CP__DATA__SGSN__MS::clean_up()
{
field_cP__messageType.clean_up();
field_cP__User__Data.clean_up();
}

const TTCN_Typedescriptor_t* CP__DATA__SGSN__MS::get_descriptor() const { return &CP__DATA__SGSN__MS_descr_; }
CP__DATA__SGSN__MS& CP__DATA__SGSN__MS::operator=(const CP__DATA__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS.");
  if (other_value.cP__messageType().is_bound()) field_cP__messageType = other_value.cP__messageType();
  else field_cP__messageType.clean_up();
  if (other_value.cP__User__Data().is_bound()) field_cP__User__Data = other_value.cP__User__Data();
  else field_cP__User__Data.clean_up();
}
return *this;
}

boolean CP__DATA__SGSN__MS::operator==(const CP__DATA__SGSN__MS& other_value) const
{
return field_cP__messageType==other_value.field_cP__messageType
  && field_cP__User__Data==other_value.field_cP__User__Data;
}

boolean CP__DATA__SGSN__MS::is_bound() const
{
return (field_cP__messageType.is_bound())
  || (field_cP__User__Data.is_bound());
}
boolean CP__DATA__SGSN__MS::is_value() const
{
return field_cP__messageType.is_value()
  && field_cP__User__Data.is_value();
}
void CP__DATA__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cP_messageType := ");
field_cP__messageType.log();
TTCN_Logger::log_event_str(", cP_User_Data := ");
field_cP__User__Data.log();
TTCN_Logger::log_event_str(" }");
}

void CP__DATA__SGSN__MS::set_implicit_omit()
{
if (cP__messageType().is_bound()) cP__messageType().set_implicit_omit();
if (cP__User__Data().is_bound()) cP__User__Data().set_implicit_omit();
}

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

void CP__DATA__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_cP__messageType.encode_text(text_buf);
field_cP__User__Data.encode_text(text_buf);
}

void CP__DATA__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_cP__messageType.decode_text(text_buf);
field_cP__User__Data.decode_text(text_buf);
}

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

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

int CP__DATA__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_cP__messageType.RAW_decode(General__Types::BIT8_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, CP__User__DataLV__SGSN__MS_descr_.raw->forceomit);
  decoded_field_length = field_cP__User__Data.RAW_decode(CP__User__DataLV__SGSN__MS_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_cP__messageType !=  bs_13) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CP__DATA__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CP__User__DataLV__SGSN__MS_descr_.raw);
  encoded_length += field_cP__messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cP__User__Data.RAW_encode(CP__User__DataLV__SGSN__MS_descr_, *myleaf.body.node.nodes[1]);
  if (field_cP__messageType !=  bs_13) {
  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_13.RAW_encode(General__Types::BIT8_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 CP__DATA__SGSN__MS_template::single_value_struct {
BITSTRING_template field_cP__messageType;
CP__User__DataLV__SGSN__MS_template field_cP__User__Data;
};

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

void CP__DATA__SGSN__MS_template::copy_value(const CP__DATA__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.cP__messageType().is_bound()) {
  single_value->field_cP__messageType = other_value.cP__messageType();
} else {
  single_value->field_cP__messageType.clean_up();
}
if (other_value.cP__User__Data().is_bound()) {
  single_value->field_cP__User__Data = other_value.cP__User__Data();
} else {
  single_value->field_cP__User__Data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

CP__DATA__SGSN__MS_template::CP__DATA__SGSN__MS_template()
{
}

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

CP__DATA__SGSN__MS_template::CP__DATA__SGSN__MS_template(const CP__DATA__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CP__DATA__SGSN__MS_template::match(const CP__DATA__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.cP__messageType().is_bound()) return FALSE;
if(!single_value->field_cP__messageType.match(other_value.cP__messageType(), legacy))return FALSE;
if(!other_value.cP__User__Data().is_bound()) return FALSE;
if(!single_value->field_cP__User__Data.match(other_value.cP__User__Data(), 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_SMS_Types.CP_DATA_SGSN_MS.");
}
return FALSE;
}

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

boolean CP__DATA__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cP__messageType.is_value()
 && single_value->field_cP__User__Data.is_value();
}

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

CP__DATA__SGSN__MS CP__DATA__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS.");
CP__DATA__SGSN__MS ret_val;
if (single_value->field_cP__messageType.is_bound()) {
ret_val.cP__messageType() = single_value->field_cP__messageType.valueof();
}
if (single_value->field_cP__User__Data.is_bound()) {
ret_val.cP__User__Data() = single_value->field_cP__User__Data.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& CP__DATA__SGSN__MS_template::cP__messageType()
{
set_specific();
return single_value->field_cP__messageType;
}

const BITSTRING_template& CP__DATA__SGSN__MS_template::cP__messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cP_messageType of a non-specific template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS.");
return single_value->field_cP__messageType;
}

CP__User__DataLV__SGSN__MS_template& CP__DATA__SGSN__MS_template::cP__User__Data()
{
set_specific();
return single_value->field_cP__User__Data;
}

const CP__User__DataLV__SGSN__MS_template& CP__DATA__SGSN__MS_template::cP__User__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cP_User_Data of a non-specific template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS.");
return single_value->field_cP__User__Data;
}

int CP__DATA__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS 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_SMS_Types.CP_DATA_SGSN_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS.");
  }
  return 0;
}

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

void CP__DATA__SGSN__MS_template::log_match(const CP__DATA__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_cP__messageType.match(match_value.cP__messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".cP_messageType");
single_value->field_cP__messageType.log_match(match_value.cP__messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cP__User__Data.match(match_value.cP__User__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".cP_User_Data");
single_value->field_cP__User__Data.log_match(match_value.cP__User__Data(), 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("{ cP_messageType := ");
single_value->field_cP__messageType.log_match(match_value.cP__messageType(), legacy);
TTCN_Logger::log_event_str(", cP_User_Data := ");
single_value->field_cP__User__Data.log_match(match_value.cP__User__Data(), 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 CP__DATA__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cP__messageType().is_bound()) cP__messageType().set_implicit_omit();
if (cP__User__Data().is_bound()) cP__User__Data().set_implicit_omit();
}

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

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

void CP__DATA__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CP__DATA__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.CP_DATA_SGSN_MS 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) cP__messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cP__User__Data().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(), "cP_messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cP__messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cP_User_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cP__User__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.CP_DATA_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CP__DATA__SGSN__MS_template* precondition = new CP__DATA__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    CP__DATA__SGSN__MS_template* implied_template = new CP__DATA__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CP__DATA__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.CP_DATA_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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


/* Bodies of functions, altsteps and testcases */

void enc__TPDU__RP__DATA__MS__SGSN__fast(const TPDU__RP__DATA__MS__SGSN& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_DATA_MS_SGSN_fast(): Encoding @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(TPDU__RP__DATA__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_DATA_MS_SGSN_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__TPDU__RP__DATA__MS__SGSN__backtrack(const OCTETSTRING& stream, TPDU__RP__DATA__MS__SGSN& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_DATA_MS_SGSN_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(TPDU__RP__DATA__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_DATA_MS_SGSN_backtrack(): Decoded @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_TPDU_RP_DATA_MS_SGSN_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void enc__TPDU__RP__DATA__SGSN__MS__fast(const TPDU__RP__DATA__SGSN__MS& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_DATA_SGSN_MS_fast(): Encoding @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(TPDU__RP__DATA__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_DATA_SGSN_MS_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__TPDU__RP__DATA__SGSN__MS__backtrack(const OCTETSTRING& stream, TPDU__RP__DATA__SGSN__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_DATA_SGSN_MS_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(TPDU__RP__DATA__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_DATA_SGSN_MS_backtrack(): Decoded @MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_TPDU_RP_DATA_SGSN_MS_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void enc__TPDU__RP__ACK__MS__SGSN__fast(const TPDU__RP__ACK__MS__SGSN& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ACK_MS_SGSN_fast(): Encoding @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(TPDU__RP__ACK__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ACK_MS_SGSN_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__TPDU__RP__ACK__MS__SGSN__backtrack(const OCTETSTRING& stream, TPDU__RP__ACK__MS__SGSN& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ACK_MS_SGSN_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(TPDU__RP__ACK__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ACK_MS_SGSN_backtrack(): Decoded @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_TPDU_RP_ACK_MS_SGSN_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void enc__TPDU__RP__ACK__SGSN__MS__fast(const TPDU__RP__ACK__SGSN__MS& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ACK_SGSN_MS_fast(): Encoding @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(TPDU__RP__ACK__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ACK_SGSN_MS_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__TPDU__RP__ACK__SGSN__MS__backtrack(const OCTETSTRING& stream, TPDU__RP__ACK__SGSN__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ACK_SGSN_MS_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(TPDU__RP__ACK__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ACK_SGSN_MS_backtrack(): Decoded @MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_TPDU_RP_ACK_SGSN_MS_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void enc__TPDU__RP__ERROR__MS__SGSN__fast(const TPDU__RP__ERROR__MS__SGSN& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ERROR_MS_SGSN_fast(): Encoding @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(TPDU__RP__ERROR__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ERROR_MS_SGSN_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__TPDU__RP__ERROR__MS__SGSN__backtrack(const OCTETSTRING& stream, TPDU__RP__ERROR__MS__SGSN& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ERROR_MS_SGSN_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(TPDU__RP__ERROR__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ERROR_MS_SGSN_backtrack(): Decoded @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_TPDU_RP_ERROR_MS_SGSN_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void enc__TPDU__RP__ERROR__SGSN__MS__fast(const TPDU__RP__ERROR__SGSN__MS& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ERROR_SGSN_MS_fast(): Encoding @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(TPDU__RP__ERROR__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_TPDU_RP_ERROR_SGSN_MS_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__TPDU__RP__ERROR__SGSN__MS__backtrack(const OCTETSTRING& stream, TPDU__RP__ERROR__SGSN__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ERROR_SGSN_MS_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(TPDU__RP__ERROR__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_TPDU_RP_ERROR_SGSN_MS_backtrack(): Decoded @MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_TPDU_RP_ERROR_SGSN_MS_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void enc__RPDU__SGSN__MS__fast(const RPDU__SGSN__MS& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_RPDU_SGSN_MS_fast(): Encoding @MobileL3_SMS_Types.RPDU_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(RPDU__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_RPDU_SGSN_MS_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__RPDU__SGSN__MS__backtrack(const OCTETSTRING& stream, RPDU__SGSN__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_RPDU_SGSN_MS_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(RPDU__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_RPDU_SGSN_MS_backtrack(): Decoded @MobileL3_SMS_Types.RPDU_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_RPDU_SGSN_MS_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void enc__RPDU__MS__SGSN__fast(const RPDU__MS__SGSN& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_RPDU_MS_SGSN_fast(): Encoding @MobileL3_SMS_Types.RPDU_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(RPDU__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_RPDU_MS_SGSN_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

INTEGER dec__RPDU__MS__SGSN__backtrack(const OCTETSTRING& stream, RPDU__MS__SGSN& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_RPDU_MS_SGSN_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(RPDU__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_RPDU_MS_SGSN_backtrack(): Decoded @MobileL3_SMS_Types.RPDU_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_RPDU_MS_SGSN_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void CP__User__DataLV__MS__SGSN_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__User__DataLV__MS__SGSN_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__User__DataLV__MS__SGSN_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__User__DataLV__MS__SGSN_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__OriginatorAddressLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__OriginatorAddressLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__OriginatorAddressLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__OriginatorAddressLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__NumberingPlan__and__NumberDigits_rP__NumberDigits_encoder(const HEXSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__NumberingPlan__and__NumberDigits_rP__NumberDigits_decoder(OCTETSTRING& input_stream, HEXSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__NumberingPlan__and__NumberDigits_encoder(const RP__NumberingPlan__and__NumberDigits& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__NumberingPlan__and__NumberDigits_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__NumberingPlan__and__NumberDigits_decoder(OCTETSTRING& input_stream, RP__NumberingPlan__and__NumberDigits& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__NumberingPlan__and__NumberDigits_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__OriginatorAddressLV_encoder(const RP__OriginatorAddressLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_OriginatorAddressLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__OriginatorAddressLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__OriginatorAddressLV_decoder(OCTETSTRING& input_stream, RP__OriginatorAddressLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_OriginatorAddressLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__OriginatorAddressLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DestinationAddressLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DestinationAddressLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DestinationAddressLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DestinationAddressLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DestinationAddressLV_encoder(const RP__DestinationAddressLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DestinationAddressLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DestinationAddressLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DestinationAddressLV_decoder(OCTETSTRING& input_stream, RP__DestinationAddressLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DestinationAddressLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DestinationAddressLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__DA__NoPad_tP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__DA__NoPad_tP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__DA__NoPad_tP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__DA__NoPad_tP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__DA__NoPad_tP__DAValue_encoder(const HEXSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__DA__NoPad_tP__DAValue_decoder(OCTETSTRING& input_stream, HEXSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__DA__NoPad_encoder(const TP__DA__NoPad& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_DA_NoPad' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__DA__NoPad_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__DA__NoPad_decoder(OCTETSTRING& input_stream, TP__DA__NoPad& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_DA_NoPad' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__DA__NoPad_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__DA_encoder(const TP__DA& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_DA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__DA_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__DA_decoder(OCTETSTRING& input_stream, TP__DA& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_DA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__DA_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__UDL__UD_tP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__UDL__UD_tP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__UDL__UD_tP__UD_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__UDL__UD_tP__UD_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__UDL__UD_encoder(const TP__UDL__UD& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__UDL__UD_decoder(OCTETSTRING& input_stream, TP__UDL__UD& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__VP_encoder(const TP__VP& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_VP' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__VP_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__VP_decoder(OCTETSTRING& input_stream, TP__VP& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_VP' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__VP_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT_tP__VP_encoder(const TP__VP& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_VP' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT_tP__VP_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT_tP__VP_decoder(OCTETSTRING& input_stream, TP__VP& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_VP' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT_tP__VP_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT_encoder(const SMS__SUBMIT& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_SUBMIT' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT_decoder(OCTETSTRING& input_stream, SMS__SUBMIT& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_SUBMIT' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__CDL__CD_tP__CDL_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__CDL__CD_tP__CDL_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__CDL__CD_tP__CDL_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__CDL__CD_tP__CDL_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__CDL__CD_tP__CD_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__CDL__CD_tP__CD_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__CDL__CD_encoder(const TP__CDL__CD& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_CDL_CD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__CDL__CD_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__CDL__CD_decoder(OCTETSTRING& input_stream, TP__CDL__CD& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_CDL_CD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__CDL__CD_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__COMMAND_encoder(const SMS__COMMAND& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_COMMAND' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__COMMAND_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__COMMAND_decoder(OCTETSTRING& input_stream, SMS__COMMAND& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_COMMAND' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__COMMAND_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TPDU__RP__DATA__MS__SGSN_encoder(const TPDU__RP__DATA__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TPDU__RP__DATA__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TPDU__RP__DATA__MS__SGSN_decoder(OCTETSTRING& input_stream, TPDU__RP__DATA__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TPDU__RP__DATA__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DATA__User__DataLV__MS__SGSN_encoder(const RP__DATA__User__DataLV__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_User_DataLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DATA__User__DataLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DATA__User__DataLV__MS__SGSN_decoder(OCTETSTRING& input_stream, RP__DATA__User__DataLV__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_User_DataLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DATA__User__DataLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DATA__MS__SGSN_encoder(const RP__DATA__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DATA__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DATA__MS__SGSN_decoder(OCTETSTRING& input_stream, RP__DATA__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DATA__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_encoder(const TP__UDL__UD& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_decoder(OCTETSTRING& input_stream, TP__UDL__UD& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ACK_encoder(const SMS__DELIVER__REPORT__in__RP__ACK& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ACK_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ACK_decoder(OCTETSTRING& input_stream, SMS__DELIVER__REPORT__in__RP__ACK& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ACK_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TPDU__RP__ACK__MS__SGSN_encoder(const TPDU__RP__ACK__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TPDU__RP__ACK__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TPDU__RP__ACK__MS__SGSN_decoder(OCTETSTRING& input_stream, TPDU__RP__ACK__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TPDU__RP__ACK__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__MS__SGSN_encoder(const RP__ACK__User__DataTLV__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__MS__SGSN_decoder(OCTETSTRING& input_stream, RP__ACK__User__DataTLV__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__MS__SGSN_encoder(const RP__ACK__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__MS__SGSN_decoder(OCTETSTRING& input_stream, RP__ACK__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__CauseLV_rP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__CauseLV_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__CauseLV_rP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__CauseLV_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__CauseV_encoder(const RP__CauseV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_CauseV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__CauseV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__CauseV_decoder(OCTETSTRING& input_stream, RP__CauseV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_CauseV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__CauseV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__CauseLV_encoder(const RP__CauseLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_CauseLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__CauseLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__CauseLV_decoder(OCTETSTRING& input_stream, RP__CauseLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_CauseLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__CauseLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_encoder(const TP__UDL__UD& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_decoder(OCTETSTRING& input_stream, TP__UDL__UD& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER__REPORT__in__RP__ERROR_encoder(const SMS__DELIVER__REPORT__in__RP__ERROR& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER__REPORT__in__RP__ERROR_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER__REPORT__in__RP__ERROR_decoder(OCTETSTRING& input_stream, SMS__DELIVER__REPORT__in__RP__ERROR& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER__REPORT__in__RP__ERROR_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TPDU__RP__ERROR__MS__SGSN_encoder(const TPDU__RP__ERROR__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TPDU__RP__ERROR__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TPDU__RP__ERROR__MS__SGSN_decoder(OCTETSTRING& input_stream, TPDU__RP__ERROR__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TPDU__RP__ERROR__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__MS__SGSN_encoder(const RP__ERROR__User__DataTLV__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__MS__SGSN_decoder(OCTETSTRING& input_stream, RP__ERROR__User__DataTLV__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__MS__SGSN_encoder(const RP__ERROR__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__MS__SGSN_decoder(OCTETSTRING& input_stream, RP__ERROR__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__SMMA_encoder(const RP__SMMA& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_SMMA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__SMMA_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__SMMA_decoder(OCTETSTRING& input_stream, RP__SMMA& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_SMMA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__SMMA_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RPDU__MS__SGSN_encoder(const RPDU__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RPDU_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RPDU__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RPDU__MS__SGSN_decoder(OCTETSTRING& input_stream, RPDU__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RPDU_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RPDU__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__User__DataLV__MS__SGSN_encoder(const CP__User__DataLV__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_User_DataLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__User__DataLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__User__DataLV__MS__SGSN_decoder(OCTETSTRING& input_stream, CP__User__DataLV__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_User_DataLV_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__User__DataLV__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__DATA__MS__SGSN_encoder(const CP__DATA__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_DATA_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__DATA__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__DATA__MS__SGSN_decoder(OCTETSTRING& input_stream, CP__DATA__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_DATA_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__DATA__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__ACK_encoder(const CP__ACK& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_ACK' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__ACK_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__ACK_decoder(OCTETSTRING& input_stream, CP__ACK& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_ACK' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__ACK_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__CauseV_encoder(const CP__CauseV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_CauseV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__CauseV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__CauseV_decoder(OCTETSTRING& input_stream, CP__CauseV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_CauseV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__CauseV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__ERROR_encoder(const CP__ERROR& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_ERROR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__ERROR_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__ERROR_decoder(OCTETSTRING& input_stream, CP__ERROR& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_ERROR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__ERROR_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__SMS__MS__SGSN_encoder(const L3__SMS__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.L3_SMS_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(L3__SMS__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__SMS__MS__SGSN_decoder(OCTETSTRING& input_stream, L3__SMS__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.L3_SMS_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(L3__SMS__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__User__DataLV__SGSN__MS_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__User__DataLV__SGSN__MS_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__User__DataLV__SGSN__MS_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__User__DataLV__SGSN__MS_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__OA__NoPad_tP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__OA__NoPad_tP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__OA__NoPad_tP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__OA__NoPad_tP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__OA__NoPad_tP__OAValue_encoder(const HEXSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__OA__NoPad_tP__OAValue_decoder(OCTETSTRING& input_stream, HEXSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__OA__NoPad_encoder(const TP__OA__NoPad& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_OA_NoPad' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__OA__NoPad_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__OA__NoPad_decoder(OCTETSTRING& input_stream, TP__OA__NoPad& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_OA_NoPad' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__OA__NoPad_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__OA_encoder(const TP__OA& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_OA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__OA_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__OA_decoder(OCTETSTRING& input_stream, TP__OA& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_OA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__OA_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__DELIVER_encoder(const SMS__DELIVER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_DELIVER' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__DELIVER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__DELIVER_decoder(OCTETSTRING& input_stream, SMS__DELIVER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_DELIVER' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__DELIVER_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__RA__NoPad_tP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__RA__NoPad_tP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__RA__NoPad_tP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__RA__NoPad_tP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__RA__NoPad_tP__RAValue_encoder(const HEXSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__RA__NoPad_tP__RAValue_decoder(OCTETSTRING& input_stream, HEXSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__RA__NoPad_encoder(const TP__RA__NoPad& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_RA_NoPad' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__RA__NoPad_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__RA__NoPad_decoder(OCTETSTRING& input_stream, TP__RA__NoPad& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_RA_NoPad' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__RA__NoPad_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TP__RA_encoder(const TP__RA& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_RA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TP__RA_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TP__RA_decoder(OCTETSTRING& input_stream, TP__RA& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_RA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TP__RA_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__STATUS__REPORT_tP__PID_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__STATUS__REPORT_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__STATUS__REPORT_tP__PID_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__STATUS__REPORT_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__STATUS__REPORT_tP__DCS_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__STATUS__REPORT_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__STATUS__REPORT_tP__DCS_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__STATUS__REPORT_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__STATUS__REPORT_tP__UDL__UD_encoder(const TP__UDL__UD& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__STATUS__REPORT_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__STATUS__REPORT_tP__UDL__UD_decoder(OCTETSTRING& input_stream, TP__UDL__UD& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__STATUS__REPORT_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__STATUS__REPORT_encoder(const SMS__STATUS__REPORT& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_STATUS_REPORT' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__STATUS__REPORT_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__STATUS__REPORT_decoder(OCTETSTRING& input_stream, SMS__STATUS__REPORT& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_STATUS_REPORT' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__STATUS__REPORT_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TPDU__RP__DATA__SGSN__MS_encoder(const TPDU__RP__DATA__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TPDU__RP__DATA__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TPDU__RP__DATA__SGSN__MS_decoder(OCTETSTRING& input_stream, TPDU__RP__DATA__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TPDU__RP__DATA__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DATA__User__DataLV__SGSN__MS_encoder(const RP__DATA__User__DataLV__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DATA__User__DataLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DATA__User__DataLV__SGSN__MS_decoder(OCTETSTRING& input_stream, RP__DATA__User__DataLV__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DATA__User__DataLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__DATA__SGSN__MS_encoder(const RP__DATA__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__DATA__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__DATA__SGSN__MS_decoder(OCTETSTRING& input_stream, RP__DATA__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_DATA_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__DATA__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_encoder(const TP__UDL__UD& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_decoder(OCTETSTRING& input_stream, TP__UDL__UD& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ACK_encoder(const SMS__SUBMIT__REPORT__in__RP__ACK& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ACK_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ACK_decoder(OCTETSTRING& input_stream, SMS__SUBMIT__REPORT__in__RP__ACK& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ACK_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TPDU__RP__ACK__SGSN__MS_encoder(const TPDU__RP__ACK__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TPDU__RP__ACK__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TPDU__RP__ACK__SGSN__MS_decoder(OCTETSTRING& input_stream, TPDU__RP__ACK__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TPDU__RP__ACK__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__User__DataTLV__SGSN__MS_encoder(const RP__ACK__User__DataTLV__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__User__DataTLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__User__DataTLV__SGSN__MS_decoder(OCTETSTRING& input_stream, RP__ACK__User__DataTLV__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__User__DataTLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ACK__SGSN__MS_encoder(const RP__ACK__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ACK__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ACK__SGSN__MS_decoder(OCTETSTRING& input_stream, RP__ACK__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ACK_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ACK__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_encoder(const TP__UDL__UD& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_decoder(OCTETSTRING& input_stream, TP__UDL__UD& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TP_UDL_UD' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void SMS__SUBMIT__REPORT__in__RP__ERROR_encoder(const SMS__SUBMIT__REPORT__in__RP__ERROR& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SMS__SUBMIT__REPORT__in__RP__ERROR_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SMS__SUBMIT__REPORT__in__RP__ERROR_decoder(OCTETSTRING& input_stream, SMS__SUBMIT__REPORT__in__RP__ERROR& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SMS__SUBMIT__REPORT__in__RP__ERROR_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TPDU__RP__ERROR__SGSN__MS_encoder(const TPDU__RP__ERROR__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TPDU__RP__ERROR__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TPDU__RP__ERROR__SGSN__MS_decoder(OCTETSTRING& input_stream, TPDU__RP__ERROR__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TPDU__RP__ERROR__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__User__DataTLV__SGSN__MS_encoder(const RP__ERROR__User__DataTLV__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__User__DataTLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__User__DataTLV__SGSN__MS_decoder(OCTETSTRING& input_stream, RP__ERROR__User__DataTLV__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__User__DataTLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RP__ERROR__SGSN__MS_encoder(const RP__ERROR__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RP__ERROR__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RP__ERROR__SGSN__MS_decoder(OCTETSTRING& input_stream, RP__ERROR__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RP_ERROR_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RP__ERROR__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void RPDU__SGSN__MS_encoder(const RPDU__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RPDU_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RPDU__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RPDU__SGSN__MS_decoder(OCTETSTRING& input_stream, RPDU__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.RPDU_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RPDU__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__User__DataLV__SGSN__MS_encoder(const CP__User__DataLV__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__User__DataLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__User__DataLV__SGSN__MS_decoder(OCTETSTRING& input_stream, CP__User__DataLV__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__User__DataLV__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void CP__DATA__SGSN__MS_encoder(const CP__DATA__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_DATA_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CP__DATA__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CP__DATA__SGSN__MS_decoder(OCTETSTRING& input_stream, CP__DATA__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.CP_DATA_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CP__DATA__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__SMS__SGSN__MS_encoder(const L3__SMS__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.L3_SMS_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(L3__SMS__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__SMS__SGSN__MS_decoder(OCTETSTRING& input_stream, L3__SMS__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_SMS_Types.L3_SMS_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(L3__SMS__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("MobileL3_SMS_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MobileL3_SMS_Types");
General__Types::module_object.pre_init_module();
module_object.add_function("enc_TPDU_RP_DATA_MS_SGSN_fast", (genericfunc_t)&enc__TPDU__RP__DATA__MS__SGSN__fast, NULL);
module_object.add_function("dec_TPDU_RP_DATA_MS_SGSN_backtrack", (genericfunc_t)&dec__TPDU__RP__DATA__MS__SGSN__backtrack, NULL);
module_object.add_function("enc_TPDU_RP_DATA_SGSN_MS_fast", (genericfunc_t)&enc__TPDU__RP__DATA__SGSN__MS__fast, NULL);
module_object.add_function("dec_TPDU_RP_DATA_SGSN_MS_backtrack", (genericfunc_t)&dec__TPDU__RP__DATA__SGSN__MS__backtrack, NULL);
module_object.add_function("enc_TPDU_RP_ACK_MS_SGSN_fast", (genericfunc_t)&enc__TPDU__RP__ACK__MS__SGSN__fast, NULL);
module_object.add_function("dec_TPDU_RP_ACK_MS_SGSN_backtrack", (genericfunc_t)&dec__TPDU__RP__ACK__MS__SGSN__backtrack, NULL);
module_object.add_function("enc_TPDU_RP_ACK_SGSN_MS_fast", (genericfunc_t)&enc__TPDU__RP__ACK__SGSN__MS__fast, NULL);
module_object.add_function("dec_TPDU_RP_ACK_SGSN_MS_backtrack", (genericfunc_t)&dec__TPDU__RP__ACK__SGSN__MS__backtrack, NULL);
module_object.add_function("enc_TPDU_RP_ERROR_MS_SGSN_fast", (genericfunc_t)&enc__TPDU__RP__ERROR__MS__SGSN__fast, NULL);
module_object.add_function("dec_TPDU_RP_ERROR_MS_SGSN_backtrack", (genericfunc_t)&dec__TPDU__RP__ERROR__MS__SGSN__backtrack, NULL);
module_object.add_function("enc_TPDU_RP_ERROR_SGSN_MS_fast", (genericfunc_t)&enc__TPDU__RP__ERROR__SGSN__MS__fast, NULL);
module_object.add_function("dec_TPDU_RP_ERROR_SGSN_MS_backtrack", (genericfunc_t)&dec__TPDU__RP__ERROR__SGSN__MS__backtrack, NULL);
module_object.add_function("enc_RPDU_SGSN_MS_fast", (genericfunc_t)&enc__RPDU__SGSN__MS__fast, NULL);
module_object.add_function("dec_RPDU_SGSN_MS_backtrack", (genericfunc_t)&dec__RPDU__SGSN__MS__backtrack, NULL);
module_object.add_function("enc_RPDU_MS_SGSN_fast", (genericfunc_t)&enc__RPDU__MS__SGSN__fast, NULL);
module_object.add_function("dec_RPDU_MS_SGSN_backtrack", (genericfunc_t)&dec__RPDU__MS__SGSN__backtrack, NULL);
}

void post_init_module()
{
TTCN_Location current_location("MobileL3_SMS_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MobileL3_SMS_Types");
General__Types::module_object.post_init_module();
}


} /* end of namespace */
