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

/* Literal string constants */

const unsigned char bs_3_bits[] = { 0 },
bs_10_bits[] = { 0 },
bs_13_bits[] = { 128 },
bs_14_bits[] = { 32 },
bs_15_bits[] = { 8 },
bs_5_bits[] = { 4 },
bs_0_bits[] = { 2 },
bs_11_bits[] = { 2 },
bs_7_bits[] = { 6 },
bs_4_bits[] = { 1 },
bs_1_bits[] = { 1 },
bs_12_bits[] = { 1 },
bs_6_bits[] = { 65 },
bs_8_bits[] = { 5 },
bs_2_bits[] = { 3 },
bs_9_bits[] = { 3 };
extern const BITSTRING bs_3(2, bs_3_bits),
bs_10(3, bs_10_bits),
bs_13(8, bs_13_bits),
bs_14(8, bs_14_bits),
bs_15(8, bs_15_bits),
bs_5(3, bs_5_bits),
bs_0(2, bs_0_bits),
bs_11(3, bs_11_bits),
bs_7(3, bs_7_bits),
bs_4(1, bs_4_bits),
bs_1(2, bs_1_bits),
bs_12(3, bs_12_bits),
bs_6(7, bs_6_bits),
bs_8(3, bs_8_bits),
bs_2(2, bs_2_bits),
bs_9(3, bs_9_bits);
const unsigned char pp_0[] = { 0xff };
const unsigned char module_checksum[] = { 0x45, 0xc1, 0x80, 0xa5, 0x73, 0xad, 0x6e, 0xae, 0x24, 0x26, 0x2f, 0x5e, 0xc0, 0xb9, 0x43, 0x5a };

/* Global variable definitions */

const TTCN_RAWdescriptor_t L3__SMS__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for L3__SMS__MS__SGSN
const TTCN_Typedescriptor_t L3__SMS__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.L3_SMS_MS_SGSN", NULL, &L3__SMS__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       CP__DATA__MS__SGSN_cP__messageType_xer_ = { {"cP_messageType>\n", "cP_messageType>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CP__DATA__MS__SGSN_cP__messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CP__DATA__MS__SGSN_cP__messageType_descr_ = { "@MobileL3_SMS_Types.CP_DATA_MS_SGSN.cP_messageType", &BITSTRING_ber_, &General__Types::BIT8_raw_, NULL, &CP__DATA__MS__SGSN_cP__messageType_xer_, &BITSTRING_json_, &CP__DATA__MS__SGSN_cP__messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__DATA__MS__SGSN_cP__messageType_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__User__DataLV__MS__SGSN_lengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CP__User__DataLV__MS__SGSN_lengthIndicator_xer_ = { {"lengthIndicator>\n", "lengthIndicator>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CP__User__DataLV__MS__SGSN_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CP__User__DataLV__MS__SGSN_lengthIndicator_descr_ = { "@MobileL3_SMS_Types.CP_User_DataLV_MS_SGSN.lengthIndicator", &INTEGER_ber_, &CP__User__DataLV__MS__SGSN_lengthIndicator_raw_, &INTEGER_text_, &CP__User__DataLV__MS__SGSN_lengthIndicator_xer_, &INTEGER_json_, &CP__User__DataLV__MS__SGSN_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__User__DataLV__MS__SGSN_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t RPDU__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RPDU__MS__SGSN
const TTCN_Typedescriptor_t RPDU__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.RPDU_MS_SGSN", NULL, &RPDU__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       RP__DATA__MS__SGSN_rP__MTI_xer_ = { {"rP_MTI>\n", "rP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__DATA__MS__SGSN_rP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__DATA__MS__SGSN_rP__MTI_descr_ = { "@MobileL3_SMS_Types.RP_DATA_MS_SGSN.rP_MTI", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__DATA__MS__SGSN_rP__MTI_xer_, &BITSTRING_json_, &RP__DATA__MS__SGSN_rP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__MS__SGSN_rP__MTI_default_coding("RAW");
const XERdescriptor_t       RP__DATA__MS__SGSN_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__DATA__MS__SGSN_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__DATA__MS__SGSN_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_DATA_MS_SGSN.rP_Spare", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &RP__DATA__MS__SGSN_rP__Spare_xer_, &BITSTRING_json_, &RP__DATA__MS__SGSN_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__MS__SGSN_rP__Spare_default_coding("RAW");
const XERdescriptor_t       RP__DATA__MS__SGSN_rP__MessageReference_xer_ = { {"rP_MessageReference>\n", "rP_MessageReference>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__DATA__MS__SGSN_rP__MessageReference_oer_ext_arr_[0] = {};
const int RP__DATA__MS__SGSN_rP__MessageReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__DATA__MS__SGSN_rP__MessageReference_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__DATA__MS__SGSN_rP__MessageReference_oer_ext_arr_, 0, RP__DATA__MS__SGSN_rP__MessageReference_oer_p_};
const TTCN_Typedescriptor_t RP__DATA__MS__SGSN_rP__MessageReference_descr_ = { "@MobileL3_SMS_Types.RP_DATA_MS_SGSN.rP_MessageReference", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__DATA__MS__SGSN_rP__MessageReference_xer_, &OCTETSTRING_json_, &RP__DATA__MS__SGSN_rP__MessageReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__MS__SGSN_rP__MessageReference_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__OriginatorAddressLV_lengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__OriginatorAddressLV_lengthIndicator_xer_ = { {"lengthIndicator>\n", "lengthIndicator>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__OriginatorAddressLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__OriginatorAddressLV_lengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_OriginatorAddressLV.lengthIndicator", &INTEGER_ber_, &RP__OriginatorAddressLV_lengthIndicator_raw_, &INTEGER_text_, &RP__OriginatorAddressLV_lengthIndicator_xer_, &INTEGER_json_, &RP__OriginatorAddressLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__OriginatorAddressLV_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__OriginatorAddressLV_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__OriginatorAddressLV
const TTCN_Typedescriptor_t RP__OriginatorAddressLV_descr_ = { "@MobileL3_SMS_Types.RP_OriginatorAddressLV", NULL, &RP__OriginatorAddressLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       RP__NumberingPlan__and__NumberDigits_rP__NumberingPlanIdentification_xer_ = { {"rP_NumberingPlanIdentification>\n", "rP_NumberingPlanIdentification>\n"}, {32, 32}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__NumberingPlan__and__NumberDigits_rP__NumberingPlanIdentification_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__NumberingPlan__and__NumberDigits_rP__NumberingPlanIdentification_descr_ = { "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.rP_NumberingPlanIdentification", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &RP__NumberingPlan__and__NumberDigits_rP__NumberingPlanIdentification_xer_, &BITSTRING_json_, &RP__NumberingPlan__and__NumberDigits_rP__NumberingPlanIdentification_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__NumberingPlan__and__NumberDigits_rP__NumberingPlanIdentification_default_coding("RAW");
const XERdescriptor_t       RP__NumberingPlan__and__NumberDigits_rP__TypeOfNumber_xer_ = { {"rP_TypeOfNumber>\n", "rP_TypeOfNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__NumberingPlan__and__NumberDigits_rP__TypeOfNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__NumberingPlan__and__NumberDigits_rP__TypeOfNumber_descr_ = { "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.rP_TypeOfNumber", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__NumberingPlan__and__NumberDigits_rP__TypeOfNumber_xer_, &BITSTRING_json_, &RP__NumberingPlan__and__NumberDigits_rP__TypeOfNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__NumberingPlan__and__NumberDigits_rP__TypeOfNumber_default_coding("RAW");
const XERdescriptor_t       RP__NumberingPlan__and__NumberDigits_rP__Ext_xer_ = { {"rP_Ext>\n", "rP_Ext>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__NumberingPlan__and__NumberDigits_rP__Ext_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__NumberingPlan__and__NumberDigits_rP__Ext_descr_ = { "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.rP_Ext", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &RP__NumberingPlan__and__NumberDigits_rP__Ext_xer_, &BITSTRING_json_, &RP__NumberingPlan__and__NumberDigits_rP__Ext_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__NumberingPlan__and__NumberDigits_rP__Ext_default_coding("RAW");
const XERdescriptor_t       RP__NumberingPlan__and__NumberDigits_rP__NumberDigits_xer_ = { {"rP_NumberDigits>\n", "rP_NumberDigits>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t RP__NumberingPlan__and__NumberDigits_rP__NumberDigits_descr_ = { "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.rP_NumberDigits", NULL, &HEXSTRING_raw_, NULL, &RP__NumberingPlan__and__NumberDigits_rP__NumberDigits_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__NumberingPlan__and__NumberDigits_rP__NumberDigits_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__NumberingPlan__and__NumberDigits_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__NumberingPlan__and__NumberDigits
const TTCN_Typedescriptor_t RP__NumberingPlan__and__NumberDigits_descr_ = { "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits", NULL, &RP__NumberingPlan__and__NumberDigits_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__NumberingPlan__and__NumberDigits_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__OriginatorAddressLV_rP__OriginatorAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__OriginatorAddressLV_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__MS__SGSN_rP__OriginatorAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DestinationAddressLV_lengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__DestinationAddressLV_lengthIndicator_xer_ = { {"lengthIndicator>\n", "lengthIndicator>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__DestinationAddressLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__DestinationAddressLV_lengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_DestinationAddressLV.lengthIndicator", &INTEGER_ber_, &RP__DestinationAddressLV_lengthIndicator_raw_, &INTEGER_text_, &RP__DestinationAddressLV_lengthIndicator_xer_, &INTEGER_json_, &RP__DestinationAddressLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DestinationAddressLV_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DestinationAddressLV_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__DestinationAddressLV
const TTCN_Typedescriptor_t RP__DestinationAddressLV_descr_ = { "@MobileL3_SMS_Types.RP_DestinationAddressLV", NULL, &RP__DestinationAddressLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DestinationAddressLV_rP__DestinationAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DestinationAddressLV_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__MS__SGSN_rP__DestinationAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_xer_ = { {"rP_LengthIndicator>\n", "rP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_DATA_User_DataLV_MS_SGSN.rP_LengthIndicator", &INTEGER_ber_, &RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_raw_, &INTEGER_text_, &RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_xer_, &INTEGER_json_, &RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__User__DataLV__MS__SGSN_rP__LengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t TPDU__RP__DATA__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TPDU__RP__DATA__MS__SGSN
const TTCN_Typedescriptor_t TPDU__RP__DATA__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN", NULL, &TPDU__RP__DATA__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SMS__SUBMIT_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__SUBMIT_tP__MTI_xer_, &BITSTRING_json_, &SMS__SUBMIT_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__RD_xer_ = { {"tP_RD>\n", "tP_RD>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__RD_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__RD_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_RD", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT_tP__RD_xer_, &BITSTRING_json_, &SMS__SUBMIT_tP__RD_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__RD_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__VPF_xer_ = { {"tP_VPF>\n", "tP_VPF>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__VPF_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__VPF_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_VPF", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__SUBMIT_tP__VPF_xer_, &BITSTRING_json_, &SMS__SUBMIT_tP__VPF_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__VPF_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__SRR_xer_ = { {"tP_SRR>\n", "tP_SRR>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__SRR_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__SRR_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_SRR", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT_tP__SRR_xer_, &BITSTRING_json_, &SMS__SUBMIT_tP__SRR_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__SRR_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT_tP__UDHI_xer_, &BITSTRING_json_, &SMS__SUBMIT_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__RP_xer_ = { {"tP_RP>\n", "tP_RP>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__RP_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__RP_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_RP", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT_tP__RP_xer_, &BITSTRING_json_, &SMS__SUBMIT_tP__RP_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__RP_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__MR_xer_ = { {"tP_MR>\n", "tP_MR>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT_tP__MR_oer_ext_arr_[0] = {};
const int SMS__SUBMIT_tP__MR_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__MR_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT_tP__MR_oer_ext_arr_, 0, SMS__SUBMIT_tP__MR_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__MR_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_MR", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__SUBMIT_tP__MR_xer_, &OCTETSTRING_json_, &SMS__SUBMIT_tP__MR_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__MR_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__DA__NoPad_tP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,4,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       TP__DA__NoPad_tP__LengthIndicator_xer_ = { {"tP_LengthIndicator>\n", "tP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__DA__NoPad_tP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__DA__NoPad_tP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.TP_DA_NoPad.tP_LengthIndicator", &INTEGER_ber_, &TP__DA__NoPad_tP__LengthIndicator_raw_, &INTEGER_text_, &TP__DA__NoPad_tP__LengthIndicator_xer_, &INTEGER_json_, &TP__DA__NoPad_tP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DA__NoPad_tP__LengthIndicator_default_coding("RAW");
const XERdescriptor_t       TP__DA__NoPad_tP__NumberingPlanID_xer_ = { {"tP_NumberingPlanID>\n", "tP_NumberingPlanID>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__DA__NoPad_tP__NumberingPlanID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__DA__NoPad_tP__NumberingPlanID_descr_ = { "@MobileL3_SMS_Types.TP_DA_NoPad.tP_NumberingPlanID", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &TP__DA__NoPad_tP__NumberingPlanID_xer_, &BITSTRING_json_, &TP__DA__NoPad_tP__NumberingPlanID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DA__NoPad_tP__NumberingPlanID_default_coding("RAW");
const XERdescriptor_t       TP__DA__NoPad_tP__TypeOfNumber_xer_ = { {"tP_TypeOfNumber>\n", "tP_TypeOfNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__DA__NoPad_tP__TypeOfNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__DA__NoPad_tP__TypeOfNumber_descr_ = { "@MobileL3_SMS_Types.TP_DA_NoPad.tP_TypeOfNumber", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &TP__DA__NoPad_tP__TypeOfNumber_xer_, &BITSTRING_json_, &TP__DA__NoPad_tP__TypeOfNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DA__NoPad_tP__TypeOfNumber_default_coding("RAW");
const XERdescriptor_t       TP__DA__NoPad_tp__Spare_xer_ = { {"tp_Spare>\n", "tp_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__DA__NoPad_tp__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__DA__NoPad_tp__Spare_descr_ = { "@MobileL3_SMS_Types.TP_DA_NoPad.tp_Spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TP__DA__NoPad_tp__Spare_xer_, &BITSTRING_json_, &TP__DA__NoPad_tp__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DA__NoPad_tp__Spare_default_coding("RAW");
const XERdescriptor_t       TP__DA__NoPad_tP__DAValue_xer_ = { {"tP_DAValue>\n", "tP_DAValue>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TP__DA__NoPad_tP__DAValue_descr_ = { "@MobileL3_SMS_Types.TP_DA_NoPad.tP_DAValue", NULL, &HEXSTRING_raw_, NULL, &TP__DA__NoPad_tP__DAValue_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DA__NoPad_tP__DAValue_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__DA__NoPad_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__DA__NoPad
const TTCN_Typedescriptor_t TP__DA__NoPad_descr_ = { "@MobileL3_SMS_Types.TP_DA_NoPad", NULL, &TP__DA__NoPad_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DA__NoPad_default_coding("RAW");
UNIVERSAL_CHARSTRING TP__DA_tP__DA__NoPad_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__DA_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__DA
const TTCN_Typedescriptor_t TP__DA_descr_ = { "@MobileL3_SMS_Types.TP_DA", NULL, &TP__DA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DA_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__DA_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT_tP__PID_oer_ext_arr_[0] = {};
const int SMS__SUBMIT_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT_tP__PID_oer_ext_arr_, 0, SMS__SUBMIT_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_PID", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__SUBMIT_tP__PID_xer_, &OCTETSTRING_json_, &SMS__SUBMIT_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__PID_default_coding("RAW");
const XERdescriptor_t       TP__DCS_xer_ = { {"TP_DCS>\n", "TP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TP__DCS_oer_ext_arr_[0] = {};
const int TP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t TP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TP__DCS_oer_ext_arr_, 0, TP__DCS_oer_p_};
const TTCN_Typedescriptor_t TP__DCS_descr_ = { "@MobileL3_SMS_Types.TP_DCS", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TP__DCS_xer_, &OCTETSTRING_json_, &TP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__DCS_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT_tP__DCS_xer_ = { {"tP_DCS>\n", "tP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT_tP__DCS_oer_ext_arr_[0] = {};
const int SMS__SUBMIT_tP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT_tP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT_tP__DCS_oer_ext_arr_, 0, SMS__SUBMIT_tP__DCS_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_DCS", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__SUBMIT_tP__DCS_xer_, &OCTETSTRING_json_, &SMS__SUBMIT_tP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__DCS_default_coding("RAW");
const XERdescriptor_t       TP__UDL__UD_tP__LengthIndicator_xer_ = { {"tP_LengthIndicator>\n", "tP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TP__UDL__UD_tP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.TP_UDL_UD.tP_LengthIndicator", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TP__UDL__UD_tP__LengthIndicator_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__UDL__UD_tP__LengthIndicator_default_coding("RAW");
const XERdescriptor_t       TP__UDL__UD_tP__UD_xer_ = { {"tP_UD>\n", "tP_UD>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TP__UDL__UD_tP__UD_oer_ext_arr_[0] = {};
const int TP__UDL__UD_tP__UD_oer_p_[0] = {};
const TTCN_OERdescriptor_t TP__UDL__UD_tP__UD_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TP__UDL__UD_tP__UD_oer_ext_arr_, 0, TP__UDL__UD_tP__UD_oer_p_};
const TTCN_Typedescriptor_t TP__UDL__UD_tP__UD_descr_ = { "@MobileL3_SMS_Types.TP_UDL_UD.tP_UD", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &TP__UDL__UD_tP__UD_xer_, &OCTETSTRING_json_, &TP__UDL__UD_tP__UD_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__UDL__UD_tP__UD_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__UDL__UD_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__UDL__UD
const TTCN_Typedescriptor_t TP__UDL__UD_descr_ = { "@MobileL3_SMS_Types.TP_UDL_UD", NULL, &TP__UDL__UD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__UDL__UD_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__UDL__UD_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__SUBMIT
const TTCN_Typedescriptor_t SMS__SUBMIT_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT", NULL, &SMS__SUBMIT_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t TP__VP_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__VP
const TTCN_Typedescriptor_t TP__VP_descr_ = { "@MobileL3_SMS_Types.TP_VP", NULL, &TP__VP_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       TP__VP_tP__VP__relative__format_xer_ = { {"tP_VP_relative_format>\n", "tP_VP_relative_format>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TP__VP_tP__VP__relative__format_oer_ext_arr_[0] = {};
const int TP__VP_tP__VP__relative__format_oer_p_[0] = {};
const TTCN_OERdescriptor_t TP__VP_tP__VP__relative__format_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TP__VP_tP__VP__relative__format_oer_ext_arr_, 0, TP__VP_tP__VP__relative__format_oer_p_};
const TTCN_Typedescriptor_t TP__VP_tP__VP__relative__format_descr_ = { "@MobileL3_SMS_Types.TP_VP.tP_VP_relative_format", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TP__VP_tP__VP__relative__format_xer_, &OCTETSTRING_json_, &TP__VP_tP__VP__relative__format_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__VP_tP__VP__relative__format_default_coding("RAW");
const XERdescriptor_t       TP__VP_tP__VP__enhanced__format_xer_ = { {"tP_VP_enhanced_format>\n", "tP_VP_enhanced_format>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TP__VP_tP__VP__enhanced__format_oer_ext_arr_[0] = {};
const int TP__VP_tP__VP__enhanced__format_oer_p_[0] = {};
const TTCN_OERdescriptor_t TP__VP_tP__VP__enhanced__format_oer_ = { -1, TRUE, 7, FALSE, 0, 0, TP__VP_tP__VP__enhanced__format_oer_ext_arr_, 0, TP__VP_tP__VP__enhanced__format_oer_p_};
const TTCN_Typedescriptor_t TP__VP_tP__VP__enhanced__format_descr_ = { "@MobileL3_SMS_Types.TP_VP.tP_VP_enhanced_format", &OCTETSTRING_ber_, &General__Types::OCT7_raw_, &OCTETSTRING_text_, &TP__VP_tP__VP__enhanced__format_xer_, &OCTETSTRING_json_, &TP__VP_tP__VP__enhanced__format_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__VP_tP__VP__enhanced__format_default_coding("RAW");
const XERdescriptor_t       TP__VP_tP__VP__absolute__format_xer_ = { {"tP_VP_absolute_format>\n", "tP_VP_absolute_format>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TP__VP_tP__VP__absolute__format_oer_ext_arr_[0] = {};
const int TP__VP_tP__VP__absolute__format_oer_p_[0] = {};
const TTCN_OERdescriptor_t TP__VP_tP__VP__absolute__format_oer_ = { -1, TRUE, 7, FALSE, 0, 0, TP__VP_tP__VP__absolute__format_oer_ext_arr_, 0, TP__VP_tP__VP__absolute__format_oer_p_};
const TTCN_Typedescriptor_t TP__VP_tP__VP__absolute__format_descr_ = { "@MobileL3_SMS_Types.TP_VP.tP_VP_absolute_format", &OCTETSTRING_ber_, &General__Types::OCT7_raw_, &OCTETSTRING_text_, &TP__VP_tP__VP__absolute__format_xer_, &OCTETSTRING_json_, &TP__VP_tP__VP__absolute__format_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__VP_tP__VP__absolute__format_default_coding("RAW");
UNIVERSAL_CHARSTRING TP__VP_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT_tP__VP_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__SUBMIT_tP__VP
const TTCN_Typedescriptor_t SMS__SUBMIT_tP__VP_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT.tP_VP", NULL, &SMS__SUBMIT_tP__VP_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT_tP__VP_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__SUBMIT_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__DATA__MS__SGSN_sMS__SUBMIT_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__COMMAND_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__COMMAND_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__COMMAND_tP__MTI_xer_, &BITSTRING_json_, &SMS__COMMAND_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__Spare1_xer_ = { {"tP_Spare1>\n", "tP_Spare1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__COMMAND_tP__Spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__COMMAND_tP__Spare1_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_Spare1", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &SMS__COMMAND_tP__Spare1_xer_, &BITSTRING_json_, &SMS__COMMAND_tP__Spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__Spare1_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__SRR_xer_ = { {"tP_SRR>\n", "tP_SRR>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__COMMAND_tP__SRR_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__COMMAND_tP__SRR_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_SRR", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__COMMAND_tP__SRR_xer_, &BITSTRING_json_, &SMS__COMMAND_tP__SRR_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__SRR_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__COMMAND_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__COMMAND_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__COMMAND_tP__UDHI_xer_, &BITSTRING_json_, &SMS__COMMAND_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__Spare2_xer_ = { {"tP_Spare2>\n", "tP_Spare2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__COMMAND_tP__Spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__COMMAND_tP__Spare2_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_Spare2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__COMMAND_tP__Spare2_xer_, &BITSTRING_json_, &SMS__COMMAND_tP__Spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__Spare2_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__MR_xer_ = { {"tP_MR>\n", "tP_MR>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__COMMAND_tP__MR_oer_ext_arr_[0] = {};
const int SMS__COMMAND_tP__MR_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__COMMAND_tP__MR_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__COMMAND_tP__MR_oer_ext_arr_, 0, SMS__COMMAND_tP__MR_oer_p_};
const TTCN_Typedescriptor_t SMS__COMMAND_tP__MR_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_MR", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__COMMAND_tP__MR_xer_, &OCTETSTRING_json_, &SMS__COMMAND_tP__MR_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__MR_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__COMMAND_tP__PID_oer_ext_arr_[0] = {};
const int SMS__COMMAND_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__COMMAND_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__COMMAND_tP__PID_oer_ext_arr_, 0, SMS__COMMAND_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__COMMAND_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_PID", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__COMMAND_tP__PID_xer_, &OCTETSTRING_json_, &SMS__COMMAND_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__PID_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__CT_xer_ = { {"tP_CT>\n", "tP_CT>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__COMMAND_tP__CT_oer_ext_arr_[0] = {};
const int SMS__COMMAND_tP__CT_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__COMMAND_tP__CT_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__COMMAND_tP__CT_oer_ext_arr_, 0, SMS__COMMAND_tP__CT_oer_p_};
const TTCN_Typedescriptor_t SMS__COMMAND_tP__CT_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_CT", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__COMMAND_tP__CT_xer_, &OCTETSTRING_json_, &SMS__COMMAND_tP__CT_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__CT_default_coding("RAW");
const XERdescriptor_t       SMS__COMMAND_tP__MN_xer_ = { {"tP_MN>\n", "tP_MN>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__COMMAND_tP__MN_oer_ext_arr_[0] = {};
const int SMS__COMMAND_tP__MN_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__COMMAND_tP__MN_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__COMMAND_tP__MN_oer_ext_arr_, 0, SMS__COMMAND_tP__MN_oer_p_};
const TTCN_Typedescriptor_t SMS__COMMAND_tP__MN_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND.tP_MN", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__COMMAND_tP__MN_xer_, &OCTETSTRING_json_, &SMS__COMMAND_tP__MN_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__MN_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__DA_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__CDL__CD_tP__CDL_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       TP__CDL__CD_tP__CDL_xer_ = { {"tP_CDL>\n", "tP_CDL>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__CDL__CD_tP__CDL_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__CDL__CD_tP__CDL_descr_ = { "@MobileL3_SMS_Types.TP_CDL_CD.tP_CDL", &INTEGER_ber_, &TP__CDL__CD_tP__CDL_raw_, &INTEGER_text_, &TP__CDL__CD_tP__CDL_xer_, &INTEGER_json_, &TP__CDL__CD_tP__CDL_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__CDL__CD_tP__CDL_default_coding("RAW");
const XERdescriptor_t       TP__CDL__CD_tP__CD_xer_ = { {"tP_CD>\n", "tP_CD>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TP__CDL__CD_tP__CD_oer_ext_arr_[0] = {};
const int TP__CDL__CD_tP__CD_oer_p_[0] = {};
const TTCN_OERdescriptor_t TP__CDL__CD_tP__CD_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TP__CDL__CD_tP__CD_oer_ext_arr_, 0, TP__CDL__CD_tP__CD_oer_p_};
const TTCN_Typedescriptor_t TP__CDL__CD_tP__CD_descr_ = { "@MobileL3_SMS_Types.TP_CDL_CD.tP_CD", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &TP__CDL__CD_tP__CD_xer_, &OCTETSTRING_json_, &TP__CDL__CD_tP__CD_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__CDL__CD_tP__CD_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__CDL__CD_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__CDL__CD
const TTCN_Typedescriptor_t TP__CDL__CD_descr_ = { "@MobileL3_SMS_Types.TP_CDL_CD", NULL, &TP__CDL__CD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__CDL__CD_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__COMMAND_tP__CDL__CD_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__COMMAND_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__COMMAND
const TTCN_Typedescriptor_t SMS__COMMAND_descr_ = { "@MobileL3_SMS_Types.SMS_COMMAND", NULL, &SMS__COMMAND_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__COMMAND_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__DATA__MS__SGSN_sMS__COMMAND_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__DATA__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__User__DataLV__MS__SGSN_rP__TPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DATA__User__DataLV__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__DATA__User__DataLV__MS__SGSN
const TTCN_Typedescriptor_t RP__DATA__User__DataLV__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.RP_DATA_User_DataLV_MS_SGSN", NULL, &RP__DATA__User__DataLV__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__User__DataLV__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__MS__SGSN_rP__User__Data_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DATA__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__DATA__MS__SGSN
const TTCN_Typedescriptor_t RP__DATA__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.RP_DATA_MS_SGSN", NULL, &RP__DATA__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__MS__SGSN_rP__DATA__MS__SGSN_default_coding("RAW");
const XERdescriptor_t       RP__ACK__MS__SGSN_rP__MTI_xer_ = { {"rP_MTI>\n", "rP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__MS__SGSN_rP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__MS__SGSN_rP__MTI_descr_ = { "@MobileL3_SMS_Types.RP_ACK_MS_SGSN.rP_MTI", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__ACK__MS__SGSN_rP__MTI_xer_, &BITSTRING_json_, &RP__ACK__MS__SGSN_rP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__MS__SGSN_rP__MTI_default_coding("RAW");
const XERdescriptor_t       RP__ACK__MS__SGSN_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__MS__SGSN_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__MS__SGSN_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ACK_MS_SGSN.rP_Spare", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &RP__ACK__MS__SGSN_rP__Spare_xer_, &BITSTRING_json_, &RP__ACK__MS__SGSN_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__MS__SGSN_rP__Spare_default_coding("RAW");
const XERdescriptor_t       RP__ACK__MS__SGSN_rP__MessageReference_xer_ = { {"rP_MessageReference>\n", "rP_MessageReference>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__ACK__MS__SGSN_rP__MessageReference_oer_ext_arr_[0] = {};
const int RP__ACK__MS__SGSN_rP__MessageReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__ACK__MS__SGSN_rP__MessageReference_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__ACK__MS__SGSN_rP__MessageReference_oer_ext_arr_, 0, RP__ACK__MS__SGSN_rP__MessageReference_oer_p_};
const TTCN_Typedescriptor_t RP__ACK__MS__SGSN_rP__MessageReference_descr_ = { "@MobileL3_SMS_Types.RP_ACK_MS_SGSN.rP_MessageReference", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__ACK__MS__SGSN_rP__MessageReference_xer_, &OCTETSTRING_json_, &RP__ACK__MS__SGSN_rP__MessageReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__MS__SGSN_rP__MessageReference_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ACK__MS__SGSN
const TTCN_Typedescriptor_t RP__ACK__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.RP_ACK_MS_SGSN", NULL, &RP__ACK__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN.rP_Spare", &BITSTRING_ber_, &RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_raw_, NULL, &RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_xer_, &BITSTRING_json_, &RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_raw_ = {7,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,7,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_xer_ = { {"rP_UserDataIEI>\n", "rP_UserDataIEI>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN.rP_UserDataIEI", &BITSTRING_ber_, &RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_raw_, NULL, &RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_xer_, &BITSTRING_json_, &RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_xer_ = { {"rP_LengthIndicator>\n", "rP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN.rP_LengthIndicator", &INTEGER_ber_, &RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_raw_, &INTEGER_text_, &RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_xer_, &INTEGER_json_, &RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t TPDU__RP__ACK__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TPDU__RP__ACK__MS__SGSN
const TTCN_Typedescriptor_t TPDU__RP__ACK__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN", NULL, &TPDU__RP__ACK__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__MTI_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare1_xer_ = { {"tP_Spare1>\n", "tP_Spare1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare1_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_Spare1", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare1_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare1_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__UDHI_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare2_xer_ = { {"tP_Spare2>\n", "tP_Spare2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare2_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_Spare2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare2_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__Spare2_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_xer_ = { {"tP_PresenceBitTP_PID>\n", "tP_PresenceBitTP_PID>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_PresenceBitTP_PID", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_xer_ = { {"tP_PresenceBitTP_DCS>\n", "tP_PresenceBitTP_DCS>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_PresenceBitTP_DCS", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_xer_ = { {"tP_PresenceBitTP_UDL>\n", "tP_PresenceBitTP_UDL>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_PresenceBitTP_UDL", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__Reserved_xer_ = { {"tP_Reserved>\n", "tP_Reserved>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__Reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__Reserved_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_Reserved", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__Reserved_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__Reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__Reserved_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__ExtensionBit_xer_ = { {"tP_ExtensionBit>\n", "tP_ExtensionBit>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__ExtensionBit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__ExtensionBit_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_ExtensionBit", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__ExtensionBit_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__ExtensionBit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__ExtensionBit_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__DELIVER__REPORT__in__RP__ACK
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK", NULL, &SMS__DELIVER__REPORT__in__RP__ACK_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_oer_ext_arr_[0] = {};
const int SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_oer_ext_arr_, 0, SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_PID", &OCTETSTRING_ber_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_raw_, &OCTETSTRING_text_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_xer_, &OCTETSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_xer_ = { {"tP_DCS>\n", "tP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_oer_ext_arr_[0] = {};
const int SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_oer_ext_arr_, 0, SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_DCS", &OCTETSTRING_ber_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_raw_, &OCTETSTRING_text_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_xer_, &OCTETSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK.tP_UDL_UD", NULL, &SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ACK_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ACK__MS__SGSN_sMS__DELIVER__REPORT_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ACK__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__MS__SGSN_rP__TPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ACK__User__DataTLV__MS__SGSN
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN", NULL, &RP__ACK__User__DataTLV__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ACK__MS__SGSN_rP__User__Data_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ACK__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__MS__SGSN_rP__ACK__MS__SGSN_default_coding("RAW");
const XERdescriptor_t       RP__ERROR__MS__SGSN_rP__MTI_xer_ = { {"rP_MTI>\n", "rP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__MS__SGSN_rP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__MS__SGSN_rP__MTI_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN.rP_MTI", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__ERROR__MS__SGSN_rP__MTI_xer_, &BITSTRING_json_, &RP__ERROR__MS__SGSN_rP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__MS__SGSN_rP__MTI_default_coding("RAW");
const XERdescriptor_t       RP__ERROR__MS__SGSN_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__MS__SGSN_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__MS__SGSN_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN.rP_Spare", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &RP__ERROR__MS__SGSN_rP__Spare_xer_, &BITSTRING_json_, &RP__ERROR__MS__SGSN_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__MS__SGSN_rP__Spare_default_coding("RAW");
const XERdescriptor_t       RP__ERROR__MS__SGSN_rP__Message__Reference_xer_ = { {"rP_Message_Reference>\n", "rP_Message_Reference>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__ERROR__MS__SGSN_rP__Message__Reference_oer_ext_arr_[0] = {};
const int RP__ERROR__MS__SGSN_rP__Message__Reference_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__ERROR__MS__SGSN_rP__Message__Reference_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__ERROR__MS__SGSN_rP__Message__Reference_oer_ext_arr_, 0, RP__ERROR__MS__SGSN_rP__Message__Reference_oer_p_};
const TTCN_Typedescriptor_t RP__ERROR__MS__SGSN_rP__Message__Reference_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN.rP_Message_Reference", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__ERROR__MS__SGSN_rP__Message__Reference_xer_, &OCTETSTRING_json_, &RP__ERROR__MS__SGSN_rP__Message__Reference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__MS__SGSN_rP__Message__Reference_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__CauseLV_rP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__CauseLV_rP__LengthIndicator_xer_ = { {"rP_LengthIndicator>\n", "rP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__CauseLV_rP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__CauseLV_rP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_CauseLV.rP_LengthIndicator", &INTEGER_ber_, &RP__CauseLV_rP__LengthIndicator_raw_, &INTEGER_text_, &RP__CauseLV_rP__LengthIndicator_xer_, &INTEGER_json_, &RP__CauseLV_rP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__CauseLV_rP__LengthIndicator_default_coding("RAW");
const XERdescriptor_t       RP__CauseV_causeValue_xer_ = { {"causeValue>\n", "causeValue>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__CauseV_causeValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__CauseV_causeValue_descr_ = { "@MobileL3_SMS_Types.RP_CauseV.causeValue", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &RP__CauseV_causeValue_xer_, &BITSTRING_json_, &RP__CauseV_causeValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__CauseV_causeValue_default_coding("RAW");
const XERdescriptor_t       RP__CauseV_ext_xer_ = { {"ext>\n", "ext>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__CauseV_ext_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__CauseV_ext_descr_ = { "@MobileL3_SMS_Types.RP_CauseV.ext", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &RP__CauseV_ext_xer_, &BITSTRING_json_, &RP__CauseV_ext_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__CauseV_ext_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__CauseV_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__CauseV
const TTCN_Typedescriptor_t RP__CauseV_descr_ = { "@MobileL3_SMS_Types.RP_CauseV", NULL, &RP__CauseV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__CauseV_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__CauseLV_rP__CauseV_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__CauseLV_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__CauseLV
const TTCN_Typedescriptor_t RP__CauseLV_descr_ = { "@MobileL3_SMS_Types.RP_CauseLV", NULL, &RP__CauseLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       RP__CauseLV_rP__diagnisticField_xer_ = { {"rP_diagnisticField>\n", "rP_diagnisticField>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__CauseLV_rP__diagnisticField_oer_ext_arr_[0] = {};
const int RP__CauseLV_rP__diagnisticField_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__CauseLV_rP__diagnisticField_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__CauseLV_rP__diagnisticField_oer_ext_arr_, 0, RP__CauseLV_rP__diagnisticField_oer_p_};
const TTCN_Typedescriptor_t RP__CauseLV_rP__diagnisticField_descr_ = { "@MobileL3_SMS_Types.RP_CauseLV.rP_diagnisticField", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__CauseLV_rP__diagnisticField_xer_, &OCTETSTRING_json_, &RP__CauseLV_rP__diagnisticField_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__CauseLV_rP__diagnisticField_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__CauseLV_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__MS__SGSN_rP__CauseLV_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ERROR__MS__SGSN
const TTCN_Typedescriptor_t RP__ERROR__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN", NULL, &RP__ERROR__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN.rP_Spare", &BITSTRING_ber_, &RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_raw_, NULL, &RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_xer_, &BITSTRING_json_, &RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_raw_ = {7,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,7,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_xer_ = { {"rP_UserDataIEI>\n", "rP_UserDataIEI>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN.rP_UserDataIEI", &BITSTRING_ber_, &RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_raw_, NULL, &RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_xer_, &BITSTRING_json_, &RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_xer_ = { {"rP_LengthIndicator>\n", "rP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN.rP_LengthIndicator", &INTEGER_ber_, &RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_raw_, &INTEGER_text_, &RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_xer_, &INTEGER_json_, &RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t TPDU__RP__ERROR__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TPDU__RP__ERROR__MS__SGSN
const TTCN_Typedescriptor_t TPDU__RP__ERROR__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN", NULL, &TPDU__RP__ERROR__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__MTI_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare1_xer_ = { {"tP_Spare1>\n", "tP_Spare1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare1_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_Spare1", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare1_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare1_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDHI_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare2_xer_ = { {"tP_Spare2>\n", "tP_Spare2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare2_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_Spare2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare2_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__Spare2_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_xer_ = { {"tP_FCS>\n", "tP_FCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_oer_ext_arr_[0] = {};
const int SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_oer_ext_arr_, 0, SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_FCS", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_xer_, &OCTETSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__FCS_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_xer_ = { {"tP_PresenceBitTP_PID>\n", "tP_PresenceBitTP_PID>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_PresenceBitTP_PID", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_xer_ = { {"tP_PresenceBitTP_DCS>\n", "tP_PresenceBitTP_DCS>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_PresenceBitTP_DCS", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_xer_ = { {"tP_PresenceBitTP_UDL>\n", "tP_PresenceBitTP_UDL>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_PresenceBitTP_UDL", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__Reserved_xer_ = { {"tP_Reserved>\n", "tP_Reserved>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__Reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__Reserved_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_Reserved", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__Reserved_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__Reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__Reserved_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__ExtensionBit_xer_ = { {"tP_ExtensionBit>\n", "tP_ExtensionBit>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__ExtensionBit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__ExtensionBit_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_ExtensionBit", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__ExtensionBit_xer_, &BITSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__ExtensionBit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__ExtensionBit_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__DELIVER__REPORT__in__RP__ERROR
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR", NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_oer_ext_arr_[0] = {};
const int SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_oer_ext_arr_, 0, SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_PID", &OCTETSTRING_ber_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_raw_, &OCTETSTRING_text_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_xer_, &OCTETSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_xer_ = { {"tP_DCS>\n", "tP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_oer_ext_arr_[0] = {};
const int SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_oer_ext_arr_, 0, SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_DCS", &OCTETSTRING_ber_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_raw_, &OCTETSTRING_text_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_xer_, &OCTETSTRING_json_, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD
const TTCN_Typedescriptor_t SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR.tP_UDL_UD", NULL, &SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__DELIVER__REPORT__in__RP__ERROR_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ERROR__MS__SGSN_sMS__DELIVER__REPORT_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ERROR__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__MS__SGSN_rP__TPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ERROR__User__DataTLV__MS__SGSN
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN", NULL, &RP__ERROR__User__DataTLV__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__MS__SGSN_rP__User__Data_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__MS__SGSN_rP__ERROR__MS__SGSN_default_coding("RAW");
const XERdescriptor_t       RP__SMMA_rP__MTI_xer_ = { {"rP_MTI>\n", "rP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__SMMA_rP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__SMMA_rP__MTI_descr_ = { "@MobileL3_SMS_Types.RP_SMMA.rP_MTI", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__SMMA_rP__MTI_xer_, &BITSTRING_json_, &RP__SMMA_rP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__SMMA_rP__MTI_default_coding("RAW");
const XERdescriptor_t       RP__SMMA_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__SMMA_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__SMMA_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_SMMA.rP_Spare", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &RP__SMMA_rP__Spare_xer_, &BITSTRING_json_, &RP__SMMA_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__SMMA_rP__Spare_default_coding("RAW");
const XERdescriptor_t       RP__SMMA_rP__MessageReference_xer_ = { {"rP_MessageReference>\n", "rP_MessageReference>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__SMMA_rP__MessageReference_oer_ext_arr_[0] = {};
const int RP__SMMA_rP__MessageReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__SMMA_rP__MessageReference_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__SMMA_rP__MessageReference_oer_ext_arr_, 0, RP__SMMA_rP__MessageReference_oer_p_};
const TTCN_Typedescriptor_t RP__SMMA_rP__MessageReference_descr_ = { "@MobileL3_SMS_Types.RP_SMMA.rP_MessageReference", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__SMMA_rP__MessageReference_xer_, &OCTETSTRING_json_, &RP__SMMA_rP__MessageReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__SMMA_rP__MessageReference_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__SMMA_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__SMMA
const TTCN_Typedescriptor_t RP__SMMA_descr_ = { "@MobileL3_SMS_Types.RP_SMMA", NULL, &RP__SMMA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__SMMA_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__MS__SGSN_rP__SMMA_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING CP__User__DataLV__MS__SGSN_cP__RPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__User__DataLV__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CP__User__DataLV__MS__SGSN
const TTCN_Typedescriptor_t CP__User__DataLV__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.CP_User_DataLV_MS_SGSN", NULL, &CP__User__DataLV__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__User__DataLV__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING CP__DATA__MS__SGSN_cP__User__Data_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__DATA__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CP__DATA__MS__SGSN
const TTCN_Typedescriptor_t CP__DATA__MS__SGSN_descr_ = { "@MobileL3_SMS_Types.CP_DATA_MS_SGSN", NULL, &CP__DATA__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__DATA__MS__SGSN_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__MS__SGSN_cP__DATA_default_coding("RAW");
const XERdescriptor_t       CP__ACK_cP__messageType_xer_ = { {"cP_messageType>\n", "cP_messageType>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CP__ACK_cP__messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CP__ACK_cP__messageType_descr_ = { "@MobileL3_SMS_Types.CP_ACK.cP_messageType", &BITSTRING_ber_, &General__Types::BIT8_raw_, NULL, &CP__ACK_cP__messageType_xer_, &BITSTRING_json_, &CP__ACK_cP__messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__ACK_cP__messageType_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__ACK_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CP__ACK
const TTCN_Typedescriptor_t CP__ACK_descr_ = { "@MobileL3_SMS_Types.CP_ACK", NULL, &CP__ACK_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__ACK_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__MS__SGSN_cP__ACK_default_coding("RAW");
const XERdescriptor_t       CP__ERROR_cP__messageType_xer_ = { {"cP_messageType>\n", "cP_messageType>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CP__ERROR_cP__messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CP__ERROR_cP__messageType_descr_ = { "@MobileL3_SMS_Types.CP_ERROR.cP_messageType", &BITSTRING_ber_, &General__Types::BIT8_raw_, NULL, &CP__ERROR_cP__messageType_xer_, &BITSTRING_json_, &CP__ERROR_cP__messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__ERROR_cP__messageType_default_coding("RAW");
const XERdescriptor_t       CP__CauseV_causeValue_xer_ = { {"causeValue>\n", "causeValue>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CP__CauseV_causeValue_oer_ext_arr_[0] = {};
const int CP__CauseV_causeValue_oer_p_[0] = {};
const TTCN_OERdescriptor_t CP__CauseV_causeValue_oer_ = { -1, TRUE, 1, FALSE, 0, 0, CP__CauseV_causeValue_oer_ext_arr_, 0, CP__CauseV_causeValue_oer_p_};
const TTCN_Typedescriptor_t CP__CauseV_causeValue_descr_ = { "@MobileL3_SMS_Types.CP_CauseV.causeValue", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &CP__CauseV_causeValue_xer_, &OCTETSTRING_json_, &CP__CauseV_causeValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__CauseV_causeValue_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__CauseV_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CP__CauseV
const TTCN_Typedescriptor_t CP__CauseV_descr_ = { "@MobileL3_SMS_Types.CP_CauseV", NULL, &CP__CauseV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__CauseV_default_coding("RAW");
UNIVERSAL_CHARSTRING CP__ERROR_cP__Cause_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__ERROR_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CP__ERROR
const TTCN_Typedescriptor_t CP__ERROR_descr_ = { "@MobileL3_SMS_Types.CP_ERROR", NULL, &CP__ERROR_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__ERROR_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__MS__SGSN_cP__ERROR_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__MS__SGSN_default_coding("RAW");
const TTCN_RAWdescriptor_t L3__SMS__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for L3__SMS__SGSN__MS
const TTCN_Typedescriptor_t L3__SMS__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.L3_SMS_SGSN_MS", NULL, &L3__SMS__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       CP__DATA__SGSN__MS_cP__messageType_xer_ = { {"cP_messageType>\n", "cP_messageType>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CP__DATA__SGSN__MS_cP__messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CP__DATA__SGSN__MS_cP__messageType_descr_ = { "@MobileL3_SMS_Types.CP_DATA_SGSN_MS.cP_messageType", &BITSTRING_ber_, &General__Types::BIT8_raw_, NULL, &CP__DATA__SGSN__MS_cP__messageType_xer_, &BITSTRING_json_, &CP__DATA__SGSN__MS_cP__messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__DATA__SGSN__MS_cP__messageType_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__User__DataLV__SGSN__MS_lengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CP__User__DataLV__SGSN__MS_lengthIndicator_xer_ = { {"lengthIndicator>\n", "lengthIndicator>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CP__User__DataLV__SGSN__MS_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CP__User__DataLV__SGSN__MS_lengthIndicator_descr_ = { "@MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS.lengthIndicator", &INTEGER_ber_, &CP__User__DataLV__SGSN__MS_lengthIndicator_raw_, &INTEGER_text_, &CP__User__DataLV__SGSN__MS_lengthIndicator_xer_, &INTEGER_json_, &CP__User__DataLV__SGSN__MS_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__User__DataLV__SGSN__MS_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t RPDU__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RPDU__SGSN__MS
const TTCN_Typedescriptor_t RPDU__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.RPDU_SGSN_MS", NULL, &RPDU__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       RP__DATA__SGSN__MS_rP__MTI_xer_ = { {"rP_MTI>\n", "rP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__DATA__SGSN__MS_rP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__DATA__SGSN__MS_rP__MTI_descr_ = { "@MobileL3_SMS_Types.RP_DATA_SGSN_MS.rP_MTI", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__DATA__SGSN__MS_rP__MTI_xer_, &BITSTRING_json_, &RP__DATA__SGSN__MS_rP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__SGSN__MS_rP__MTI_default_coding("RAW");
const XERdescriptor_t       RP__DATA__SGSN__MS_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__DATA__SGSN__MS_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__DATA__SGSN__MS_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_DATA_SGSN_MS.rP_Spare", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &RP__DATA__SGSN__MS_rP__Spare_xer_, &BITSTRING_json_, &RP__DATA__SGSN__MS_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__SGSN__MS_rP__Spare_default_coding("RAW");
const XERdescriptor_t       RP__DATA__SGSN__MS_rP__MessageReference_xer_ = { {"rP_MessageReference>\n", "rP_MessageReference>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__DATA__SGSN__MS_rP__MessageReference_oer_ext_arr_[0] = {};
const int RP__DATA__SGSN__MS_rP__MessageReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__DATA__SGSN__MS_rP__MessageReference_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__DATA__SGSN__MS_rP__MessageReference_oer_ext_arr_, 0, RP__DATA__SGSN__MS_rP__MessageReference_oer_p_};
const TTCN_Typedescriptor_t RP__DATA__SGSN__MS_rP__MessageReference_descr_ = { "@MobileL3_SMS_Types.RP_DATA_SGSN_MS.rP_MessageReference", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__DATA__SGSN__MS_rP__MessageReference_xer_, &OCTETSTRING_json_, &RP__DATA__SGSN__MS_rP__MessageReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__SGSN__MS_rP__MessageReference_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__SGSN__MS_rP__OriginatorAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__SGSN__MS_rP__DestinationAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_xer_ = { {"rP_LengthIndicator>\n", "rP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS.rP_LengthIndicator", &INTEGER_ber_, &RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_raw_, &INTEGER_text_, &RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_xer_, &INTEGER_json_, &RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__User__DataLV__SGSN__MS_rP__LengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t TPDU__RP__DATA__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TPDU__RP__DATA__SGSN__MS
const TTCN_Typedescriptor_t TPDU__RP__DATA__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.TPDU_RP_DATA_SGSN_MS", NULL, &TPDU__RP__DATA__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SMS__DELIVER_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__DELIVER_tP__MTI_xer_, &BITSTRING_json_, &SMS__DELIVER_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__MMS_xer_ = { {"tP_MMS>\n", "tP_MMS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER_tP__MMS_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER_tP__MMS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_MMS", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER_tP__MMS_xer_, &BITSTRING_json_, &SMS__DELIVER_tP__MMS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__MMS_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__LP_xer_ = { {"tP_LP>\n", "tP_LP>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER_tP__LP_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER_tP__LP_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_LP", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER_tP__LP_xer_, &BITSTRING_json_, &SMS__DELIVER_tP__LP_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__LP_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__Spare_xer_ = { {"tP_Spare>\n", "tP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER_tP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER_tP__Spare_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_Spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER_tP__Spare_xer_, &BITSTRING_json_, &SMS__DELIVER_tP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__Spare_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__SRI_xer_ = { {"tP_SRI>\n", "tP_SRI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER_tP__SRI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER_tP__SRI_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_SRI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER_tP__SRI_xer_, &BITSTRING_json_, &SMS__DELIVER_tP__SRI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__SRI_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER_tP__UDHI_xer_, &BITSTRING_json_, &SMS__DELIVER_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__RP_xer_ = { {"tP_RP>\n", "tP_RP>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__DELIVER_tP__RP_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__DELIVER_tP__RP_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_RP", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__DELIVER_tP__RP_xer_, &BITSTRING_json_, &SMS__DELIVER_tP__RP_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__RP_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__OA__NoPad_tP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,4,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       TP__OA__NoPad_tP__LengthIndicator_xer_ = { {"tP_LengthIndicator>\n", "tP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__OA__NoPad_tP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__OA__NoPad_tP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.TP_OA_NoPad.tP_LengthIndicator", &INTEGER_ber_, &TP__OA__NoPad_tP__LengthIndicator_raw_, &INTEGER_text_, &TP__OA__NoPad_tP__LengthIndicator_xer_, &INTEGER_json_, &TP__OA__NoPad_tP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__OA__NoPad_tP__LengthIndicator_default_coding("RAW");
const XERdescriptor_t       TP__OA__NoPad_tP__NumberingPlanID_xer_ = { {"tP_NumberingPlanID>\n", "tP_NumberingPlanID>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__OA__NoPad_tP__NumberingPlanID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__OA__NoPad_tP__NumberingPlanID_descr_ = { "@MobileL3_SMS_Types.TP_OA_NoPad.tP_NumberingPlanID", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &TP__OA__NoPad_tP__NumberingPlanID_xer_, &BITSTRING_json_, &TP__OA__NoPad_tP__NumberingPlanID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__OA__NoPad_tP__NumberingPlanID_default_coding("RAW");
const XERdescriptor_t       TP__OA__NoPad_tP__TypeOfNumber_xer_ = { {"tP_TypeOfNumber>\n", "tP_TypeOfNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__OA__NoPad_tP__TypeOfNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__OA__NoPad_tP__TypeOfNumber_descr_ = { "@MobileL3_SMS_Types.TP_OA_NoPad.tP_TypeOfNumber", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &TP__OA__NoPad_tP__TypeOfNumber_xer_, &BITSTRING_json_, &TP__OA__NoPad_tP__TypeOfNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__OA__NoPad_tP__TypeOfNumber_default_coding("RAW");
const XERdescriptor_t       TP__OA__NoPad_tp__Spare_xer_ = { {"tp_Spare>\n", "tp_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__OA__NoPad_tp__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__OA__NoPad_tp__Spare_descr_ = { "@MobileL3_SMS_Types.TP_OA_NoPad.tp_Spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TP__OA__NoPad_tp__Spare_xer_, &BITSTRING_json_, &TP__OA__NoPad_tp__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__OA__NoPad_tp__Spare_default_coding("RAW");
const XERdescriptor_t       TP__OA__NoPad_tP__OAValue_xer_ = { {"tP_OAValue>\n", "tP_OAValue>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TP__OA__NoPad_tP__OAValue_descr_ = { "@MobileL3_SMS_Types.TP_OA_NoPad.tP_OAValue", NULL, &HEXSTRING_raw_, NULL, &TP__OA__NoPad_tP__OAValue_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__OA__NoPad_tP__OAValue_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__OA__NoPad_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__OA__NoPad
const TTCN_Typedescriptor_t TP__OA__NoPad_descr_ = { "@MobileL3_SMS_Types.TP_OA_NoPad", NULL, &TP__OA__NoPad_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__OA__NoPad_default_coding("RAW");
UNIVERSAL_CHARSTRING TP__OA_tP__OA__NoPad_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__OA_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__OA
const TTCN_Typedescriptor_t TP__OA_descr_ = { "@MobileL3_SMS_Types.TP_OA", NULL, &TP__OA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__OA_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__OA_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER_tP__PID_oer_ext_arr_[0] = {};
const int SMS__DELIVER_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__DELIVER_tP__PID_oer_ext_arr_, 0, SMS__DELIVER_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_PID", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__DELIVER_tP__PID_xer_, &OCTETSTRING_json_, &SMS__DELIVER_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__PID_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__DCS_xer_ = { {"tP_DCS>\n", "tP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER_tP__DCS_oer_ext_arr_[0] = {};
const int SMS__DELIVER_tP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER_tP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__DELIVER_tP__DCS_oer_ext_arr_, 0, SMS__DELIVER_tP__DCS_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER_tP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_DCS", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__DELIVER_tP__DCS_xer_, &OCTETSTRING_json_, &SMS__DELIVER_tP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__DCS_default_coding("RAW");
const XERdescriptor_t       SMS__DELIVER_tP__SCTS_xer_ = { {"tP_SCTS>\n", "tP_SCTS>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__DELIVER_tP__SCTS_oer_ext_arr_[0] = {};
const int SMS__DELIVER_tP__SCTS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__DELIVER_tP__SCTS_oer_ = { -1, TRUE, 7, FALSE, 0, 0, SMS__DELIVER_tP__SCTS_oer_ext_arr_, 0, SMS__DELIVER_tP__SCTS_oer_p_};
const TTCN_Typedescriptor_t SMS__DELIVER_tP__SCTS_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER.tP_SCTS", &OCTETSTRING_ber_, &General__Types::OCT7_raw_, &OCTETSTRING_text_, &SMS__DELIVER_tP__SCTS_xer_, &OCTETSTRING_json_, &SMS__DELIVER_tP__SCTS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__SCTS_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__DELIVER_tP__UDL__UD_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__DELIVER_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__DELIVER
const TTCN_Typedescriptor_t SMS__DELIVER_descr_ = { "@MobileL3_SMS_Types.SMS_DELIVER", NULL, &SMS__DELIVER_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__DELIVER_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__DATA__SGSN__MS_sMS__DELIVER_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__STATUS__REPORT_tP__MTI_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__MMS_xer_ = { {"tP_MMS>\n", "tP_MMS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__MMS_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__MMS_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_MMS", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__MMS_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__MMS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__MMS_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__LP_xer_ = { {"tP_LP>\n", "tP_LP>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__LP_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__LP_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_LP", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__LP_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__LP_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__LP_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__Spare1_xer_ = { {"tP_Spare1>\n", "tP_Spare1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__Spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__Spare1_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_Spare1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__Spare1_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__Spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__Spare1_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__SRQ_xer_ = { {"tP_SRQ>\n", "tP_SRQ>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__SRQ_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__SRQ_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_SRQ", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__SRQ_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__SRQ_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__SRQ_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__UDHI_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__Spare2_xer_ = { {"tP_Spare2>\n", "tP_Spare2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__Spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__Spare2_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_Spare2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__Spare2_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__Spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__Spare2_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__MR_xer_ = { {"tP_MR>\n", "tP_MR>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__STATUS__REPORT_tP__MR_oer_ext_arr_[0] = {};
const int SMS__STATUS__REPORT_tP__MR_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__MR_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__STATUS__REPORT_tP__MR_oer_ext_arr_, 0, SMS__STATUS__REPORT_tP__MR_oer_p_};
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__MR_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_MR", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__STATUS__REPORT_tP__MR_xer_, &OCTETSTRING_json_, &SMS__STATUS__REPORT_tP__MR_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__MR_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__RA__NoPad_tP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,4,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       TP__RA__NoPad_tP__LengthIndicator_xer_ = { {"tP_LengthIndicator>\n", "tP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__RA__NoPad_tP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__RA__NoPad_tP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.TP_RA_NoPad.tP_LengthIndicator", &INTEGER_ber_, &TP__RA__NoPad_tP__LengthIndicator_raw_, &INTEGER_text_, &TP__RA__NoPad_tP__LengthIndicator_xer_, &INTEGER_json_, &TP__RA__NoPad_tP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__RA__NoPad_tP__LengthIndicator_default_coding("RAW");
const XERdescriptor_t       TP__RA__NoPad_tP__NumberingPlanID_xer_ = { {"tP_NumberingPlanID>\n", "tP_NumberingPlanID>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__RA__NoPad_tP__NumberingPlanID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__RA__NoPad_tP__NumberingPlanID_descr_ = { "@MobileL3_SMS_Types.TP_RA_NoPad.tP_NumberingPlanID", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &TP__RA__NoPad_tP__NumberingPlanID_xer_, &BITSTRING_json_, &TP__RA__NoPad_tP__NumberingPlanID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__RA__NoPad_tP__NumberingPlanID_default_coding("RAW");
const XERdescriptor_t       TP__RA__NoPad_tP__TypeOfNumber_xer_ = { {"tP_TypeOfNumber>\n", "tP_TypeOfNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__RA__NoPad_tP__TypeOfNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__RA__NoPad_tP__TypeOfNumber_descr_ = { "@MobileL3_SMS_Types.TP_RA_NoPad.tP_TypeOfNumber", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &TP__RA__NoPad_tP__TypeOfNumber_xer_, &BITSTRING_json_, &TP__RA__NoPad_tP__TypeOfNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__RA__NoPad_tP__TypeOfNumber_default_coding("RAW");
const XERdescriptor_t       TP__RA__NoPad_tp__Spare_xer_ = { {"tp_Spare>\n", "tp_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TP__RA__NoPad_tp__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TP__RA__NoPad_tp__Spare_descr_ = { "@MobileL3_SMS_Types.TP_RA_NoPad.tp_Spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TP__RA__NoPad_tp__Spare_xer_, &BITSTRING_json_, &TP__RA__NoPad_tp__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__RA__NoPad_tp__Spare_default_coding("RAW");
const XERdescriptor_t       TP__RA__NoPad_tP__RAValue_xer_ = { {"tP_RAValue>\n", "tP_RAValue>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TP__RA__NoPad_tP__RAValue_descr_ = { "@MobileL3_SMS_Types.TP_RA_NoPad.tP_RAValue", NULL, &HEXSTRING_raw_, NULL, &TP__RA__NoPad_tP__RAValue_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__RA__NoPad_tP__RAValue_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__RA__NoPad_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__RA__NoPad
const TTCN_Typedescriptor_t TP__RA__NoPad_descr_ = { "@MobileL3_SMS_Types.TP_RA_NoPad", NULL, &TP__RA__NoPad_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__RA__NoPad_default_coding("RAW");
UNIVERSAL_CHARSTRING TP__RA_tP__RA__NoPad_default_coding("RAW");
const TTCN_RAWdescriptor_t TP__RA_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TP__RA
const TTCN_Typedescriptor_t TP__RA_descr_ = { "@MobileL3_SMS_Types.TP_RA", NULL, &TP__RA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TP__RA_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__RA_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__SCTS_xer_ = { {"tP_SCTS>\n", "tP_SCTS>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__STATUS__REPORT_tP__SCTS_oer_ext_arr_[0] = {};
const int SMS__STATUS__REPORT_tP__SCTS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__SCTS_oer_ = { -1, TRUE, 7, FALSE, 0, 0, SMS__STATUS__REPORT_tP__SCTS_oer_ext_arr_, 0, SMS__STATUS__REPORT_tP__SCTS_oer_p_};
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__SCTS_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_SCTS", &OCTETSTRING_ber_, &General__Types::OCT7_raw_, &OCTETSTRING_text_, &SMS__STATUS__REPORT_tP__SCTS_xer_, &OCTETSTRING_json_, &SMS__STATUS__REPORT_tP__SCTS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__SCTS_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__DT_xer_ = { {"tP_DT>\n", "tP_DT>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__STATUS__REPORT_tP__DT_oer_ext_arr_[0] = {};
const int SMS__STATUS__REPORT_tP__DT_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__DT_oer_ = { -1, TRUE, 7, FALSE, 0, 0, SMS__STATUS__REPORT_tP__DT_oer_ext_arr_, 0, SMS__STATUS__REPORT_tP__DT_oer_p_};
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__DT_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_DT", &OCTETSTRING_ber_, &General__Types::OCT7_raw_, &OCTETSTRING_text_, &SMS__STATUS__REPORT_tP__DT_xer_, &OCTETSTRING_json_, &SMS__STATUS__REPORT_tP__DT_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__DT_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__ST_xer_ = { {"tP_ST>\n", "tP_ST>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__STATUS__REPORT_tP__ST_oer_ext_arr_[0] = {};
const int SMS__STATUS__REPORT_tP__ST_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__ST_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__STATUS__REPORT_tP__ST_oer_ext_arr_, 0, SMS__STATUS__REPORT_tP__ST_oer_p_};
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__ST_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_ST", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__STATUS__REPORT_tP__ST_xer_, &OCTETSTRING_json_, &SMS__STATUS__REPORT_tP__ST_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__ST_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__STATUS__REPORT_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__STATUS__REPORT
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT", NULL, &SMS__STATUS__REPORT_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SMS__STATUS__REPORT_tP__PresenceBitTP__PID_xer_ = { {"tP_PresenceBitTP_PID>\n", "tP_PresenceBitTP_PID>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__PresenceBitTP__PID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__PresenceBitTP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_PresenceBitTP_PID", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__PresenceBitTP__PID_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__PresenceBitTP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__PresenceBitTP__PID_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__PresenceBitTP__DCS_xer_ = { {"tP_PresenceBitTP_DCS>\n", "tP_PresenceBitTP_DCS>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__PresenceBitTP__DCS_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__PresenceBitTP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_PresenceBitTP_DCS", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__PresenceBitTP__DCS_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__PresenceBitTP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__PresenceBitTP__DCS_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__PresenceBitTP__UDL_xer_ = { {"tP_PresenceBitTP_UDL>\n", "tP_PresenceBitTP_UDL>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__PresenceBitTP__UDL_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__PresenceBitTP__UDL_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_PresenceBitTP_UDL", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__PresenceBitTP__UDL_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__PresenceBitTP__UDL_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__PresenceBitTP__UDL_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__Reserved_xer_ = { {"tP_Reserved>\n", "tP_Reserved>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__Reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__Reserved_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_Reserved", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__STATUS__REPORT_tP__Reserved_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__Reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__Reserved_default_coding("RAW");
const XERdescriptor_t       SMS__STATUS__REPORT_tP__ExtensionBit_xer_ = { {"tP_ExtensionBit>\n", "tP_ExtensionBit>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__ExtensionBit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__ExtensionBit_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_ExtensionBit", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__STATUS__REPORT_tP__ExtensionBit_xer_, &BITSTRING_json_, &SMS__STATUS__REPORT_tP__ExtensionBit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__ExtensionBit_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__STATUS__REPORT_tP__PID_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__STATUS__REPORT_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__STATUS__REPORT_tP__PID_oer_ext_arr_[0] = {};
const int SMS__STATUS__REPORT_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__STATUS__REPORT_tP__PID_oer_ext_arr_, 0, SMS__STATUS__REPORT_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_PID", &OCTETSTRING_ber_, &SMS__STATUS__REPORT_tP__PID_raw_, &OCTETSTRING_text_, &SMS__STATUS__REPORT_tP__PID_xer_, &OCTETSTRING_json_, &SMS__STATUS__REPORT_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__PID_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__STATUS__REPORT_tP__DCS_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__STATUS__REPORT_tP__DCS_xer_ = { {"tP_DCS>\n", "tP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__STATUS__REPORT_tP__DCS_oer_ext_arr_[0] = {};
const int SMS__STATUS__REPORT_tP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__STATUS__REPORT_tP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__STATUS__REPORT_tP__DCS_oer_ext_arr_, 0, SMS__STATUS__REPORT_tP__DCS_oer_p_};
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_DCS", &OCTETSTRING_ber_, &SMS__STATUS__REPORT_tP__DCS_raw_, &OCTETSTRING_text_, &SMS__STATUS__REPORT_tP__DCS_xer_, &OCTETSTRING_json_, &SMS__STATUS__REPORT_tP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__DCS_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__STATUS__REPORT_tP__UDL__UD_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__STATUS__REPORT_tP__UDL__UD
const TTCN_Typedescriptor_t SMS__STATUS__REPORT_tP__UDL__UD_descr_ = { "@MobileL3_SMS_Types.SMS_STATUS_REPORT.tP_UDL_UD", NULL, &SMS__STATUS__REPORT_tP__UDL__UD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_tP__UDL__UD_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__STATUS__REPORT_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__DATA__SGSN__MS_sMS__STATUS__REPORT_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__DATA__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__User__DataLV__SGSN__MS_rP__TPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DATA__User__DataLV__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__DATA__User__DataLV__SGSN__MS
const TTCN_Typedescriptor_t RP__DATA__User__DataLV__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.RP_DATA_User_DataLV_SGSN_MS", NULL, &RP__DATA__User__DataLV__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__User__DataLV__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__DATA__SGSN__MS_rP__User__Data_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__DATA__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__DATA__SGSN__MS
const TTCN_Typedescriptor_t RP__DATA__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.RP_DATA_SGSN_MS", NULL, &RP__DATA__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__DATA__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__SGSN__MS_rP__DATA__SGSN__MS_default_coding("RAW");
const XERdescriptor_t       RP__ACK__SGSN__MS_rP__MTI_xer_ = { {"rP_MTI>\n", "rP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__SGSN__MS_rP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__SGSN__MS_rP__MTI_descr_ = { "@MobileL3_SMS_Types.RP_ACK_SGSN_MS.rP_MTI", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__ACK__SGSN__MS_rP__MTI_xer_, &BITSTRING_json_, &RP__ACK__SGSN__MS_rP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__SGSN__MS_rP__MTI_default_coding("RAW");
const XERdescriptor_t       RP__ACK__SGSN__MS_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__SGSN__MS_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__SGSN__MS_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ACK_SGSN_MS.rP_Spare", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &RP__ACK__SGSN__MS_rP__Spare_xer_, &BITSTRING_json_, &RP__ACK__SGSN__MS_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__SGSN__MS_rP__Spare_default_coding("RAW");
const XERdescriptor_t       RP__ACK__SGSN__MS_rP__MessageReference_xer_ = { {"rP_MessageReference>\n", "rP_MessageReference>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__ACK__SGSN__MS_rP__MessageReference_oer_ext_arr_[0] = {};
const int RP__ACK__SGSN__MS_rP__MessageReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__ACK__SGSN__MS_rP__MessageReference_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__ACK__SGSN__MS_rP__MessageReference_oer_ext_arr_, 0, RP__ACK__SGSN__MS_rP__MessageReference_oer_p_};
const TTCN_Typedescriptor_t RP__ACK__SGSN__MS_rP__MessageReference_descr_ = { "@MobileL3_SMS_Types.RP_ACK_SGSN_MS.rP_MessageReference", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__ACK__SGSN__MS_rP__MessageReference_xer_, &OCTETSTRING_json_, &RP__ACK__SGSN__MS_rP__MessageReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__SGSN__MS_rP__MessageReference_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ACK__SGSN__MS
const TTCN_Typedescriptor_t RP__ACK__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.RP_ACK_SGSN_MS", NULL, &RP__ACK__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.rP_Spare", &BITSTRING_ber_, &RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_raw_, NULL, &RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_xer_, &BITSTRING_json_, &RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__SGSN__MS_rP__Spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_raw_ = {7,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,7,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_xer_ = { {"rP_UserDataIEI>\n", "rP_UserDataIEI>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.rP_UserDataIEI", &BITSTRING_ber_, &RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_raw_, NULL, &RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_xer_, &BITSTRING_json_, &RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__SGSN__MS_rP__UserDataIEI_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_xer_ = { {"rP_LengthIndicator>\n", "rP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS.rP_LengthIndicator", &INTEGER_ber_, &RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_raw_, &INTEGER_text_, &RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_xer_, &INTEGER_json_, &RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__SGSN__MS_rP__LengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t TPDU__RP__ACK__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TPDU__RP__ACK__SGSN__MS
const TTCN_Typedescriptor_t TPDU__RP__ACK__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.TPDU_RP_ACK_SGSN_MS", NULL, &TPDU__RP__ACK__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__MTI_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare1_xer_ = { {"tP_Spare1>\n", "tP_Spare1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare1_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_Spare1", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare1_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare1_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDHI_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare2_xer_ = { {"tP_Spare2>\n", "tP_Spare2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare2_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_Spare2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare2_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__Spare2_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_xer_ = { {"tP_PresenceBitTP_PID>\n", "tP_PresenceBitTP_PID>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_PresenceBitTP_PID", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__PID_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_xer_ = { {"tP_PresenceBitTP_DCS>\n", "tP_PresenceBitTP_DCS>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_PresenceBitTP_DCS", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__DCS_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_xer_ = { {"tP_PresenceBitTP_UDL>\n", "tP_PresenceBitTP_UDL>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_PresenceBitTP_UDL", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__PresenceBitTP__UDL_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__Reserved_xer_ = { {"tP_Reserved>\n", "tP_Reserved>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__Reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__Reserved_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_Reserved", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__Reserved_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__Reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__Reserved_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__ExtensionBit_xer_ = { {"tP_ExtensionBit>\n", "tP_ExtensionBit>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__ExtensionBit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__ExtensionBit_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_ExtensionBit", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__ExtensionBit_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__ExtensionBit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__ExtensionBit_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_xer_ = { {"tP_SCTS>\n", "tP_SCTS>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_oer_ext_arr_[0] = {};
const int SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_oer_ = { -1, TRUE, 7, FALSE, 0, 0, SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_oer_ext_arr_, 0, SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_SCTS", &OCTETSTRING_ber_, &General__Types::OCT7_raw_, &OCTETSTRING_text_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_xer_, &OCTETSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__SCTS_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__SUBMIT__REPORT__in__RP__ACK
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK", NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_oer_ext_arr_[0] = {};
const int SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_oer_ext_arr_, 0, SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_PID", &OCTETSTRING_ber_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_raw_, &OCTETSTRING_text_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_xer_, &OCTETSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__PID_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_xer_ = { {"tP_DCS>\n", "tP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_oer_ext_arr_[0] = {};
const int SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_oer_ext_arr_, 0, SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_DCS", &OCTETSTRING_ber_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_raw_, &OCTETSTRING_text_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_xer_, &OCTETSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__DCS_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ACK.tP_UDL_UD", NULL, &SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_tP__UDL__UD_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ACK_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ACK__SGSN__MS_sMS__SUBMIT__REPORT_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ACK__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__SGSN__MS_rP__TPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ACK__User__DataTLV__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ACK__User__DataTLV__SGSN__MS
const TTCN_Typedescriptor_t RP__ACK__User__DataTLV__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_SGSN_MS", NULL, &RP__ACK__User__DataTLV__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ACK__User__DataTLV__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ACK__SGSN__MS_rP__User__Data_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ACK__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__SGSN__MS_rP__ACK__SGSN__MS_default_coding("RAW");
const XERdescriptor_t       RP__ERROR__SGSN__MS_rP__MTI_xer_ = { {"rP_MTI>\n", "rP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__SGSN__MS_rP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__SGSN__MS_rP__MTI_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_SGSN_MS.rP_MTI", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &RP__ERROR__SGSN__MS_rP__MTI_xer_, &BITSTRING_json_, &RP__ERROR__SGSN__MS_rP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__SGSN__MS_rP__MTI_default_coding("RAW");
const XERdescriptor_t       RP__ERROR__SGSN__MS_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__SGSN__MS_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__SGSN__MS_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_SGSN_MS.rP_Spare", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &RP__ERROR__SGSN__MS_rP__Spare_xer_, &BITSTRING_json_, &RP__ERROR__SGSN__MS_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__SGSN__MS_rP__Spare_default_coding("RAW");
const XERdescriptor_t       RP__ERROR__SGSN__MS_rP__Message__Reference_xer_ = { {"rP_Message_Reference>\n", "rP_Message_Reference>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RP__ERROR__SGSN__MS_rP__Message__Reference_oer_ext_arr_[0] = {};
const int RP__ERROR__SGSN__MS_rP__Message__Reference_oer_p_[0] = {};
const TTCN_OERdescriptor_t RP__ERROR__SGSN__MS_rP__Message__Reference_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RP__ERROR__SGSN__MS_rP__Message__Reference_oer_ext_arr_, 0, RP__ERROR__SGSN__MS_rP__Message__Reference_oer_p_};
const TTCN_Typedescriptor_t RP__ERROR__SGSN__MS_rP__Message__Reference_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_SGSN_MS.rP_Message_Reference", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RP__ERROR__SGSN__MS_rP__Message__Reference_xer_, &OCTETSTRING_json_, &RP__ERROR__SGSN__MS_rP__Message__Reference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__SGSN__MS_rP__Message__Reference_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__SGSN__MS_rP__CauseLV_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ERROR__SGSN__MS
const TTCN_Typedescriptor_t RP__ERROR__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_SGSN_MS", NULL, &RP__ERROR__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_xer_ = { {"rP_Spare>\n", "rP_Spare>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.rP_Spare", &BITSTRING_ber_, &RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_raw_, NULL, &RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_xer_, &BITSTRING_json_, &RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__SGSN__MS_rP__Spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_raw_ = {7,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,7,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_xer_ = { {"rP_UserDataIEI>\n", "rP_UserDataIEI>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.rP_UserDataIEI", &BITSTRING_ber_, &RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_raw_, NULL, &RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_xer_, &BITSTRING_json_, &RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__SGSN__MS_rP__UserDataIEI_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_xer_ = { {"rP_LengthIndicator>\n", "rP_LengthIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS.rP_LengthIndicator", &INTEGER_ber_, &RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_raw_, &INTEGER_text_, &RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_xer_, &INTEGER_json_, &RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__SGSN__MS_rP__LengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t TPDU__RP__ERROR__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TPDU__RP__ERROR__SGSN__MS
const TTCN_Typedescriptor_t TPDU__RP__ERROR__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.TPDU_RP_ERROR_SGSN_MS", NULL, &TPDU__RP__ERROR__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__MTI_xer_ = { {"tP_MTI>\n", "tP_MTI>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__MTI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__MTI_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_MTI", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__MTI_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__MTI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__MTI_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare1_xer_ = { {"tP_Spare1>\n", "tP_Spare1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare1_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_Spare1", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare1_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare1_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDHI_xer_ = { {"tP_UDHI>\n", "tP_UDHI>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDHI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDHI_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_UDHI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDHI_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDHI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDHI_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare2_xer_ = { {"tP_Spare2>\n", "tP_Spare2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare2_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_Spare2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare2_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Spare2_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_xer_ = { {"tP_FCS>\n", "tP_FCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_oer_ext_arr_[0] = {};
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_oer_ext_arr_, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_FCS", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_xer_, &OCTETSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__FCS_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_xer_ = { {"tP_PresenceBitTP_PID>\n", "tP_PresenceBitTP_PID>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_PresenceBitTP_PID", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__PID_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_xer_ = { {"tP_PresenceBitTP_DCS>\n", "tP_PresenceBitTP_DCS>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_PresenceBitTP_DCS", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__DCS_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_xer_ = { {"tP_PresenceBitTP_UDL>\n", "tP_PresenceBitTP_UDL>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_PresenceBitTP_UDL", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PresenceBitTP__UDL_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Reserved_xer_ = { {"tP_Reserved>\n", "tP_Reserved>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Reserved_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_Reserved", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Reserved_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__Reserved_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__ExtensionBit_xer_ = { {"tP_ExtensionBit>\n", "tP_ExtensionBit>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__ExtensionBit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__ExtensionBit_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_ExtensionBit", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__ExtensionBit_xer_, &BITSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__ExtensionBit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__ExtensionBit_default_coding("RAW");
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_xer_ = { {"tP_SCTS>\n", "tP_SCTS>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_oer_ext_arr_[0] = {};
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_oer_ = { -1, TRUE, 7, FALSE, 0, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_oer_ext_arr_, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_SCTS", &OCTETSTRING_ber_, &General__Types::OCT7_raw_, &OCTETSTRING_text_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_xer_, &OCTETSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__SCTS_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__SUBMIT__REPORT__in__RP__ERROR
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR", NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_xer_ = { {"tP_PID>\n", "tP_PID>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_oer_ext_arr_[0] = {};
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_oer_ext_arr_, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_PID", &OCTETSTRING_ber_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_raw_, &OCTETSTRING_text_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_xer_, &OCTETSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__PID_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_xer_ = { {"tP_DCS>\n", "tP_DCS>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_oer_ext_arr_[0] = {};
const int SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_oer_p_[0] = {};
const TTCN_OERdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_oer_ext_arr_, 0, SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_oer_p_};
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_DCS", &OCTETSTRING_ber_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_raw_, &OCTETSTRING_text_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_xer_, &OCTETSTRING_json_, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__DCS_default_coding("RAW");
const TTCN_RAWdescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD
const TTCN_Typedescriptor_t SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_descr_ = { "@MobileL3_SMS_Types.SMS_SUBMIT_REPORT_in_RP_ERROR.tP_UDL_UD", NULL, &SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_tP__UDL__UD_default_coding("RAW");
UNIVERSAL_CHARSTRING SMS__SUBMIT__REPORT__in__RP__ERROR_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ERROR__SGSN__MS_sMS__SUBMIT__REPORT_default_coding("RAW");
UNIVERSAL_CHARSTRING TPDU__RP__ERROR__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__SGSN__MS_rP__TPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RP__ERROR__User__DataTLV__SGSN__MS
const TTCN_Typedescriptor_t RP__ERROR__User__DataTLV__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_SGSN_MS", NULL, &RP__ERROR__User__DataTLV__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RP__ERROR__User__DataTLV__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__SGSN__MS_rP__User__Data_default_coding("RAW");
UNIVERSAL_CHARSTRING RP__ERROR__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__SGSN__MS_rP__ERROR__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__SGSN__MS_rP__SMMA_default_coding("RAW");
UNIVERSAL_CHARSTRING RPDU__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING CP__User__DataLV__SGSN__MS_cP__RPDU_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__User__DataLV__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CP__User__DataLV__SGSN__MS
const TTCN_Typedescriptor_t CP__User__DataLV__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.CP_User_DataLV_SGSN_MS", NULL, &CP__User__DataLV__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__User__DataLV__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING CP__DATA__SGSN__MS_cP__User__Data_default_coding("RAW");
const TTCN_RAWdescriptor_t CP__DATA__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CP__DATA__SGSN__MS
const TTCN_Typedescriptor_t CP__DATA__SGSN__MS_descr_ = { "@MobileL3_SMS_Types.CP_DATA_SGSN_MS", NULL, &CP__DATA__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CP__DATA__SGSN__MS_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__SGSN__MS_cP__DATA_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__SGSN__MS_cP__ACK_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__SGSN__MS_cP__ERROR_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__SMS__SGSN__MS_default_coding("RAW");
TTCN_Module module_object("MobileL3_SMS_Types", __DATE__, __TIME__, module_checksum, pre_init_module, "", 0U, 2U, 0U, 99U, "", 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

const RuntimeVersionChecker ver_checker(  current_runtime_version.requires_major_version_11,
  current_runtime_version.requires_minor_version_1,
  current_runtime_version.requires_patch_level_0,  current_runtime_version.requires_runtime_1);

/* Member functions of C++ classes */

void L3__SMS__MS__SGSN::copy_value(const L3__SMS__MS__SGSN& other_value)
{
switch (other_value.union_selection) {
case ALT_cP__DATA:
field_cP__DATA = new CP__DATA__MS__SGSN(*other_value.field_cP__DATA);
break;
case ALT_cP__ACK:
field_cP__ACK = new CP__ACK(*other_value.field_cP__ACK);
break;
case ALT_cP__ERROR:
field_cP__ERROR = new CP__ERROR(*other_value.field_cP__ERROR);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean L3__SMS__MS__SGSN::operator==(const L3__SMS__MS__SGSN& 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.L3_SMS_MS_SGSN.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_cP__DATA:
return *field_cP__DATA == *other_value.field_cP__DATA;
case ALT_cP__ACK:
return *field_cP__ACK == *other_value.field_cP__ACK;
case ALT_cP__ERROR:
return *field_cP__ERROR == *other_value.field_cP__ERROR;
default:
return FALSE;
}
}

CP__DATA__MS__SGSN& L3__SMS__MS__SGSN::cP__DATA()
{
if (union_selection != ALT_cP__DATA) {
clean_up();
field_cP__DATA = new CP__DATA__MS__SGSN;
union_selection = ALT_cP__DATA;
}
return *field_cP__DATA;
}

const CP__DATA__MS__SGSN& L3__SMS__MS__SGSN::cP__DATA() const
{
if (union_selection != ALT_cP__DATA) TTCN_error("Using non-selected field cP_DATA in a value of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
return *field_cP__DATA;
}

CP__ACK& L3__SMS__MS__SGSN::cP__ACK()
{
if (union_selection != ALT_cP__ACK) {
clean_up();
field_cP__ACK = new CP__ACK;
union_selection = ALT_cP__ACK;
}
return *field_cP__ACK;
}

const CP__ACK& L3__SMS__MS__SGSN::cP__ACK() const
{
if (union_selection != ALT_cP__ACK) TTCN_error("Using non-selected field cP_ACK in a value of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
return *field_cP__ACK;
}

CP__ERROR& L3__SMS__MS__SGSN::cP__ERROR()
{
if (union_selection != ALT_cP__ERROR) {
clean_up();
field_cP__ERROR = new CP__ERROR;
union_selection = ALT_cP__ERROR;
}
return *field_cP__ERROR;
}

const CP__ERROR& L3__SMS__MS__SGSN::cP__ERROR() const
{
if (union_selection != ALT_cP__ERROR) TTCN_error("Using non-selected field cP_ERROR in a value of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
return *field_cP__ERROR;
}

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

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

boolean L3__SMS__MS__SGSN::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_cP__DATA: return field_cP__DATA->is_value();
case ALT_cP__ACK: return field_cP__ACK->is_value();
case ALT_cP__ERROR: return field_cP__ERROR->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void L3__SMS__MS__SGSN::clean_up()
{
switch (union_selection) {
case ALT_cP__DATA:
  delete field_cP__DATA;
  break;
case ALT_cP__ACK:
  delete field_cP__ACK;
  break;
case ALT_cP__ERROR:
  delete field_cP__ERROR;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void L3__SMS__MS__SGSN::log() const
{
switch (union_selection) {
case ALT_cP__DATA:
TTCN_Logger::log_event_str("{ cP_DATA := ");
field_cP__DATA->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cP__ACK:
TTCN_Logger::log_event_str("{ cP_ACK := ");
field_cP__ACK->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cP__ERROR:
TTCN_Logger::log_event_str("{ cP_ERROR := ");
field_cP__ERROR->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void L3__SMS__MS__SGSN::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, "cP_DATA")) {
    cP__DATA().set_param(*mp_last);
    if (!cP__DATA().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cP_ACK")) {
    cP__ACK().set_param(*mp_last);
    if (!cP__ACK().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cP_ERROR")) {
    cP__ERROR().set_param(*mp_last);
    if (!cP__ERROR().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.", last_name);
}

void L3__SMS__MS__SGSN::set_implicit_omit()
{
switch (union_selection) {
case ALT_cP__DATA:
field_cP__DATA->set_implicit_omit(); break;
case ALT_cP__ACK:
field_cP__ACK->set_implicit_omit(); break;
case ALT_cP__ERROR:
field_cP__ERROR->set_implicit_omit(); break;
default: break;
}
}

void L3__SMS__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_cP__DATA:
field_cP__DATA->encode_text(text_buf);
break;
case ALT_cP__ACK:
field_cP__ACK->encode_text(text_buf);
break;
case ALT_cP__ERROR:
field_cP__ERROR->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
}
}

void L3__SMS__MS__SGSN::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_cP__DATA:
cP__DATA().decode_text(text_buf);
break;
case ALT_cP__ACK:
cP__ACK().decode_text(text_buf);
break;
case ALT_cP__ERROR:
cP__ERROR().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
}
}

void L3__SMS__MS__SGSN::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 L3__SMS__MS__SGSN::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 L3__SMS__MS__SGSN::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, CP__DATA__MS__SGSN_descr_.raw->forceomit);
      decoded_length = cP__DATA().RAW_decode(CP__DATA__MS__SGSN_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, CP__ACK_descr_.raw->forceomit);
      decoded_length = cP__ACK().RAW_decode(CP__ACK_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, CP__ERROR_descr_.raw->forceomit);
      decoded_length = cP__ERROR().RAW_decode(CP__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 {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, CP__DATA__MS__SGSN_descr_.raw->forceomit);
      decoded_length = cP__DATA().RAW_decode(CP__DATA__MS__SGSN_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, CP__ACK_descr_.raw->forceomit);
      decoded_length = cP__ACK().RAW_decode(CP__ACK_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, CP__ERROR_descr_.raw->forceomit);
      decoded_length = cP__ERROR().RAW_decode(CP__ERROR_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int L3__SMS__MS__SGSN::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_cP__DATA:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, CP__DATA__MS__SGSN_descr_.raw);
    encoded_length = field_cP__DATA->RAW_encode(CP__DATA__MS__SGSN_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &CP__DATA__MS__SGSN_descr_;
    break;
  case ALT_cP__ACK:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, CP__ACK_descr_.raw);
    encoded_length = field_cP__ACK->RAW_encode(CP__ACK_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &CP__ACK_descr_;
    break;
  case ALT_cP__ERROR:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, CP__ERROR_descr_.raw);
    encoded_length = field_cP__ERROR->RAW_encode(CP__ERROR_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &CP__ERROR_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void L3__SMS__MS__SGSN_template::copy_value(const L3__SMS__MS__SGSN& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
single_value.field_cP__DATA = new CP__DATA__MS__SGSN_template(other_value.cP__DATA());
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
single_value.field_cP__ACK = new CP__ACK_template(other_value.cP__ACK());
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
single_value.field_cP__ERROR = new CP__ERROR_template(other_value.cP__ERROR());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
}
set_selection(SPECIFIC_VALUE);
}

void L3__SMS__MS__SGSN_template::copy_template(const L3__SMS__MS__SGSN_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 L3__SMS__MS__SGSN::ALT_cP__DATA:
single_value.field_cP__DATA = new CP__DATA__MS__SGSN_template(*other_value.single_value.field_cP__DATA);
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
single_value.field_cP__ACK = new CP__ACK_template(*other_value.single_value.field_cP__ACK);
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
single_value.field_cP__ERROR = new CP__ERROR_template(*other_value.single_value.field_cP__ERROR);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
}
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 L3__SMS__MS__SGSN_template[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 L3__SMS__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new L3__SMS__MS__SGSN_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.L3_SMS_MS_SGSN.");
}
set_selection(other_value);
}

L3__SMS__MS__SGSN_template::L3__SMS__MS__SGSN_template()
{
}

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

L3__SMS__MS__SGSN_template::L3__SMS__MS__SGSN_template(const L3__SMS__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void L3__SMS__MS__SGSN_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
delete single_value.field_cP__DATA;
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
delete single_value.field_cP__ACK;
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
delete single_value.field_cP__ERROR;
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;
}

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

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

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

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

boolean L3__SMS__MS__SGSN_template::match(const L3__SMS__MS__SGSN& 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:
{
L3__SMS__MS__SGSN::union_selection_type value_selection = other_value.get_selection();
if (value_selection == L3__SMS__MS__SGSN::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
return single_value.field_cP__DATA->match(other_value.cP__DATA(), legacy);
case L3__SMS__MS__SGSN::ALT_cP__ACK:
return single_value.field_cP__ACK->match(other_value.cP__ACK(), legacy);
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
return single_value.field_cP__ERROR->match(other_value.cP__ERROR(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
}
}
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.L3_SMS_MS_SGSN.");
}
return FALSE;
}

boolean L3__SMS__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
return single_value.field_cP__DATA->is_value();
case L3__SMS__MS__SGSN::ALT_cP__ACK:
return single_value.field_cP__ACK->is_value();
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
return single_value.field_cP__ERROR->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.L3_SMS_MS_SGSN.");
}
}

L3__SMS__MS__SGSN L3__SMS__MS__SGSN_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.L3_SMS_MS_SGSN.");
L3__SMS__MS__SGSN ret_val;
switch (single_value.union_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
ret_val.cP__DATA() = single_value.field_cP__DATA->valueof();
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
ret_val.cP__ACK() = single_value.field_cP__ACK->valueof();
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
ret_val.cP__ERROR() = single_value.field_cP__ERROR->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.L3_SMS_MS_SGSN.");
}
return ret_val;
}

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

CP__DATA__MS__SGSN_template& L3__SMS__MS__SGSN_template::cP__DATA()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__SMS__MS__SGSN::ALT_cP__DATA) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cP__DATA = new CP__DATA__MS__SGSN_template(ANY_VALUE);
else single_value.field_cP__DATA = new CP__DATA__MS__SGSN_template;
single_value.union_selection = L3__SMS__MS__SGSN::ALT_cP__DATA;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cP__DATA;
}

const CP__DATA__MS__SGSN_template& L3__SMS__MS__SGSN_template::cP__DATA() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cP_DATA in a non-specific template of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
if (single_value.union_selection != L3__SMS__MS__SGSN::ALT_cP__DATA) TTCN_error("Accessing non-selected field cP_DATA in a template of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
return *single_value.field_cP__DATA;
}

CP__ACK_template& L3__SMS__MS__SGSN_template::cP__ACK()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__SMS__MS__SGSN::ALT_cP__ACK) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cP__ACK = new CP__ACK_template(ANY_VALUE);
else single_value.field_cP__ACK = new CP__ACK_template;
single_value.union_selection = L3__SMS__MS__SGSN::ALT_cP__ACK;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cP__ACK;
}

const CP__ACK_template& L3__SMS__MS__SGSN_template::cP__ACK() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cP_ACK in a non-specific template of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
if (single_value.union_selection != L3__SMS__MS__SGSN::ALT_cP__ACK) TTCN_error("Accessing non-selected field cP_ACK in a template of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
return *single_value.field_cP__ACK;
}

CP__ERROR_template& L3__SMS__MS__SGSN_template::cP__ERROR()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__SMS__MS__SGSN::ALT_cP__ERROR) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cP__ERROR = new CP__ERROR_template(ANY_VALUE);
else single_value.field_cP__ERROR = new CP__ERROR_template;
single_value.union_selection = L3__SMS__MS__SGSN::ALT_cP__ERROR;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cP__ERROR;
}

const CP__ERROR_template& L3__SMS__MS__SGSN_template::cP__ERROR() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cP_ERROR in a non-specific template of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
if (single_value.union_selection != L3__SMS__MS__SGSN::ALT_cP__ERROR) TTCN_error("Accessing non-selected field cP_ERROR in a template of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
return *single_value.field_cP__ERROR;
}

boolean L3__SMS__MS__SGSN_template::ischosen(L3__SMS__MS__SGSN::union_selection_type checked_selection) const
{
if (checked_selection == L3__SMS__MS__SGSN::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == L3__SMS__MS__SGSN::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.L3_SMS_MS_SGSN.");
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.L3_SMS_MS_SGSN 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 L3__SMS__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
TTCN_Logger::log_event_str("{ cP_DATA := ");
single_value.field_cP__DATA->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
TTCN_Logger::log_event_str("{ cP_ACK := ");
single_value.field_cP__ACK->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
TTCN_Logger::log_event_str("{ cP_ERROR := ");
single_value.field_cP__ERROR->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 L3__SMS__MS__SGSN_template::log_match(const L3__SMS__MS__SGSN& 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 L3__SMS__MS__SGSN::ALT_cP__DATA:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cP_DATA");
single_value.field_cP__DATA->log_match(match_value.cP__DATA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cP_DATA := ");
single_value.field_cP__DATA->log_match(match_value.cP__DATA(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cP_ACK");
single_value.field_cP__ACK->log_match(match_value.cP__ACK(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cP_ACK := ");
single_value.field_cP__ACK->log_match(match_value.cP__ACK(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cP_ERROR");
single_value.field_cP__ERROR->log_match(match_value.cP__ERROR(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cP_ERROR := ");
single_value.field_cP__ERROR->log_match(match_value.cP__ERROR(), 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 L3__SMS__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
single_value.field_cP__DATA->set_implicit_omit(); break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
single_value.field_cP__ACK->set_implicit_omit(); break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
single_value.field_cP__ERROR->set_implicit_omit(); break;
default: break;
}
}

void L3__SMS__MS__SGSN_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 L3__SMS__MS__SGSN::ALT_cP__DATA:
single_value.field_cP__DATA->encode_text(text_buf);
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
single_value.field_cP__ACK->encode_text(text_buf);
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
single_value.field_cP__ERROR->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.L3_SMS_MS_SGSN.");
}
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.L3_SMS_MS_SGSN.");
}
}

void L3__SMS__MS__SGSN_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = L3__SMS__MS__SGSN::UNBOUND_VALUE;
L3__SMS__MS__SGSN::union_selection_type new_selection = (L3__SMS__MS__SGSN::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case L3__SMS__MS__SGSN::ALT_cP__DATA:
single_value.field_cP__DATA = new CP__DATA__MS__SGSN_template;
single_value.field_cP__DATA->decode_text(text_buf);
break;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
single_value.field_cP__ACK = new CP__ACK_template;
single_value.field_cP__ACK->decode_text(text_buf);
break;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
single_value.field_cP__ERROR = new CP__ERROR_template;
single_value.field_cP__ERROR->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.");
}
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 L3__SMS__MS__SGSN_template[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.L3_SMS_MS_SGSN.");
}
}

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

boolean L3__SMS__MS__SGSN_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 L3__SMS__MS__SGSN_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.L3_SMS_MS_SGSN'");
    }
    if (strcmp("cP_DATA", param_field) == 0) {
      cP__DATA().set_param(param);
      return;
    } else if (strcmp("cP_ACK", param_field) == 0) {
      cP__ACK().set_param(param);
      return;
    } else if (strcmp("cP_ERROR", param_field) == 0) {
      cP__ERROR().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.L3_SMS_MS_SGSN'", 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: {
    L3__SMS__MS__SGSN_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.L3_SMS_MS_SGSN");
    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, "cP_DATA")) {
      cP__DATA().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cP_ACK")) {
      cP__ACK().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cP_ERROR")) {
      cP__ERROR().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.L3_SMS_MS_SGSN.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    L3__SMS__MS__SGSN_template* precondition = new L3__SMS__MS__SGSN_template;
    precondition->set_param(*m_p->get_elem(0));
    L3__SMS__MS__SGSN_template* implied_template = new L3__SMS__MS__SGSN_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = L3__SMS__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.L3_SMS_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void L3__SMS__MS__SGSN_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 L3__SMS__MS__SGSN::ALT_cP__DATA:
single_value.field_cP__DATA->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.L3_SMS_MS_SGSN");
return;
case L3__SMS__MS__SGSN::ALT_cP__ACK:
single_value.field_cP__ACK->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.L3_SMS_MS_SGSN");
return;
case L3__SMS__MS__SGSN::ALT_cP__ERROR:
single_value.field_cP__ERROR->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.L3_SMS_MS_SGSN");
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.L3_SMS_MS_SGSN.");
}
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.L3_SMS_MS_SGSN");
}

void RPDU__MS__SGSN::copy_value(const RPDU__MS__SGSN& other_value)
{
switch (other_value.union_selection) {
case ALT_rP__DATA__MS__SGSN:
field_rP__DATA__MS__SGSN = new RP__DATA__MS__SGSN(*other_value.field_rP__DATA__MS__SGSN);
break;
case ALT_rP__ACK__MS__SGSN:
field_rP__ACK__MS__SGSN = new RP__ACK__MS__SGSN(*other_value.field_rP__ACK__MS__SGSN);
break;
case ALT_rP__ERROR__MS__SGSN:
field_rP__ERROR__MS__SGSN = new RP__ERROR__MS__SGSN(*other_value.field_rP__ERROR__MS__SGSN);
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_MS_SGSN.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean RPDU__MS__SGSN::operator==(const RPDU__MS__SGSN& 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_MS_SGSN.");
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_MS_SGSN.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rP__DATA__MS__SGSN:
return *field_rP__DATA__MS__SGSN == *other_value.field_rP__DATA__MS__SGSN;
case ALT_rP__ACK__MS__SGSN:
return *field_rP__ACK__MS__SGSN == *other_value.field_rP__ACK__MS__SGSN;
case ALT_rP__ERROR__MS__SGSN:
return *field_rP__ERROR__MS__SGSN == *other_value.field_rP__ERROR__MS__SGSN;
case ALT_rP__SMMA:
return *field_rP__SMMA == *other_value.field_rP__SMMA;
default:
return FALSE;
}
}

RP__DATA__MS__SGSN& RPDU__MS__SGSN::rP__DATA__MS__SGSN()
{
if (union_selection != ALT_rP__DATA__MS__SGSN) {
clean_up();
field_rP__DATA__MS__SGSN = new RP__DATA__MS__SGSN;
union_selection = ALT_rP__DATA__MS__SGSN;
}
return *field_rP__DATA__MS__SGSN;
}

const RP__DATA__MS__SGSN& RPDU__MS__SGSN::rP__DATA__MS__SGSN() const
{
if (union_selection != ALT_rP__DATA__MS__SGSN) TTCN_error("Using non-selected field rP_DATA_MS_SGSN in a value of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
return *field_rP__DATA__MS__SGSN;
}

RP__ACK__MS__SGSN& RPDU__MS__SGSN::rP__ACK__MS__SGSN()
{
if (union_selection != ALT_rP__ACK__MS__SGSN) {
clean_up();
field_rP__ACK__MS__SGSN = new RP__ACK__MS__SGSN;
union_selection = ALT_rP__ACK__MS__SGSN;
}
return *field_rP__ACK__MS__SGSN;
}

const RP__ACK__MS__SGSN& RPDU__MS__SGSN::rP__ACK__MS__SGSN() const
{
if (union_selection != ALT_rP__ACK__MS__SGSN) TTCN_error("Using non-selected field rP_ACK_MS_SGSN in a value of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
return *field_rP__ACK__MS__SGSN;
}

RP__ERROR__MS__SGSN& RPDU__MS__SGSN::rP__ERROR__MS__SGSN()
{
if (union_selection != ALT_rP__ERROR__MS__SGSN) {
clean_up();
field_rP__ERROR__MS__SGSN = new RP__ERROR__MS__SGSN;
union_selection = ALT_rP__ERROR__MS__SGSN;
}
return *field_rP__ERROR__MS__SGSN;
}

const RP__ERROR__MS__SGSN& RPDU__MS__SGSN::rP__ERROR__MS__SGSN() const
{
if (union_selection != ALT_rP__ERROR__MS__SGSN) TTCN_error("Using non-selected field rP_ERROR_MS_SGSN in a value of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
return *field_rP__ERROR__MS__SGSN;
}

RP__SMMA& RPDU__MS__SGSN::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__MS__SGSN::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_MS_SGSN.");
return *field_rP__SMMA;
}

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

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

boolean RPDU__MS__SGSN::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rP__DATA__MS__SGSN: return field_rP__DATA__MS__SGSN->is_value();
case ALT_rP__ACK__MS__SGSN: return field_rP__ACK__MS__SGSN->is_value();
case ALT_rP__ERROR__MS__SGSN: return field_rP__ERROR__MS__SGSN->is_value();
case ALT_rP__SMMA: return field_rP__SMMA->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void RPDU__MS__SGSN::clean_up()
{
switch (union_selection) {
case ALT_rP__DATA__MS__SGSN:
  delete field_rP__DATA__MS__SGSN;
  break;
case ALT_rP__ACK__MS__SGSN:
  delete field_rP__ACK__MS__SGSN;
  break;
case ALT_rP__ERROR__MS__SGSN:
  delete field_rP__ERROR__MS__SGSN;
  break;
case ALT_rP__SMMA:
  delete field_rP__SMMA;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void RPDU__MS__SGSN::log() const
{
switch (union_selection) {
case ALT_rP__DATA__MS__SGSN:
TTCN_Logger::log_event_str("{ rP_DATA_MS_SGSN := ");
field_rP__DATA__MS__SGSN->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rP__ACK__MS__SGSN:
TTCN_Logger::log_event_str("{ rP_ACK_MS_SGSN := ");
field_rP__ACK__MS__SGSN->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rP__ERROR__MS__SGSN:
TTCN_Logger::log_event_str("{ rP_ERROR_MS_SGSN := ");
field_rP__ERROR__MS__SGSN->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__MS__SGSN::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_MS_SGSN")) {
    rP__DATA__MS__SGSN().set_param(*mp_last);
    if (!rP__DATA__MS__SGSN().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rP_ACK_MS_SGSN")) {
    rP__ACK__MS__SGSN().set_param(*mp_last);
    if (!rP__ACK__MS__SGSN().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rP_ERROR_MS_SGSN")) {
    rP__ERROR__MS__SGSN().set_param(*mp_last);
    if (!rP__ERROR__MS__SGSN().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_MS_SGSN.", last_name);
}

void RPDU__MS__SGSN::set_implicit_omit()
{
switch (union_selection) {
case ALT_rP__DATA__MS__SGSN:
field_rP__DATA__MS__SGSN->set_implicit_omit(); break;
case ALT_rP__ACK__MS__SGSN:
field_rP__ACK__MS__SGSN->set_implicit_omit(); break;
case ALT_rP__ERROR__MS__SGSN:
field_rP__ERROR__MS__SGSN->set_implicit_omit(); break;
case ALT_rP__SMMA:
field_rP__SMMA->set_implicit_omit(); break;
default: break;
}
}

void RPDU__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rP__DATA__MS__SGSN:
field_rP__DATA__MS__SGSN->encode_text(text_buf);
break;
case ALT_rP__ACK__MS__SGSN:
field_rP__ACK__MS__SGSN->encode_text(text_buf);
break;
case ALT_rP__ERROR__MS__SGSN:
field_rP__ERROR__MS__SGSN->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_MS_SGSN.");
}
}

void RPDU__MS__SGSN::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rP__DATA__MS__SGSN:
rP__DATA__MS__SGSN().decode_text(text_buf);
break;
case ALT_rP__ACK__MS__SGSN:
rP__ACK__MS__SGSN().decode_text(text_buf);
break;
case ALT_rP__ERROR__MS__SGSN:
rP__ERROR__MS__SGSN().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_MS_SGSN.");
}
}

void RPDU__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_descr_.raw->forceomit);
      decoded_length = rP__DATA__MS__SGSN().RAW_decode(RP__DATA__MS__SGSN_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__MS__SGSN_descr_.raw->forceomit);
      decoded_length = rP__ACK__MS__SGSN().RAW_decode(RP__ACK__MS__SGSN_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__MS__SGSN_descr_.raw->forceomit);
      decoded_length = rP__ERROR__MS__SGSN().RAW_decode(RP__ERROR__MS__SGSN_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_10) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, RP__DATA__MS__SGSN_descr_.raw->forceomit);
          decoded_length = rP__DATA__MS__SGSN().RAW_decode(RP__DATA__MS__SGSN_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rP__DATA__MS__SGSN).rP__MTI() ==  bs_10) {
               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_11) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(1, force_omit, RP__ACK__MS__SGSN_descr_.raw->forceomit);
          decoded_length = rP__ACK__MS__SGSN().RAW_decode(RP__ACK__MS__SGSN_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rP__ACK__MS__SGSN).rP__MTI() ==  bs_11) {
               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_12) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(2, force_omit, RP__ERROR__MS__SGSN_descr_.raw->forceomit);
          decoded_length = rP__ERROR__MS__SGSN().RAW_decode(RP__ERROR__MS__SGSN_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rP__ERROR__MS__SGSN).rP__MTI() ==  bs_12) {
               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__MS__SGSN::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__MS__SGSN:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RP__DATA__MS__SGSN_descr_.raw);
    encoded_length = field_rP__DATA__MS__SGSN->RAW_encode(RP__DATA__MS__SGSN_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RP__DATA__MS__SGSN_descr_;
    if ((*field_rP__DATA__MS__SGSN).rP__MTI() !=  bs_10) {
  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_10.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__MS__SGSN:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RP__ACK__MS__SGSN_descr_.raw);
    encoded_length = field_rP__ACK__MS__SGSN->RAW_encode(RP__ACK__MS__SGSN_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RP__ACK__MS__SGSN_descr_;
    if ((*field_rP__ACK__MS__SGSN).rP__MTI() !=  bs_11) {
  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_11.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__MS__SGSN:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, RP__ERROR__MS__SGSN_descr_.raw);
    encoded_length = field_rP__ERROR__MS__SGSN->RAW_encode(RP__ERROR__MS__SGSN_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &RP__ERROR__MS__SGSN_descr_;
    if ((*field_rP__ERROR__MS__SGSN).rP__MTI() !=  bs_12) {
  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_12.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__MS__SGSN_template::copy_value(const RPDU__MS__SGSN& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
single_value.field_rP__DATA__MS__SGSN = new RP__DATA__MS__SGSN_template(other_value.rP__DATA__MS__SGSN());
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
single_value.field_rP__ACK__MS__SGSN = new RP__ACK__MS__SGSN_template(other_value.rP__ACK__MS__SGSN());
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
single_value.field_rP__ERROR__MS__SGSN = new RP__ERROR__MS__SGSN_template(other_value.rP__ERROR__MS__SGSN());
break;
case RPDU__MS__SGSN::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_MS_SGSN.");
}
set_selection(SPECIFIC_VALUE);
}

void RPDU__MS__SGSN_template::copy_template(const RPDU__MS__SGSN_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__MS__SGSN::ALT_rP__DATA__MS__SGSN:
single_value.field_rP__DATA__MS__SGSN = new RP__DATA__MS__SGSN_template(*other_value.single_value.field_rP__DATA__MS__SGSN);
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
single_value.field_rP__ACK__MS__SGSN = new RP__ACK__MS__SGSN_template(*other_value.single_value.field_rP__ACK__MS__SGSN);
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
single_value.field_rP__ERROR__MS__SGSN = new RP__ERROR__MS__SGSN_template(*other_value.single_value.field_rP__ERROR__MS__SGSN);
break;
case RPDU__MS__SGSN::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_MS_SGSN.");
}
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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new RPDU__MS__SGSN_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_MS_SGSN.");
}
set_selection(other_value);
}

RPDU__MS__SGSN_template::RPDU__MS__SGSN_template()
{
}

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

RPDU__MS__SGSN_template::RPDU__MS__SGSN_template(const RPDU__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void RPDU__MS__SGSN_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
delete single_value.field_rP__DATA__MS__SGSN;
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
delete single_value.field_rP__ACK__MS__SGSN;
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
delete single_value.field_rP__ERROR__MS__SGSN;
break;
case RPDU__MS__SGSN::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__MS__SGSN_template& RPDU__MS__SGSN_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

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

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

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

boolean RPDU__MS__SGSN_template::match(const RPDU__MS__SGSN& 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__MS__SGSN::union_selection_type value_selection = other_value.get_selection();
if (value_selection == RPDU__MS__SGSN::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
return single_value.field_rP__DATA__MS__SGSN->match(other_value.rP__DATA__MS__SGSN(), legacy);
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
return single_value.field_rP__ACK__MS__SGSN->match(other_value.rP__ACK__MS__SGSN(), legacy);
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
return single_value.field_rP__ERROR__MS__SGSN->match(other_value.rP__ERROR__MS__SGSN(), legacy);
case RPDU__MS__SGSN::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_MS_SGSN.");
}
}
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_MS_SGSN.");
}
return FALSE;
}

boolean RPDU__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
return single_value.field_rP__DATA__MS__SGSN->is_value();
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
return single_value.field_rP__ACK__MS__SGSN->is_value();
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
return single_value.field_rP__ERROR__MS__SGSN->is_value();
case RPDU__MS__SGSN::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_MS_SGSN.");
}
}

RPDU__MS__SGSN RPDU__MS__SGSN_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_MS_SGSN.");
RPDU__MS__SGSN ret_val;
switch (single_value.union_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
ret_val.rP__DATA__MS__SGSN() = single_value.field_rP__DATA__MS__SGSN->valueof();
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
ret_val.rP__ACK__MS__SGSN() = single_value.field_rP__ACK__MS__SGSN->valueof();
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
ret_val.rP__ERROR__MS__SGSN() = single_value.field_rP__ERROR__MS__SGSN->valueof();
break;
case RPDU__MS__SGSN::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_MS_SGSN.");
}
return ret_val;
}

RPDU__MS__SGSN_template& RPDU__MS__SGSN_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_MS_SGSN.");
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_MS_SGSN.");
return value_list.list_value[list_index];
}
void RPDU__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RPDU__MS__SGSN_template[list_length];
}

RP__DATA__MS__SGSN_template& RPDU__MS__SGSN_template::rP__DATA__MS__SGSN()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rP__DATA__MS__SGSN = new RP__DATA__MS__SGSN_template(ANY_VALUE);
else single_value.field_rP__DATA__MS__SGSN = new RP__DATA__MS__SGSN_template;
single_value.union_selection = RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__DATA__MS__SGSN;
}

const RP__DATA__MS__SGSN_template& RPDU__MS__SGSN_template::rP__DATA__MS__SGSN() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rP_DATA_MS_SGSN in a non-specific template of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
if (single_value.union_selection != RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN) TTCN_error("Accessing non-selected field rP_DATA_MS_SGSN in a template of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
return *single_value.field_rP__DATA__MS__SGSN;
}

RP__ACK__MS__SGSN_template& RPDU__MS__SGSN_template::rP__ACK__MS__SGSN()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rP__ACK__MS__SGSN = new RP__ACK__MS__SGSN_template(ANY_VALUE);
else single_value.field_rP__ACK__MS__SGSN = new RP__ACK__MS__SGSN_template;
single_value.union_selection = RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__ACK__MS__SGSN;
}

const RP__ACK__MS__SGSN_template& RPDU__MS__SGSN_template::rP__ACK__MS__SGSN() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rP_ACK_MS_SGSN in a non-specific template of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
if (single_value.union_selection != RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN) TTCN_error("Accessing non-selected field rP_ACK_MS_SGSN in a template of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
return *single_value.field_rP__ACK__MS__SGSN;
}

RP__ERROR__MS__SGSN_template& RPDU__MS__SGSN_template::rP__ERROR__MS__SGSN()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rP__ERROR__MS__SGSN = new RP__ERROR__MS__SGSN_template(ANY_VALUE);
else single_value.field_rP__ERROR__MS__SGSN = new RP__ERROR__MS__SGSN_template;
single_value.union_selection = RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__ERROR__MS__SGSN;
}

const RP__ERROR__MS__SGSN_template& RPDU__MS__SGSN_template::rP__ERROR__MS__SGSN() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rP_ERROR_MS_SGSN in a non-specific template of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
if (single_value.union_selection != RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN) TTCN_error("Accessing non-selected field rP_ERROR_MS_SGSN in a template of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
return *single_value.field_rP__ERROR__MS__SGSN;
}

RP__SMMA_template& RPDU__MS__SGSN_template::rP__SMMA()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RPDU__MS__SGSN::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__MS__SGSN::ALT_rP__SMMA;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rP__SMMA;
}

const RP__SMMA_template& RPDU__MS__SGSN_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_MS_SGSN.");
if (single_value.union_selection != RPDU__MS__SGSN::ALT_rP__SMMA) TTCN_error("Accessing non-selected field rP_SMMA in a template of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
return *single_value.field_rP__SMMA;
}

boolean RPDU__MS__SGSN_template::ischosen(RPDU__MS__SGSN::union_selection_type checked_selection) const
{
if (checked_selection == RPDU__MS__SGSN::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.RPDU_MS_SGSN.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == RPDU__MS__SGSN::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_MS_SGSN.");
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_MS_SGSN 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__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
TTCN_Logger::log_event_str("{ rP_DATA_MS_SGSN := ");
single_value.field_rP__DATA__MS__SGSN->log();
TTCN_Logger::log_event_str(" }");
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
TTCN_Logger::log_event_str("{ rP_ACK_MS_SGSN := ");
single_value.field_rP__ACK__MS__SGSN->log();
TTCN_Logger::log_event_str(" }");
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
TTCN_Logger::log_event_str("{ rP_ERROR_MS_SGSN := ");
single_value.field_rP__ERROR__MS__SGSN->log();
TTCN_Logger::log_event_str(" }");
break;
case RPDU__MS__SGSN::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__MS__SGSN_template::log_match(const RPDU__MS__SGSN& 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__MS__SGSN::ALT_rP__DATA__MS__SGSN:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rP_DATA_MS_SGSN");
single_value.field_rP__DATA__MS__SGSN->log_match(match_value.rP__DATA__MS__SGSN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rP_DATA_MS_SGSN := ");
single_value.field_rP__DATA__MS__SGSN->log_match(match_value.rP__DATA__MS__SGSN(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rP_ACK_MS_SGSN");
single_value.field_rP__ACK__MS__SGSN->log_match(match_value.rP__ACK__MS__SGSN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rP_ACK_MS_SGSN := ");
single_value.field_rP__ACK__MS__SGSN->log_match(match_value.rP__ACK__MS__SGSN(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rP_ERROR_MS_SGSN");
single_value.field_rP__ERROR__MS__SGSN->log_match(match_value.rP__ERROR__MS__SGSN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rP_ERROR_MS_SGSN := ");
single_value.field_rP__ERROR__MS__SGSN->log_match(match_value.rP__ERROR__MS__SGSN(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RPDU__MS__SGSN::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__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
single_value.field_rP__DATA__MS__SGSN->set_implicit_omit(); break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
single_value.field_rP__ACK__MS__SGSN->set_implicit_omit(); break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
single_value.field_rP__ERROR__MS__SGSN->set_implicit_omit(); break;
case RPDU__MS__SGSN::ALT_rP__SMMA:
single_value.field_rP__SMMA->set_implicit_omit(); break;
default: break;
}
}

void RPDU__MS__SGSN_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__MS__SGSN::ALT_rP__DATA__MS__SGSN:
single_value.field_rP__DATA__MS__SGSN->encode_text(text_buf);
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
single_value.field_rP__ACK__MS__SGSN->encode_text(text_buf);
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
single_value.field_rP__ERROR__MS__SGSN->encode_text(text_buf);
break;
case RPDU__MS__SGSN::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_MS_SGSN.");
}
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_MS_SGSN.");
}
}

void RPDU__MS__SGSN_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__MS__SGSN::UNBOUND_VALUE;
RPDU__MS__SGSN::union_selection_type new_selection = (RPDU__MS__SGSN::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case RPDU__MS__SGSN::ALT_rP__DATA__MS__SGSN:
single_value.field_rP__DATA__MS__SGSN = new RP__DATA__MS__SGSN_template;
single_value.field_rP__DATA__MS__SGSN->decode_text(text_buf);
break;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
single_value.field_rP__ACK__MS__SGSN = new RP__ACK__MS__SGSN_template;
single_value.field_rP__ACK__MS__SGSN->decode_text(text_buf);
break;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
single_value.field_rP__ERROR__MS__SGSN = new RP__ERROR__MS__SGSN_template;
single_value.field_rP__ERROR__MS__SGSN->decode_text(text_buf);
break;
case RPDU__MS__SGSN::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_MS_SGSN.");
}
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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

boolean RPDU__MS__SGSN_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__MS__SGSN_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_MS_SGSN'");
    }
    if (strcmp("rP_DATA_MS_SGSN", param_field) == 0) {
      rP__DATA__MS__SGSN().set_param(param);
      return;
    } else if (strcmp("rP_ACK_MS_SGSN", param_field) == 0) {
      rP__ACK__MS__SGSN().set_param(param);
      return;
    } else if (strcmp("rP_ERROR_MS_SGSN", param_field) == 0) {
      rP__ERROR__MS__SGSN().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_MS_SGSN'", 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__MS__SGSN_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_MS_SGSN");
    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_MS_SGSN")) {
      rP__DATA__MS__SGSN().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rP_ACK_MS_SGSN")) {
      rP__ACK__MS__SGSN().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rP_ERROR_MS_SGSN")) {
      rP__ERROR__MS__SGSN().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_MS_SGSN.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    RPDU__MS__SGSN_template* precondition = new RPDU__MS__SGSN_template;
    precondition->set_param(*m_p->get_elem(0));
    RPDU__MS__SGSN_template* implied_template = new RPDU__MS__SGSN_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RPDU__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.RPDU_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void RPDU__MS__SGSN_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__MS__SGSN::ALT_rP__DATA__MS__SGSN:
single_value.field_rP__DATA__MS__SGSN->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_MS_SGSN");
return;
case RPDU__MS__SGSN::ALT_rP__ACK__MS__SGSN:
single_value.field_rP__ACK__MS__SGSN->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_MS_SGSN");
return;
case RPDU__MS__SGSN::ALT_rP__ERROR__MS__SGSN:
single_value.field_rP__ERROR__MS__SGSN->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_MS_SGSN");
return;
case RPDU__MS__SGSN::ALT_rP__SMMA:
single_value.field_rP__SMMA->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RPDU_MS_SGSN");
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_MS_SGSN.");
}
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_MS_SGSN");
}

RP__OriginatorAddressLV::RP__OriginatorAddressLV()
{
}

RP__OriginatorAddressLV::RP__OriginatorAddressLV(const INTEGER& par_lengthIndicator,
    const OPTIONAL< RP__NumberingPlan__and__NumberDigits >& par_rP__OriginatorAddress)
  :   field_lengthIndicator(par_lengthIndicator),
  field_rP__OriginatorAddress(par_rP__OriginatorAddress)
{
}

RP__OriginatorAddressLV::RP__OriginatorAddressLV(const RP__OriginatorAddressLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_OriginatorAddressLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.rP__OriginatorAddress().is_bound()) field_rP__OriginatorAddress = other_value.rP__OriginatorAddress();
else field_rP__OriginatorAddress.clean_up();
}

void RP__OriginatorAddressLV::clean_up()
{
field_lengthIndicator.clean_up();
field_rP__OriginatorAddress.clean_up();
}

const TTCN_Typedescriptor_t* RP__OriginatorAddressLV::get_descriptor() const { return &RP__OriginatorAddressLV_descr_; }
RP__OriginatorAddressLV& RP__OriginatorAddressLV::operator=(const RP__OriginatorAddressLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_OriginatorAddressLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.rP__OriginatorAddress().is_bound()) field_rP__OriginatorAddress = other_value.rP__OriginatorAddress();
  else field_rP__OriginatorAddress.clean_up();
}
return *this;
}

boolean RP__OriginatorAddressLV::operator==(const RP__OriginatorAddressLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_rP__OriginatorAddress==other_value.field_rP__OriginatorAddress;
}

boolean RP__OriginatorAddressLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (OPTIONAL_OMIT == field_rP__OriginatorAddress.get_selection() || field_rP__OriginatorAddress.is_bound());
}
boolean RP__OriginatorAddressLV::is_value() const
{
return field_lengthIndicator.is_value()
  && (OPTIONAL_OMIT == field_rP__OriginatorAddress.get_selection() || field_rP__OriginatorAddress.is_value());
}
int RP__OriginatorAddressLV::size_of() const
{
  int ret_val = 1;
  if (field_rP__OriginatorAddress.ispresent()) ret_val++;
  return ret_val;
}

void RP__OriginatorAddressLV::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(", rP_OriginatorAddress := ");
field_rP__OriginatorAddress.log();
TTCN_Logger::log_event_str(" }");
}

void RP__OriginatorAddressLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (!rP__OriginatorAddress().is_bound()) rP__OriginatorAddress() = OMIT_VALUE;
else rP__OriginatorAddress().set_implicit_omit();
}

void RP__OriginatorAddressLV::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_OriginatorAddressLV 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) rP__OriginatorAddress().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(), "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++) 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_OriginatorAddressLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_OriginatorAddressLV");
  }
}

void RP__OriginatorAddressLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_rP__OriginatorAddress.encode_text(text_buf);
}

void RP__OriginatorAddressLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_rP__OriginatorAddress.decode_text(text_buf);
}

void RP__OriginatorAddressLV::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__OriginatorAddressLV::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__OriginatorAddressLV::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__OriginatorAddressLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RP__OriginatorAddressLV_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(RP__OriginatorAddressLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_rP__OriginatorAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, RP__NumberingPlan__and__NumberDigits_descr_.raw->forceomit);
  decoded_field_length = field_rP__OriginatorAddress().RAW_decode(RP__NumberingPlan__and__NumberDigits_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_rP__OriginatorAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_rP__OriginatorAddress=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__OriginatorAddressLV::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__OriginatorAddressLV_lengthIndicator_descr_.raw);
  if (field_rP__OriginatorAddress.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RP__NumberingPlan__and__NumberDigits_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RP__OriginatorAddressLV_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;
  if (field_rP__OriginatorAddress.ispresent()) {
  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;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = 0;
  }
  if (field_rP__OriginatorAddress.ispresent()) {
  encoded_length += field_rP__OriginatorAddress().RAW_encode(RP__NumberingPlan__and__NumberDigits_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct RP__OriginatorAddressLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
RP__NumberingPlan__and__NumberDigits_template field_rP__OriginatorAddress;
};

void RP__OriginatorAddressLV_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_rP__OriginatorAddress = ANY_OR_OMIT;
}
}
}

void RP__OriginatorAddressLV_template::copy_value(const RP__OriginatorAddressLV& 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.rP__OriginatorAddress().is_bound()) {
  if (other_value.rP__OriginatorAddress().ispresent()) single_value->field_rP__OriginatorAddress = other_value.rP__OriginatorAddress()();
  else single_value->field_rP__OriginatorAddress = OMIT_VALUE;
} else {
  single_value->field_rP__OriginatorAddress.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__OriginatorAddressLV_template::copy_template(const RP__OriginatorAddressLV_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.rP__OriginatorAddress().get_selection()) {
single_value->field_rP__OriginatorAddress = other_value.rP__OriginatorAddress();
} else {
single_value->field_rP__OriginatorAddress.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__OriginatorAddressLV_template[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__OriginatorAddressLV_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__OriginatorAddressLV_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_OriginatorAddressLV.");
break;
}
set_selection(other_value);
}

RP__OriginatorAddressLV_template::RP__OriginatorAddressLV_template()
{
}

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

RP__OriginatorAddressLV_template::RP__OriginatorAddressLV_template(const RP__OriginatorAddressLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__OriginatorAddressLV_template::match(const RP__OriginatorAddressLV& 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.rP__OriginatorAddress().is_bound()) return FALSE;
if((other_value.rP__OriginatorAddress().ispresent() ? !single_value->field_rP__OriginatorAddress.match((const RP__NumberingPlan__and__NumberDigits&)other_value.rP__OriginatorAddress(), legacy) : !single_value->field_rP__OriginatorAddress.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_OriginatorAddressLV.");
}
return FALSE;
}

boolean RP__OriginatorAddressLV_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_rP__OriginatorAddress.is_omit() || single_value->field_rP__OriginatorAddress.is_bound());
}

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

void RP__OriginatorAddressLV_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__OriginatorAddressLV RP__OriginatorAddressLV_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_OriginatorAddressLV.");
RP__OriginatorAddressLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_rP__OriginatorAddress.is_omit()) ret_val.rP__OriginatorAddress() = OMIT_VALUE;
else if (single_value->field_rP__OriginatorAddress.is_bound()) {
ret_val.rP__OriginatorAddress() = single_value->field_rP__OriginatorAddress.valueof();
}
return ret_val;
}

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

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

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

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

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

const RP__NumberingPlan__and__NumberDigits_template& RP__OriginatorAddressLV_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_OriginatorAddressLV.");
return single_value->field_rP__OriginatorAddress;
}

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

void RP__OriginatorAddressLV_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(", rP_OriginatorAddress := ");
single_value->field_rP__OriginatorAddress.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__OriginatorAddressLV_template::log_match(const RP__OriginatorAddressLV& 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 (match_value.rP__OriginatorAddress().ispresent()){
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);
}
} else {
if (!single_value->field_rP__OriginatorAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rP_OriginatorAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rP__OriginatorAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", rP_OriginatorAddress := ");
if (match_value.rP__OriginatorAddress().ispresent()) {
single_value->field_rP__OriginatorAddress.log_match(match_value.rP__OriginatorAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rP__OriginatorAddress.log();
if (single_value->field_rP__OriginatorAddress.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__OriginatorAddressLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (!rP__OriginatorAddress().is_bound()) rP__OriginatorAddress() = OMIT_VALUE;
else rP__OriginatorAddress().set_implicit_omit();
}

void RP__OriginatorAddressLV_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_rP__OriginatorAddress.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_OriginatorAddressLV.");
}
}

void RP__OriginatorAddressLV_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_rP__OriginatorAddress.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__OriginatorAddressLV_template[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_OriginatorAddressLV.");
}
}

void RP__OriginatorAddressLV_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__OriginatorAddressLV_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_OriginatorAddressLV 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) rP__OriginatorAddress().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(), "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++) 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_OriginatorAddressLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__OriginatorAddressLV_template* precondition = new RP__OriginatorAddressLV_template;
    precondition->set_param(*param.get_elem(0));
    RP__OriginatorAddressLV_template* implied_template = new RP__OriginatorAddressLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__OriginatorAddressLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_OriginatorAddressLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RP__OriginatorAddressLV_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.RP_OriginatorAddressLV");
single_value->field_rP__OriginatorAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_OriginatorAddressLV");
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_OriginatorAddressLV");
}

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

boolean RP__OriginatorAddressLV_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__NumberingPlan__and__NumberDigits::RP__NumberingPlan__and__NumberDigits()
{
}

RP__NumberingPlan__and__NumberDigits::RP__NumberingPlan__and__NumberDigits(const BITSTRING& par_rP__NumberingPlanIdentification,
    const BITSTRING& par_rP__TypeOfNumber,
    const BITSTRING& par_rP__Ext,
    const HEXSTRING& par_rP__NumberDigits)
  :   field_rP__NumberingPlanIdentification(par_rP__NumberingPlanIdentification),
  field_rP__TypeOfNumber(par_rP__TypeOfNumber),
  field_rP__Ext(par_rP__Ext),
  field_rP__NumberDigits(par_rP__NumberDigits)
{
}

RP__NumberingPlan__and__NumberDigits::RP__NumberingPlan__and__NumberDigits(const RP__NumberingPlan__and__NumberDigits& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.");
if (other_value.rP__NumberingPlanIdentification().is_bound()) field_rP__NumberingPlanIdentification = other_value.rP__NumberingPlanIdentification();
else field_rP__NumberingPlanIdentification.clean_up();
if (other_value.rP__TypeOfNumber().is_bound()) field_rP__TypeOfNumber = other_value.rP__TypeOfNumber();
else field_rP__TypeOfNumber.clean_up();
if (other_value.rP__Ext().is_bound()) field_rP__Ext = other_value.rP__Ext();
else field_rP__Ext.clean_up();
if (other_value.rP__NumberDigits().is_bound()) field_rP__NumberDigits = other_value.rP__NumberDigits();
else field_rP__NumberDigits.clean_up();
}

void RP__NumberingPlan__and__NumberDigits::clean_up()
{
field_rP__NumberingPlanIdentification.clean_up();
field_rP__TypeOfNumber.clean_up();
field_rP__Ext.clean_up();
field_rP__NumberDigits.clean_up();
}

const TTCN_Typedescriptor_t* RP__NumberingPlan__and__NumberDigits::get_descriptor() const { return &RP__NumberingPlan__and__NumberDigits_descr_; }
RP__NumberingPlan__and__NumberDigits& RP__NumberingPlan__and__NumberDigits::operator=(const RP__NumberingPlan__and__NumberDigits& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.");
  if (other_value.rP__NumberingPlanIdentification().is_bound()) field_rP__NumberingPlanIdentification = other_value.rP__NumberingPlanIdentification();
  else field_rP__NumberingPlanIdentification.clean_up();
  if (other_value.rP__TypeOfNumber().is_bound()) field_rP__TypeOfNumber = other_value.rP__TypeOfNumber();
  else field_rP__TypeOfNumber.clean_up();
  if (other_value.rP__Ext().is_bound()) field_rP__Ext = other_value.rP__Ext();
  else field_rP__Ext.clean_up();
  if (other_value.rP__NumberDigits().is_bound()) field_rP__NumberDigits = other_value.rP__NumberDigits();
  else field_rP__NumberDigits.clean_up();
}
return *this;
}

boolean RP__NumberingPlan__and__NumberDigits::operator==(const RP__NumberingPlan__and__NumberDigits& other_value) const
{
return field_rP__NumberingPlanIdentification==other_value.field_rP__NumberingPlanIdentification
  && field_rP__TypeOfNumber==other_value.field_rP__TypeOfNumber
  && field_rP__Ext==other_value.field_rP__Ext
  && field_rP__NumberDigits==other_value.field_rP__NumberDigits;
}

boolean RP__NumberingPlan__and__NumberDigits::is_bound() const
{
return (field_rP__NumberingPlanIdentification.is_bound())
  || (field_rP__TypeOfNumber.is_bound())
  || (field_rP__Ext.is_bound())
  || (field_rP__NumberDigits.is_bound());
}
boolean RP__NumberingPlan__and__NumberDigits::is_value() const
{
return field_rP__NumberingPlanIdentification.is_value()
  && field_rP__TypeOfNumber.is_value()
  && field_rP__Ext.is_value()
  && field_rP__NumberDigits.is_value();
}
void RP__NumberingPlan__and__NumberDigits::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rP_NumberingPlanIdentification := ");
field_rP__NumberingPlanIdentification.log();
TTCN_Logger::log_event_str(", rP_TypeOfNumber := ");
field_rP__TypeOfNumber.log();
TTCN_Logger::log_event_str(", rP_Ext := ");
field_rP__Ext.log();
TTCN_Logger::log_event_str(", rP_NumberDigits := ");
field_rP__NumberDigits.log();
TTCN_Logger::log_event_str(" }");
}

void RP__NumberingPlan__and__NumberDigits::set_implicit_omit()
{
if (rP__NumberingPlanIdentification().is_bound()) rP__NumberingPlanIdentification().set_implicit_omit();
if (rP__TypeOfNumber().is_bound()) rP__TypeOfNumber().set_implicit_omit();
if (rP__Ext().is_bound()) rP__Ext().set_implicit_omit();
if (rP__NumberDigits().is_bound()) rP__NumberDigits().set_implicit_omit();
}

void RP__NumberingPlan__and__NumberDigits::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_NumberingPlan_and_NumberDigits 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__NumberingPlanIdentification().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__TypeOfNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__Ext().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__NumberDigits().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_NumberingPlanIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__NumberingPlanIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_TypeOfNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_Ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__Ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_NumberDigits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__NumberDigits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_NumberingPlan_and_NumberDigits: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits");
  }
}

void RP__NumberingPlan__and__NumberDigits::encode_text(Text_Buf& text_buf) const
{
field_rP__NumberingPlanIdentification.encode_text(text_buf);
field_rP__TypeOfNumber.encode_text(text_buf);
field_rP__Ext.encode_text(text_buf);
field_rP__NumberDigits.encode_text(text_buf);
}

void RP__NumberingPlan__and__NumberDigits::decode_text(Text_Buf& text_buf)
{
field_rP__NumberingPlanIdentification.decode_text(text_buf);
field_rP__TypeOfNumber.decode_text(text_buf);
field_rP__Ext.decode_text(text_buf);
field_rP__NumberDigits.decode_text(text_buf);
}

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

int RP__NumberingPlan__and__NumberDigits::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, HEXSTRING_descr_.raw);
  encoded_length += field_rP__NumberingPlanIdentification.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__TypeOfNumber.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rP__Ext.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rP__NumberDigits.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct RP__NumberingPlan__and__NumberDigits_template::single_value_struct {
BITSTRING_template field_rP__NumberingPlanIdentification;
BITSTRING_template field_rP__TypeOfNumber;
BITSTRING_template field_rP__Ext;
HEXSTRING_template field_rP__NumberDigits;
};

void RP__NumberingPlan__and__NumberDigits_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__NumberingPlanIdentification = ANY_VALUE;
single_value->field_rP__TypeOfNumber = ANY_VALUE;
single_value->field_rP__Ext = ANY_VALUE;
single_value->field_rP__NumberDigits = ANY_VALUE;
}
}
}

void RP__NumberingPlan__and__NumberDigits_template::copy_value(const RP__NumberingPlan__and__NumberDigits& other_value)
{
single_value = new single_value_struct;
if (other_value.rP__NumberingPlanIdentification().is_bound()) {
  single_value->field_rP__NumberingPlanIdentification = other_value.rP__NumberingPlanIdentification();
} else {
  single_value->field_rP__NumberingPlanIdentification.clean_up();
}
if (other_value.rP__TypeOfNumber().is_bound()) {
  single_value->field_rP__TypeOfNumber = other_value.rP__TypeOfNumber();
} else {
  single_value->field_rP__TypeOfNumber.clean_up();
}
if (other_value.rP__Ext().is_bound()) {
  single_value->field_rP__Ext = other_value.rP__Ext();
} else {
  single_value->field_rP__Ext.clean_up();
}
if (other_value.rP__NumberDigits().is_bound()) {
  single_value->field_rP__NumberDigits = other_value.rP__NumberDigits();
} else {
  single_value->field_rP__NumberDigits.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__NumberingPlan__and__NumberDigits_template::copy_template(const RP__NumberingPlan__and__NumberDigits_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rP__NumberingPlanIdentification().get_selection()) {
single_value->field_rP__NumberingPlanIdentification = other_value.rP__NumberingPlanIdentification();
} else {
single_value->field_rP__NumberingPlanIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__TypeOfNumber().get_selection()) {
single_value->field_rP__TypeOfNumber = other_value.rP__TypeOfNumber();
} else {
single_value->field_rP__TypeOfNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__Ext().get_selection()) {
single_value->field_rP__Ext = other_value.rP__Ext();
} else {
single_value->field_rP__Ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__NumberDigits().get_selection()) {
single_value->field_rP__NumberDigits = other_value.rP__NumberDigits();
} else {
single_value->field_rP__NumberDigits.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__NumberingPlan__and__NumberDigits_template[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__NumberingPlan__and__NumberDigits_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__NumberingPlan__and__NumberDigits_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_NumberingPlan_and_NumberDigits.");
break;
}
set_selection(other_value);
}

RP__NumberingPlan__and__NumberDigits_template::RP__NumberingPlan__and__NumberDigits_template()
{
}

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

RP__NumberingPlan__and__NumberDigits_template::RP__NumberingPlan__and__NumberDigits_template(const RP__NumberingPlan__and__NumberDigits& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__NumberingPlan__and__NumberDigits_template::match(const RP__NumberingPlan__and__NumberDigits& 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__NumberingPlanIdentification().is_bound()) return FALSE;
if(!single_value->field_rP__NumberingPlanIdentification.match(other_value.rP__NumberingPlanIdentification(), legacy))return FALSE;
if(!other_value.rP__TypeOfNumber().is_bound()) return FALSE;
if(!single_value->field_rP__TypeOfNumber.match(other_value.rP__TypeOfNumber(), legacy))return FALSE;
if(!other_value.rP__Ext().is_bound()) return FALSE;
if(!single_value->field_rP__Ext.match(other_value.rP__Ext(), legacy))return FALSE;
if(!other_value.rP__NumberDigits().is_bound()) return FALSE;
if(!single_value->field_rP__NumberDigits.match(other_value.rP__NumberDigits(), 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_NumberingPlan_and_NumberDigits.");
}
return FALSE;
}

boolean RP__NumberingPlan__and__NumberDigits_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__NumberingPlanIdentification.is_bound()
 || single_value->field_rP__TypeOfNumber.is_bound()
 || single_value->field_rP__Ext.is_bound()
 || single_value->field_rP__NumberDigits.is_bound();
}

boolean RP__NumberingPlan__and__NumberDigits_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rP__NumberingPlanIdentification.is_value()
 && single_value->field_rP__TypeOfNumber.is_value()
 && single_value->field_rP__Ext.is_value()
 && single_value->field_rP__NumberDigits.is_value();
}

void RP__NumberingPlan__and__NumberDigits_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__NumberingPlan__and__NumberDigits RP__NumberingPlan__and__NumberDigits_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_NumberingPlan_and_NumberDigits.");
RP__NumberingPlan__and__NumberDigits ret_val;
if (single_value->field_rP__NumberingPlanIdentification.is_bound()) {
ret_val.rP__NumberingPlanIdentification() = single_value->field_rP__NumberingPlanIdentification.valueof();
}
if (single_value->field_rP__TypeOfNumber.is_bound()) {
ret_val.rP__TypeOfNumber() = single_value->field_rP__TypeOfNumber.valueof();
}
if (single_value->field_rP__Ext.is_bound()) {
ret_val.rP__Ext() = single_value->field_rP__Ext.valueof();
}
if (single_value->field_rP__NumberDigits.is_bound()) {
ret_val.rP__NumberDigits() = single_value->field_rP__NumberDigits.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__NumberingPlanIdentification()
{
set_specific();
return single_value->field_rP__NumberingPlanIdentification;
}

const BITSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__NumberingPlanIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_NumberingPlanIdentification of a non-specific template of type @MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.");
return single_value->field_rP__NumberingPlanIdentification;
}

BITSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__TypeOfNumber()
{
set_specific();
return single_value->field_rP__TypeOfNumber;
}

const BITSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__TypeOfNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_TypeOfNumber of a non-specific template of type @MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.");
return single_value->field_rP__TypeOfNumber;
}

BITSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__Ext()
{
set_specific();
return single_value->field_rP__Ext;
}

const BITSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__Ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_Ext of a non-specific template of type @MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.");
return single_value->field_rP__Ext;
}

HEXSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__NumberDigits()
{
set_specific();
return single_value->field_rP__NumberDigits;
}

const HEXSTRING_template& RP__NumberingPlan__and__NumberDigits_template::rP__NumberDigits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_NumberDigits of a non-specific template of type @MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits.");
return single_value->field_rP__NumberDigits;
}

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

void RP__NumberingPlan__and__NumberDigits_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rP_NumberingPlanIdentification := ");
single_value->field_rP__NumberingPlanIdentification.log();
TTCN_Logger::log_event_str(", rP_TypeOfNumber := ");
single_value->field_rP__TypeOfNumber.log();
TTCN_Logger::log_event_str(", rP_Ext := ");
single_value->field_rP__Ext.log();
TTCN_Logger::log_event_str(", rP_NumberDigits := ");
single_value->field_rP__NumberDigits.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__NumberingPlan__and__NumberDigits_template::log_match(const RP__NumberingPlan__and__NumberDigits& 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__NumberingPlanIdentification.match(match_value.rP__NumberingPlanIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_NumberingPlanIdentification");
single_value->field_rP__NumberingPlanIdentification.log_match(match_value.rP__NumberingPlanIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__TypeOfNumber.match(match_value.rP__TypeOfNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_TypeOfNumber");
single_value->field_rP__TypeOfNumber.log_match(match_value.rP__TypeOfNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__Ext.match(match_value.rP__Ext(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_Ext");
single_value->field_rP__Ext.log_match(match_value.rP__Ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rP__NumberDigits.match(match_value.rP__NumberDigits(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_NumberDigits");
single_value->field_rP__NumberDigits.log_match(match_value.rP__NumberDigits(), 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_NumberingPlanIdentification := ");
single_value->field_rP__NumberingPlanIdentification.log_match(match_value.rP__NumberingPlanIdentification(), legacy);
TTCN_Logger::log_event_str(", rP_TypeOfNumber := ");
single_value->field_rP__TypeOfNumber.log_match(match_value.rP__TypeOfNumber(), legacy);
TTCN_Logger::log_event_str(", rP_Ext := ");
single_value->field_rP__Ext.log_match(match_value.rP__Ext(), legacy);
TTCN_Logger::log_event_str(", rP_NumberDigits := ");
single_value->field_rP__NumberDigits.log_match(match_value.rP__NumberDigits(), 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__NumberingPlan__and__NumberDigits_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__NumberingPlanIdentification().is_bound()) rP__NumberingPlanIdentification().set_implicit_omit();
if (rP__TypeOfNumber().is_bound()) rP__TypeOfNumber().set_implicit_omit();
if (rP__Ext().is_bound()) rP__Ext().set_implicit_omit();
if (rP__NumberDigits().is_bound()) rP__NumberDigits().set_implicit_omit();
}

void RP__NumberingPlan__and__NumberDigits_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rP__NumberingPlanIdentification.encode_text(text_buf);
single_value->field_rP__TypeOfNumber.encode_text(text_buf);
single_value->field_rP__Ext.encode_text(text_buf);
single_value->field_rP__NumberDigits.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_NumberingPlan_and_NumberDigits.");
}
}

void RP__NumberingPlan__and__NumberDigits_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__NumberingPlanIdentification.decode_text(text_buf);
single_value->field_rP__TypeOfNumber.decode_text(text_buf);
single_value->field_rP__Ext.decode_text(text_buf);
single_value->field_rP__NumberDigits.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__NumberingPlan__and__NumberDigits_template[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_NumberingPlan_and_NumberDigits.");
}
}

void RP__NumberingPlan__and__NumberDigits_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__NumberingPlan__and__NumberDigits_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_NumberingPlan_and_NumberDigits 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__NumberingPlanIdentification().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__TypeOfNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__Ext().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rP__NumberDigits().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_NumberingPlanIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__NumberingPlanIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_TypeOfNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__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(), "rP_Ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__Ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rP_NumberDigits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__NumberDigits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_NumberingPlan_and_NumberDigits: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__NumberingPlan__and__NumberDigits_template* precondition = new RP__NumberingPlan__and__NumberDigits_template;
    precondition->set_param(*param.get_elem(0));
    RP__NumberingPlan__and__NumberDigits_template* implied_template = new RP__NumberingPlan__and__NumberDigits_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__NumberingPlan__and__NumberDigits_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits");
  }
  is_ifpresent = param.get_ifpresent();
}

void RP__NumberingPlan__and__NumberDigits_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__NumberingPlanIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits");
single_value->field_rP__TypeOfNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits");
single_value->field_rP__Ext.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits");
single_value->field_rP__NumberDigits.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_NumberingPlan_and_NumberDigits");
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_NumberingPlan_and_NumberDigits");
}

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

boolean RP__NumberingPlan__and__NumberDigits_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__DestinationAddressLV::RP__DestinationAddressLV()
{
}

RP__DestinationAddressLV::RP__DestinationAddressLV(const INTEGER& par_lengthIndicator,
    const OPTIONAL< RP__NumberingPlan__and__NumberDigits >& par_rP__DestinationAddress)
  :   field_lengthIndicator(par_lengthIndicator),
  field_rP__DestinationAddress(par_rP__DestinationAddress)
{
}

RP__DestinationAddressLV::RP__DestinationAddressLV(const RP__DestinationAddressLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_DestinationAddressLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.rP__DestinationAddress().is_bound()) field_rP__DestinationAddress = other_value.rP__DestinationAddress();
else field_rP__DestinationAddress.clean_up();
}

void RP__DestinationAddressLV::clean_up()
{
field_lengthIndicator.clean_up();
field_rP__DestinationAddress.clean_up();
}

const TTCN_Typedescriptor_t* RP__DestinationAddressLV::get_descriptor() const { return &RP__DestinationAddressLV_descr_; }
RP__DestinationAddressLV& RP__DestinationAddressLV::operator=(const RP__DestinationAddressLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_DestinationAddressLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.rP__DestinationAddress().is_bound()) field_rP__DestinationAddress = other_value.rP__DestinationAddress();
  else field_rP__DestinationAddress.clean_up();
}
return *this;
}

boolean RP__DestinationAddressLV::operator==(const RP__DestinationAddressLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_rP__DestinationAddress==other_value.field_rP__DestinationAddress;
}

boolean RP__DestinationAddressLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (OPTIONAL_OMIT == field_rP__DestinationAddress.get_selection() || field_rP__DestinationAddress.is_bound());
}
boolean RP__DestinationAddressLV::is_value() const
{
return field_lengthIndicator.is_value()
  && (OPTIONAL_OMIT == field_rP__DestinationAddress.get_selection() || field_rP__DestinationAddress.is_value());
}
int RP__DestinationAddressLV::size_of() const
{
  int ret_val = 1;
  if (field_rP__DestinationAddress.ispresent()) ret_val++;
  return ret_val;
}

void RP__DestinationAddressLV::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(", rP_DestinationAddress := ");
field_rP__DestinationAddress.log();
TTCN_Logger::log_event_str(" }");
}

void RP__DestinationAddressLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (!rP__DestinationAddress().is_bound()) rP__DestinationAddress() = OMIT_VALUE;
else rP__DestinationAddress().set_implicit_omit();
}

void RP__DestinationAddressLV::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_DestinationAddressLV 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) rP__DestinationAddress().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(), "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++) 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_DestinationAddressLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_DestinationAddressLV");
  }
}

void RP__DestinationAddressLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_rP__DestinationAddress.encode_text(text_buf);
}

void RP__DestinationAddressLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_rP__DestinationAddress.decode_text(text_buf);
}

void RP__DestinationAddressLV::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__DestinationAddressLV::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__DestinationAddressLV::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__DestinationAddressLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RP__DestinationAddressLV_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(RP__DestinationAddressLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_rP__DestinationAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, RP__NumberingPlan__and__NumberDigits_descr_.raw->forceomit);
  decoded_field_length = field_rP__DestinationAddress().RAW_decode(RP__NumberingPlan__and__NumberDigits_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_rP__DestinationAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_rP__DestinationAddress=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__DestinationAddressLV::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__DestinationAddressLV_lengthIndicator_descr_.raw);
  if (field_rP__DestinationAddress.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RP__NumberingPlan__and__NumberDigits_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RP__DestinationAddressLV_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;
  if (field_rP__DestinationAddress.ispresent()) {
  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;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = 0;
  }
  if (field_rP__DestinationAddress.ispresent()) {
  encoded_length += field_rP__DestinationAddress().RAW_encode(RP__NumberingPlan__and__NumberDigits_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct RP__DestinationAddressLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
RP__NumberingPlan__and__NumberDigits_template field_rP__DestinationAddress;
};

void RP__DestinationAddressLV_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_rP__DestinationAddress = ANY_OR_OMIT;
}
}
}

void RP__DestinationAddressLV_template::copy_value(const RP__DestinationAddressLV& 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.rP__DestinationAddress().is_bound()) {
  if (other_value.rP__DestinationAddress().ispresent()) single_value->field_rP__DestinationAddress = other_value.rP__DestinationAddress()();
  else single_value->field_rP__DestinationAddress = OMIT_VALUE;
} else {
  single_value->field_rP__DestinationAddress.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__DestinationAddressLV_template::copy_template(const RP__DestinationAddressLV_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.rP__DestinationAddress().get_selection()) {
single_value->field_rP__DestinationAddress = other_value.rP__DestinationAddress();
} else {
single_value->field_rP__DestinationAddress.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__DestinationAddressLV_template[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__DestinationAddressLV_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__DestinationAddressLV_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_DestinationAddressLV.");
break;
}
set_selection(other_value);
}

RP__DestinationAddressLV_template::RP__DestinationAddressLV_template()
{
}

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

RP__DestinationAddressLV_template::RP__DestinationAddressLV_template(const RP__DestinationAddressLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__DestinationAddressLV_template::match(const RP__DestinationAddressLV& 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.rP__DestinationAddress().is_bound()) return FALSE;
if((other_value.rP__DestinationAddress().ispresent() ? !single_value->field_rP__DestinationAddress.match((const RP__NumberingPlan__and__NumberDigits&)other_value.rP__DestinationAddress(), legacy) : !single_value->field_rP__DestinationAddress.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_DestinationAddressLV.");
}
return FALSE;
}

boolean RP__DestinationAddressLV_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_rP__DestinationAddress.is_omit() || single_value->field_rP__DestinationAddress.is_bound());
}

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

void RP__DestinationAddressLV_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__DestinationAddressLV RP__DestinationAddressLV_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_DestinationAddressLV.");
RP__DestinationAddressLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_rP__DestinationAddress.is_omit()) ret_val.rP__DestinationAddress() = OMIT_VALUE;
else if (single_value->field_rP__DestinationAddress.is_bound()) {
ret_val.rP__DestinationAddress() = single_value->field_rP__DestinationAddress.valueof();
}
return ret_val;
}

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

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

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

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

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

const RP__NumberingPlan__and__NumberDigits_template& RP__DestinationAddressLV_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_DestinationAddressLV.");
return single_value->field_rP__DestinationAddress;
}

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

void RP__DestinationAddressLV_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(", rP_DestinationAddress := ");
single_value->field_rP__DestinationAddress.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__DestinationAddressLV_template::log_match(const RP__DestinationAddressLV& 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 (match_value.rP__DestinationAddress().ispresent()){
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);
}
} else {
if (!single_value->field_rP__DestinationAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rP_DestinationAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rP__DestinationAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", rP_DestinationAddress := ");
if (match_value.rP__DestinationAddress().ispresent()) {
single_value->field_rP__DestinationAddress.log_match(match_value.rP__DestinationAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rP__DestinationAddress.log();
if (single_value->field_rP__DestinationAddress.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__DestinationAddressLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (!rP__DestinationAddress().is_bound()) rP__DestinationAddress() = OMIT_VALUE;
else rP__DestinationAddress().set_implicit_omit();
}

void RP__DestinationAddressLV_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_rP__DestinationAddress.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_DestinationAddressLV.");
}
}

void RP__DestinationAddressLV_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_rP__DestinationAddress.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__DestinationAddressLV_template[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_DestinationAddressLV.");
}
}

void RP__DestinationAddressLV_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__DestinationAddressLV_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_DestinationAddressLV 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) rP__DestinationAddress().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(), "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++) 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_DestinationAddressLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__DestinationAddressLV_template* precondition = new RP__DestinationAddressLV_template;
    precondition->set_param(*param.get_elem(0));
    RP__DestinationAddressLV_template* implied_template = new RP__DestinationAddressLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__DestinationAddressLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_DestinationAddressLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RP__DestinationAddressLV_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.RP_DestinationAddressLV");
single_value->field_rP__DestinationAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DestinationAddressLV");
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_DestinationAddressLV");
}

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

boolean RP__DestinationAddressLV_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__DATA__MS__SGSN::copy_value(const TPDU__RP__DATA__MS__SGSN& other_value)
{
switch (other_value.union_selection) {
case ALT_sMS__SUBMIT:
field_sMS__SUBMIT = new SMS__SUBMIT(*other_value.field_sMS__SUBMIT);
break;
case ALT_sMS__COMMAND:
field_sMS__COMMAND = new SMS__COMMAND(*other_value.field_sMS__COMMAND);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TPDU__RP__DATA__MS__SGSN::operator==(const TPDU__RP__DATA__MS__SGSN& 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_MS_SGSN.");
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_MS_SGSN.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sMS__SUBMIT:
return *field_sMS__SUBMIT == *other_value.field_sMS__SUBMIT;
case ALT_sMS__COMMAND:
return *field_sMS__COMMAND == *other_value.field_sMS__COMMAND;
default:
return FALSE;
}
}

SMS__SUBMIT& TPDU__RP__DATA__MS__SGSN::sMS__SUBMIT()
{
if (union_selection != ALT_sMS__SUBMIT) {
clean_up();
field_sMS__SUBMIT = new SMS__SUBMIT;
union_selection = ALT_sMS__SUBMIT;
}
return *field_sMS__SUBMIT;
}

const SMS__SUBMIT& TPDU__RP__DATA__MS__SGSN::sMS__SUBMIT() const
{
if (union_selection != ALT_sMS__SUBMIT) TTCN_error("Using non-selected field sMS_SUBMIT in a value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
return *field_sMS__SUBMIT;
}

SMS__COMMAND& TPDU__RP__DATA__MS__SGSN::sMS__COMMAND()
{
if (union_selection != ALT_sMS__COMMAND) {
clean_up();
field_sMS__COMMAND = new SMS__COMMAND;
union_selection = ALT_sMS__COMMAND;
}
return *field_sMS__COMMAND;
}

const SMS__COMMAND& TPDU__RP__DATA__MS__SGSN::sMS__COMMAND() const
{
if (union_selection != ALT_sMS__COMMAND) TTCN_error("Using non-selected field sMS_COMMAND in a value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
return *field_sMS__COMMAND;
}

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

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

boolean TPDU__RP__DATA__MS__SGSN::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_sMS__SUBMIT: return field_sMS__SUBMIT->is_value();
case ALT_sMS__COMMAND: return field_sMS__COMMAND->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TPDU__RP__DATA__MS__SGSN::clean_up()
{
switch (union_selection) {
case ALT_sMS__SUBMIT:
  delete field_sMS__SUBMIT;
  break;
case ALT_sMS__COMMAND:
  delete field_sMS__COMMAND;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TPDU__RP__DATA__MS__SGSN::log() const
{
switch (union_selection) {
case ALT_sMS__SUBMIT:
TTCN_Logger::log_event_str("{ sMS_SUBMIT := ");
field_sMS__SUBMIT->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_sMS__COMMAND:
TTCN_Logger::log_event_str("{ sMS_COMMAND := ");
field_sMS__COMMAND->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TPDU__RP__DATA__MS__SGSN::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")) {
    sMS__SUBMIT().set_param(*mp_last);
    if (!sMS__SUBMIT().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "sMS_COMMAND")) {
    sMS__COMMAND().set_param(*mp_last);
    if (!sMS__COMMAND().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.", last_name);
}

void TPDU__RP__DATA__MS__SGSN::set_implicit_omit()
{
switch (union_selection) {
case ALT_sMS__SUBMIT:
field_sMS__SUBMIT->set_implicit_omit(); break;
case ALT_sMS__COMMAND:
field_sMS__COMMAND->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__DATA__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_sMS__SUBMIT:
field_sMS__SUBMIT->encode_text(text_buf);
break;
case ALT_sMS__COMMAND:
field_sMS__COMMAND->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
}
}

void TPDU__RP__DATA__MS__SGSN::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_sMS__SUBMIT:
sMS__SUBMIT().decode_text(text_buf);
break;
case ALT_sMS__COMMAND:
sMS__COMMAND().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
}
}

void TPDU__RP__DATA__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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_descr_.raw->forceomit);
      decoded_length = sMS__SUBMIT().RAW_decode(SMS__SUBMIT_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__COMMAND_descr_.raw->forceomit);
      decoded_length = sMS__COMMAND().RAW_decode(SMS__COMMAND_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_0) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, SMS__SUBMIT_descr_.raw->forceomit);
          decoded_length = sMS__SUBMIT().RAW_decode(SMS__SUBMIT_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__SUBMIT).tP__MTI() ==  bs_0) {
               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__COMMAND_descr_.raw->forceomit);
          decoded_length = sMS__COMMAND().RAW_decode(SMS__COMMAND_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__COMMAND).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__MS__SGSN::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__SUBMIT:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SMS__SUBMIT_descr_.raw);
    encoded_length = field_sMS__SUBMIT->RAW_encode(SMS__SUBMIT_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SMS__SUBMIT_descr_;
    if ((*field_sMS__SUBMIT).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;
  case ALT_sMS__COMMAND:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, SMS__COMMAND_descr_.raw);
    encoded_length = field_sMS__COMMAND->RAW_encode(SMS__COMMAND_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &SMS__COMMAND_descr_;
    if ((*field_sMS__COMMAND).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__MS__SGSN_template::copy_value(const TPDU__RP__DATA__MS__SGSN& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
single_value.field_sMS__SUBMIT = new SMS__SUBMIT_template(other_value.sMS__SUBMIT());
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
single_value.field_sMS__COMMAND = new SMS__COMMAND_template(other_value.sMS__COMMAND());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
}
set_selection(SPECIFIC_VALUE);
}

void TPDU__RP__DATA__MS__SGSN_template::copy_template(const TPDU__RP__DATA__MS__SGSN_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__MS__SGSN::ALT_sMS__SUBMIT:
single_value.field_sMS__SUBMIT = new SMS__SUBMIT_template(*other_value.single_value.field_sMS__SUBMIT);
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
single_value.field_sMS__COMMAND = new SMS__COMMAND_template(*other_value.single_value.field_sMS__COMMAND);
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_MS_SGSN.");
}
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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new TPDU__RP__DATA__MS__SGSN_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_MS_SGSN.");
}
set_selection(other_value);
}

TPDU__RP__DATA__MS__SGSN_template::TPDU__RP__DATA__MS__SGSN_template()
{
}

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

TPDU__RP__DATA__MS__SGSN_template::TPDU__RP__DATA__MS__SGSN_template(const TPDU__RP__DATA__MS__SGSN& other_value)
{
copy_value(other_value);
}

TPDU__RP__DATA__MS__SGSN_template::TPDU__RP__DATA__MS__SGSN_template(const OPTIONAL<TPDU__RP__DATA__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TPDU__RP__DATA__MS__SGSN&)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_MS_SGSN from an unbound optional field.");
}
}

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

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

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

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

void TPDU__RP__DATA__MS__SGSN_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
delete single_value.field_sMS__SUBMIT;
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
delete single_value.field_sMS__COMMAND;
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__MS__SGSN_template& TPDU__RP__DATA__MS__SGSN_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

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

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

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

boolean TPDU__RP__DATA__MS__SGSN_template::match(const TPDU__RP__DATA__MS__SGSN& 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__MS__SGSN::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TPDU__RP__DATA__MS__SGSN::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
return single_value.field_sMS__SUBMIT->match(other_value.sMS__SUBMIT(), legacy);
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
return single_value.field_sMS__COMMAND->match(other_value.sMS__COMMAND(), 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_MS_SGSN.");
}
}
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_MS_SGSN.");
}
return FALSE;
}

boolean TPDU__RP__DATA__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
return single_value.field_sMS__SUBMIT->is_value();
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
return single_value.field_sMS__COMMAND->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_MS_SGSN.");
}
}

TPDU__RP__DATA__MS__SGSN TPDU__RP__DATA__MS__SGSN_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_MS_SGSN.");
TPDU__RP__DATA__MS__SGSN ret_val;
switch (single_value.union_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
ret_val.sMS__SUBMIT() = single_value.field_sMS__SUBMIT->valueof();
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
ret_val.sMS__COMMAND() = single_value.field_sMS__COMMAND->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_MS_SGSN.");
}
return ret_val;
}

TPDU__RP__DATA__MS__SGSN_template& TPDU__RP__DATA__MS__SGSN_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_MS_SGSN.");
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_MS_SGSN.");
return value_list.list_value[list_index];
}
void TPDU__RP__DATA__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TPDU__RP__DATA__MS__SGSN_template[list_length];
}

SMS__SUBMIT_template& TPDU__RP__DATA__MS__SGSN_template::sMS__SUBMIT()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__SUBMIT = new SMS__SUBMIT_template(ANY_VALUE);
else single_value.field_sMS__SUBMIT = new SMS__SUBMIT_template;
single_value.union_selection = TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__SUBMIT;
}

const SMS__SUBMIT_template& TPDU__RP__DATA__MS__SGSN_template::sMS__SUBMIT() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_SUBMIT in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
if (single_value.union_selection != TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT) TTCN_error("Accessing non-selected field sMS_SUBMIT in a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
return *single_value.field_sMS__SUBMIT;
}

SMS__COMMAND_template& TPDU__RP__DATA__MS__SGSN_template::sMS__COMMAND()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__COMMAND = new SMS__COMMAND_template(ANY_VALUE);
else single_value.field_sMS__COMMAND = new SMS__COMMAND_template;
single_value.union_selection = TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__COMMAND;
}

const SMS__COMMAND_template& TPDU__RP__DATA__MS__SGSN_template::sMS__COMMAND() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_COMMAND in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
if (single_value.union_selection != TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND) TTCN_error("Accessing non-selected field sMS_COMMAND in a template of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
return *single_value.field_sMS__COMMAND;
}

boolean TPDU__RP__DATA__MS__SGSN_template::ischosen(TPDU__RP__DATA__MS__SGSN::union_selection_type checked_selection) const
{
if (checked_selection == TPDU__RP__DATA__MS__SGSN::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TPDU__RP__DATA__MS__SGSN::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_MS_SGSN.");
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_MS_SGSN 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__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
TTCN_Logger::log_event_str("{ sMS_SUBMIT := ");
single_value.field_sMS__SUBMIT->log();
TTCN_Logger::log_event_str(" }");
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
TTCN_Logger::log_event_str("{ sMS_COMMAND := ");
single_value.field_sMS__COMMAND->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__MS__SGSN_template::log_match(const TPDU__RP__DATA__MS__SGSN& 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__MS__SGSN::ALT_sMS__SUBMIT:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_SUBMIT");
single_value.field_sMS__SUBMIT->log_match(match_value.sMS__SUBMIT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_SUBMIT := ");
single_value.field_sMS__SUBMIT->log_match(match_value.sMS__SUBMIT(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_COMMAND");
single_value.field_sMS__COMMAND->log_match(match_value.sMS__COMMAND(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_COMMAND := ");
single_value.field_sMS__COMMAND->log_match(match_value.sMS__COMMAND(), 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__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
single_value.field_sMS__SUBMIT->set_implicit_omit(); break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
single_value.field_sMS__COMMAND->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__DATA__MS__SGSN_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__MS__SGSN::ALT_sMS__SUBMIT:
single_value.field_sMS__SUBMIT->encode_text(text_buf);
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
single_value.field_sMS__COMMAND->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_MS_SGSN.");
}
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_MS_SGSN.");
}
}

void TPDU__RP__DATA__MS__SGSN_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__MS__SGSN::UNBOUND_VALUE;
TPDU__RP__DATA__MS__SGSN::union_selection_type new_selection = (TPDU__RP__DATA__MS__SGSN::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__SUBMIT:
single_value.field_sMS__SUBMIT = new SMS__SUBMIT_template;
single_value.field_sMS__SUBMIT->decode_text(text_buf);
break;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
single_value.field_sMS__COMMAND = new SMS__COMMAND_template;
single_value.field_sMS__COMMAND->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_MS_SGSN.");
}
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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

boolean TPDU__RP__DATA__MS__SGSN_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__MS__SGSN_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_MS_SGSN'");
    }
    if (strcmp("sMS_SUBMIT", param_field) == 0) {
      sMS__SUBMIT().set_param(param);
      return;
    } else if (strcmp("sMS_COMMAND", param_field) == 0) {
      sMS__COMMAND().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN'", 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__MS__SGSN_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_MS_SGSN");
    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")) {
      sMS__SUBMIT().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "sMS_COMMAND")) {
      sMS__COMMAND().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TPDU__RP__DATA__MS__SGSN_template* precondition = new TPDU__RP__DATA__MS__SGSN_template;
    precondition->set_param(*m_p->get_elem(0));
    TPDU__RP__DATA__MS__SGSN_template* implied_template = new TPDU__RP__DATA__MS__SGSN_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TPDU__RP__DATA__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void TPDU__RP__DATA__MS__SGSN_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__MS__SGSN::ALT_sMS__SUBMIT:
single_value.field_sMS__SUBMIT->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN");
return;
case TPDU__RP__DATA__MS__SGSN::ALT_sMS__COMMAND:
single_value.field_sMS__COMMAND->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_DATA_MS_SGSN");
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_MS_SGSN.");
}
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_MS_SGSN");
}

TP__DA__NoPad::TP__DA__NoPad()
{
}

TP__DA__NoPad::TP__DA__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__DAValue)
  :   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__DAValue(par_tP__DAValue)
{
}

TP__DA__NoPad::TP__DA__NoPad(const TP__DA__NoPad& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_DA_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__DAValue().is_bound()) field_tP__DAValue = other_value.tP__DAValue();
else field_tP__DAValue.clean_up();
}

void TP__DA__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__DAValue.clean_up();
}

const TTCN_Typedescriptor_t* TP__DA__NoPad::get_descriptor() const { return &TP__DA__NoPad_descr_; }
TP__DA__NoPad& TP__DA__NoPad::operator=(const TP__DA__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_DA_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__DAValue().is_bound()) field_tP__DAValue = other_value.tP__DAValue();
  else field_tP__DAValue.clean_up();
}
return *this;
}

boolean TP__DA__NoPad::operator==(const TP__DA__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__DAValue==other_value.field_tP__DAValue;
}

boolean TP__DA__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__DAValue.is_bound());
}
boolean TP__DA__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__DAValue.is_value();
}
void TP__DA__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_DAValue := ");
field_tP__DAValue.log();
TTCN_Logger::log_event_str(" }");
}

void TP__DA__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__DAValue().is_bound()) tP__DAValue().set_implicit_omit();
}

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

void TP__DA__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__DAValue.encode_text(text_buf);
}

void TP__DA__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__DAValue.decode_text(text_buf);
}

void TP__DA__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__DA__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__DA__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__DA__NoPad_tP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_tP__LengthIndicator.RAW_decode(TP__DA__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__DA__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__DAValue.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__DA__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__DA__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__DA__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__DAValue.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct TP__DA__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__DAValue;
};

void TP__DA__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__DAValue = ANY_VALUE;
}
}
}

void TP__DA__NoPad_template::copy_value(const TP__DA__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__DAValue().is_bound()) {
  single_value->field_tP__DAValue = other_value.tP__DAValue();
} else {
  single_value->field_tP__DAValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__DA__NoPad_template::copy_template(const TP__DA__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__DAValue().get_selection()) {
single_value->field_tP__DAValue = other_value.tP__DAValue();
} else {
single_value->field_tP__DAValue.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__DA__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__DA__NoPad_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__DA__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_DA_NoPad.");
break;
}
set_selection(other_value);
}

TP__DA__NoPad_template::TP__DA__NoPad_template()
{
}

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

TP__DA__NoPad_template::TP__DA__NoPad_template(const TP__DA__NoPad& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__DA__NoPad_template::match(const TP__DA__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__DAValue().is_bound()) return FALSE;
if(!single_value->field_tP__DAValue.match(other_value.tP__DAValue(), 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_DA_NoPad.");
}
return FALSE;
}

boolean TP__DA__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__DAValue.is_bound();
}

boolean TP__DA__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__DAValue.is_value();
}

void TP__DA__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__DA__NoPad TP__DA__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_DA_NoPad.");
TP__DA__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__DAValue.is_bound()) {
ret_val.tP__DAValue() = single_value->field_tP__DAValue.valueof();
}
return ret_val;
}

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

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

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

const INTEGER_template& TP__DA__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_DA_NoPad.");
return single_value->field_tP__LengthIndicator;
}

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

const BITSTRING_template& TP__DA__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_DA_NoPad.");
return single_value->field_tP__NumberingPlanID;
}

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

const BITSTRING_template& TP__DA__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_DA_NoPad.");
return single_value->field_tP__TypeOfNumber;
}

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

const BITSTRING_template& TP__DA__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_DA_NoPad.");
return single_value->field_tp__Spare;
}

HEXSTRING_template& TP__DA__NoPad_template::tP__DAValue()
{
set_specific();
return single_value->field_tP__DAValue;
}

const HEXSTRING_template& TP__DA__NoPad_template::tP__DAValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DAValue of a non-specific template of type @MobileL3_SMS_Types.TP_DA_NoPad.");
return single_value->field_tP__DAValue;
}

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

void TP__DA__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_DAValue := ");
single_value->field_tP__DAValue.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__DA__NoPad_template::log_match(const TP__DA__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__DAValue.match(match_value.tP__DAValue(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DAValue");
single_value->field_tP__DAValue.log_match(match_value.tP__DAValue(), 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_DAValue := ");
single_value->field_tP__DAValue.log_match(match_value.tP__DAValue(), 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__DA__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__DAValue().is_bound()) tP__DAValue().set_implicit_omit();
}

void TP__DA__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__DAValue.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_DA_NoPad.");
}
}

void TP__DA__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__DAValue.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__DA__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_DA_NoPad.");
}
}

void TP__DA__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__DA__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_DA_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__DAValue().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_DAValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DAValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_DA_NoPad: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TP__DA__NoPad_template* precondition = new TP__DA__NoPad_template;
    precondition->set_param(*param.get_elem(0));
    TP__DA__NoPad_template* implied_template = new TP__DA__NoPad_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TP__DA__NoPad_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.TP_DA_NoPad");
  }
  is_ifpresent = param.get_ifpresent();
}

void TP__DA__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_DA_NoPad");
single_value->field_tP__NumberingPlanID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_DA_NoPad");
single_value->field_tP__TypeOfNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_DA_NoPad");
single_value->field_tp__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_DA_NoPad");
single_value->field_tP__DAValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_DA_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_DA_NoPad");
}

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

boolean TP__DA__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__DA::TP__DA()
{
}

TP__DA::TP__DA(const TP__DA__NoPad& par_tP__DA__NoPad)
  :   field_tP__DA__NoPad(par_tP__DA__NoPad)
{
}

TP__DA::TP__DA(const TP__DA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_DA.");
if (other_value.tP__DA__NoPad().is_bound()) field_tP__DA__NoPad = other_value.tP__DA__NoPad();
else field_tP__DA__NoPad.clean_up();
}

void TP__DA::clean_up()
{
field_tP__DA__NoPad.clean_up();
}

const TTCN_Typedescriptor_t* TP__DA::get_descriptor() const { return &TP__DA_descr_; }
TP__DA& TP__DA::operator=(const TP__DA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.TP_DA.");
  if (other_value.tP__DA__NoPad().is_bound()) field_tP__DA__NoPad = other_value.tP__DA__NoPad();
  else field_tP__DA__NoPad.clean_up();
}
return *this;
}

boolean TP__DA::operator==(const TP__DA& other_value) const
{
return field_tP__DA__NoPad==other_value.field_tP__DA__NoPad;
}

boolean TP__DA::is_bound() const
{
return (field_tP__DA__NoPad.is_bound());
}
boolean TP__DA::is_value() const
{
return field_tP__DA__NoPad.is_value();
}
void TP__DA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_DA_NoPad := ");
field_tP__DA__NoPad.log();
TTCN_Logger::log_event_str(" }");
}

void TP__DA::set_implicit_omit()
{
if (tP__DA__NoPad().is_bound()) tP__DA__NoPad().set_implicit_omit();
}

void TP__DA::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_DA 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__DA__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_DA_NoPad")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DA__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_DA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.TP_DA");
  }
}

void TP__DA::encode_text(Text_Buf& text_buf) const
{
field_tP__DA__NoPad.encode_text(text_buf);
}

void TP__DA::decode_text(Text_Buf& text_buf)
{
field_tP__DA__NoPad.decode_text(text_buf);
}

void TP__DA::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__DA::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__DA::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__DA__NoPad_descr_.raw->forceomit);
  decoded_field_length = field_tP__DA__NoPad.RAW_decode(TP__DA__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__DA::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__DA__NoPad_descr_.raw);
  encoded_length += field_tP__DA__NoPad.RAW_encode(TP__DA__NoPad_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct TP__DA_template::single_value_struct {
TP__DA__NoPad_template field_tP__DA__NoPad;
};

void TP__DA_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__DA__NoPad = ANY_VALUE;
}
}
}

void TP__DA_template::copy_value(const TP__DA& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__DA__NoPad().is_bound()) {
  single_value->field_tP__DA__NoPad = other_value.tP__DA__NoPad();
} else {
  single_value->field_tP__DA__NoPad.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__DA_template::copy_template(const TP__DA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__DA__NoPad().get_selection()) {
single_value->field_tP__DA__NoPad = other_value.tP__DA__NoPad();
} else {
single_value->field_tP__DA__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__DA_template[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__DA_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__DA_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_DA.");
break;
}
set_selection(other_value);
}

TP__DA_template::TP__DA_template()
{
}

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

TP__DA_template::TP__DA_template(const TP__DA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__DA_template::match(const TP__DA& 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__DA__NoPad().is_bound()) return FALSE;
if(!single_value->field_tP__DA__NoPad.match(other_value.tP__DA__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_DA.");
}
return FALSE;
}

boolean TP__DA_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__DA__NoPad.is_bound();
}

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

void TP__DA_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__DA TP__DA_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_DA.");
TP__DA ret_val;
if (single_value->field_tP__DA__NoPad.is_bound()) {
ret_val.tP__DA__NoPad() = single_value->field_tP__DA__NoPad.valueof();
}
return ret_val;
}

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

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

TP__DA__NoPad_template& TP__DA_template::tP__DA__NoPad()
{
set_specific();
return single_value->field_tP__DA__NoPad;
}

const TP__DA__NoPad_template& TP__DA_template::tP__DA__NoPad() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DA_NoPad of a non-specific template of type @MobileL3_SMS_Types.TP_DA.");
return single_value->field_tP__DA__NoPad;
}

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

void TP__DA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_DA_NoPad := ");
single_value->field_tP__DA__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__DA_template::log_match(const TP__DA& 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__DA__NoPad.match(match_value.tP__DA__NoPad(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DA_NoPad");
single_value->field_tP__DA__NoPad.log_match(match_value.tP__DA__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_DA_NoPad := ");
single_value->field_tP__DA__NoPad.log_match(match_value.tP__DA__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__DA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__DA__NoPad().is_bound()) tP__DA__NoPad().set_implicit_omit();
}

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

void TP__DA_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__DA__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__DA_template[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_DA.");
}
}

void TP__DA_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__DA_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_DA 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__DA__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_DA_NoPad")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DA__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_DA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TP__DA_template* precondition = new TP__DA_template;
    precondition->set_param(*param.get_elem(0));
    TP__DA_template* implied_template = new TP__DA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TP__DA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.TP_DA");
  }
  is_ifpresent = param.get_ifpresent();
}

void TP__DA_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__DA__NoPad.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_DA");
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_DA");
}

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

boolean TP__DA_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__UDL__UD::TP__UDL__UD()
{
}

TP__UDL__UD::TP__UDL__UD(const INTEGER& par_tP__LengthIndicator,
    const OCTETSTRING& par_tP__UD)
  :   field_tP__LengthIndicator(par_tP__LengthIndicator),
  field_tP__UD(par_tP__UD)
{
}

TP__UDL__UD::TP__UDL__UD(const TP__UDL__UD& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_UDL_UD.");
if (other_value.tP__LengthIndicator().is_bound()) field_tP__LengthIndicator = other_value.tP__LengthIndicator();
else field_tP__LengthIndicator.clean_up();
if (other_value.tP__UD().is_bound()) field_tP__UD = other_value.tP__UD();
else field_tP__UD.clean_up();
}

void TP__UDL__UD::clean_up()
{
field_tP__LengthIndicator.clean_up();
field_tP__UD.clean_up();
}

const TTCN_Typedescriptor_t* TP__UDL__UD::get_descriptor() const { return &TP__UDL__UD_descr_; }
TP__UDL__UD& TP__UDL__UD::operator=(const TP__UDL__UD& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.TP_UDL_UD.");
  if (other_value.tP__LengthIndicator().is_bound()) field_tP__LengthIndicator = other_value.tP__LengthIndicator();
  else field_tP__LengthIndicator.clean_up();
  if (other_value.tP__UD().is_bound()) field_tP__UD = other_value.tP__UD();
  else field_tP__UD.clean_up();
}
return *this;
}

boolean TP__UDL__UD::operator==(const TP__UDL__UD& other_value) const
{
return field_tP__LengthIndicator==other_value.field_tP__LengthIndicator
  && field_tP__UD==other_value.field_tP__UD;
}

boolean TP__UDL__UD::is_bound() const
{
return (field_tP__LengthIndicator.is_bound())
  || (field_tP__UD.is_bound());
}
boolean TP__UDL__UD::is_value() const
{
return field_tP__LengthIndicator.is_value()
  && field_tP__UD.is_value();
}
void TP__UDL__UD::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_UD := ");
field_tP__UD.log();
TTCN_Logger::log_event_str(" }");
}

void TP__UDL__UD::set_implicit_omit()
{
if (tP__LengthIndicator().is_bound()) tP__LengthIndicator().set_implicit_omit();
if (tP__UD().is_bound()) tP__UD().set_implicit_omit();
}

void TP__UDL__UD::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.TP_UDL_UD 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) tP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__UD().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(), "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_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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.TP_UDL_UD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.TP_UDL_UD");
  }
}

void TP__UDL__UD::encode_text(Text_Buf& text_buf) const
{
field_tP__LengthIndicator.encode_text(text_buf);
field_tP__UD.encode_text(text_buf);
}

void TP__UDL__UD::decode_text(Text_Buf& text_buf)
{
field_tP__LengthIndicator.decode_text(text_buf);
field_tP__UD.decode_text(text_buf);
}

void TP__UDL__UD::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__UDL__UD::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__UDL__UD::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, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_tP__LengthIndicator.RAW_decode(INTEGER_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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_tP__UD.RAW_decode(OCTETSTRING_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TP__UDL__UD::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, INTEGER_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, OCTETSTRING_descr_.raw);
  encoded_length += field_tP__LengthIndicator.RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tP__UD.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct TP__UDL__UD_template::single_value_struct {
INTEGER_template field_tP__LengthIndicator;
OCTETSTRING_template field_tP__UD;
};

void TP__UDL__UD_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__UD = ANY_VALUE;
}
}
}

void TP__UDL__UD_template::copy_value(const TP__UDL__UD& 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__UD().is_bound()) {
  single_value->field_tP__UD = other_value.tP__UD();
} else {
  single_value->field_tP__UD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__UDL__UD_template::copy_template(const TP__UDL__UD_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__UD().get_selection()) {
single_value->field_tP__UD = other_value.tP__UD();
} else {
single_value->field_tP__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 TP__UDL__UD_template[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__UDL__UD_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__UDL__UD_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_UDL_UD.");
break;
}
set_selection(other_value);
}

TP__UDL__UD_template::TP__UDL__UD_template()
{
}

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

TP__UDL__UD_template::TP__UDL__UD_template(const TP__UDL__UD& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__UDL__UD_template::match(const TP__UDL__UD& 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__UD().is_bound()) return FALSE;
if(!single_value->field_tP__UD.match(other_value.tP__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.TP_UDL_UD.");
}
return FALSE;
}

boolean TP__UDL__UD_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__UD.is_bound();
}

boolean TP__UDL__UD_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__UD.is_value();
}

void TP__UDL__UD_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__UDL__UD TP__UDL__UD_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_UDL_UD.");
TP__UDL__UD 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__UD.is_bound()) {
ret_val.tP__UD() = single_value->field_tP__UD.valueof();
}
return ret_val;
}

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

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

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

const INTEGER_template& TP__UDL__UD_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_UDL_UD.");
return single_value->field_tP__LengthIndicator;
}

OCTETSTRING_template& TP__UDL__UD_template::tP__UD()
{
set_specific();
return single_value->field_tP__UD;
}

const OCTETSTRING_template& TP__UDL__UD_template::tP__UD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_UD of a non-specific template of type @MobileL3_SMS_Types.TP_UDL_UD.");
return single_value->field_tP__UD;
}

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

void TP__UDL__UD_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_UD := ");
single_value->field_tP__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 TP__UDL__UD_template::log_match(const TP__UDL__UD& 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__UD.match(match_value.tP__UD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_UD");
single_value->field_tP__UD.log_match(match_value.tP__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_LengthIndicator := ");
single_value->field_tP__LengthIndicator.log_match(match_value.tP__LengthIndicator(), legacy);
TTCN_Logger::log_event_str(", tP_UD := ");
single_value->field_tP__UD.log_match(match_value.tP__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 TP__UDL__UD_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__LengthIndicator().is_bound()) tP__LengthIndicator().set_implicit_omit();
if (tP__UD().is_bound()) tP__UD().set_implicit_omit();
}

void TP__UDL__UD_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__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.TP_UDL_UD.");
}
}

void TP__UDL__UD_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__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 TP__UDL__UD_template[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_UDL_UD.");
}
}

void TP__UDL__UD_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__UDL__UD_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.TP_UDL_UD 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) tP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__UD().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(), "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_UD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__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.TP_UDL_UD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TP__UDL__UD_template* precondition = new TP__UDL__UD_template;
    precondition->set_param(*param.get_elem(0));
    TP__UDL__UD_template* implied_template = new TP__UDL__UD_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TP__UDL__UD_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.TP_UDL_UD");
  }
  is_ifpresent = param.get_ifpresent();
}

void TP__UDL__UD_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_UDL_UD");
single_value->field_tP__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_UDL_UD");
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_UDL_UD");
}

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

boolean TP__UDL__UD_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__SUBMIT::SMS__SUBMIT()
{
}

SMS__SUBMIT::SMS__SUBMIT(const BITSTRING& par_tP__MTI,
    const BITSTRING& par_tP__RD,
    const BITSTRING& par_tP__VPF,
    const BITSTRING& par_tP__SRR,
    const BITSTRING& par_tP__UDHI,
    const BITSTRING& par_tP__RP,
    const OCTETSTRING& par_tP__MR,
    const TP__DA& par_tP__DA,
    const OCTETSTRING& par_tP__PID,
    const OCTETSTRING& par_tP__DCS,
    const OPTIONAL< TP__VP >& par_tP__VP,
    const TP__UDL__UD& par_tP__UDL__UD)
  :   field_tP__MTI(par_tP__MTI),
  field_tP__RD(par_tP__RD),
  field_tP__VPF(par_tP__VPF),
  field_tP__SRR(par_tP__SRR),
  field_tP__UDHI(par_tP__UDHI),
  field_tP__RP(par_tP__RP),
  field_tP__MR(par_tP__MR),
  field_tP__DA(par_tP__DA),
  field_tP__PID(par_tP__PID),
  field_tP__DCS(par_tP__DCS),
  field_tP__VP(par_tP__VP),
  field_tP__UDL__UD(par_tP__UDL__UD)
{
}

SMS__SUBMIT::SMS__SUBMIT(const SMS__SUBMIT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_SUBMIT.");
if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
else field_tP__MTI.clean_up();
if (other_value.tP__RD().is_bound()) field_tP__RD = other_value.tP__RD();
else field_tP__RD.clean_up();
if (other_value.tP__VPF().is_bound()) field_tP__VPF = other_value.tP__VPF();
else field_tP__VPF.clean_up();
if (other_value.tP__SRR().is_bound()) field_tP__SRR = other_value.tP__SRR();
else field_tP__SRR.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__MR().is_bound()) field_tP__MR = other_value.tP__MR();
else field_tP__MR.clean_up();
if (other_value.tP__DA().is_bound()) field_tP__DA = other_value.tP__DA();
else field_tP__DA.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__VP().is_bound()) field_tP__VP = other_value.tP__VP();
else field_tP__VP.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::clean_up()
{
field_tP__MTI.clean_up();
field_tP__RD.clean_up();
field_tP__VPF.clean_up();
field_tP__SRR.clean_up();
field_tP__UDHI.clean_up();
field_tP__RP.clean_up();
field_tP__MR.clean_up();
field_tP__DA.clean_up();
field_tP__PID.clean_up();
field_tP__DCS.clean_up();
field_tP__VP.clean_up();
field_tP__UDL__UD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__SUBMIT::get_descriptor() const { return &SMS__SUBMIT_descr_; }
SMS__SUBMIT& SMS__SUBMIT::operator=(const SMS__SUBMIT& 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.");
  if (other_value.tP__MTI().is_bound()) field_tP__MTI = other_value.tP__MTI();
  else field_tP__MTI.clean_up();
  if (other_value.tP__RD().is_bound()) field_tP__RD = other_value.tP__RD();
  else field_tP__RD.clean_up();
  if (other_value.tP__VPF().is_bound()) field_tP__VPF = other_value.tP__VPF();
  else field_tP__VPF.clean_up();
  if (other_value.tP__SRR().is_bound()) field_tP__SRR = other_value.tP__SRR();
  else field_tP__SRR.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__MR().is_bound()) field_tP__MR = other_value.tP__MR();
  else field_tP__MR.clean_up();
  if (other_value.tP__DA().is_bound()) field_tP__DA = other_value.tP__DA();
  else field_tP__DA.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__VP().is_bound()) field_tP__VP = other_value.tP__VP();
  else field_tP__VP.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::operator==(const SMS__SUBMIT& other_value) const
{
return field_tP__MTI==other_value.field_tP__MTI
  && field_tP__RD==other_value.field_tP__RD
  && field_tP__VPF==other_value.field_tP__VPF
  && field_tP__SRR==other_value.field_tP__SRR
  && field_tP__UDHI==other_value.field_tP__UDHI
  && field_tP__RP==other_value.field_tP__RP
  && field_tP__MR==other_value.field_tP__MR
  && field_tP__DA==other_value.field_tP__DA
  && field_tP__PID==other_value.field_tP__PID
  && field_tP__DCS==other_value.field_tP__DCS
  && field_tP__VP==other_value.field_tP__VP
  && field_tP__UDL__UD==other_value.field_tP__UDL__UD;
}

boolean SMS__SUBMIT::is_bound() const
{
return (field_tP__MTI.is_bound())
  || (field_tP__RD.is_bound())
  || (field_tP__VPF.is_bound())
  || (field_tP__SRR.is_bound())
  || (field_tP__UDHI.is_bound())
  || (field_tP__RP.is_bound())
  || (field_tP__MR.is_bound())
  || (field_tP__DA.is_bound())
  || (field_tP__PID.is_bound())
  || (field_tP__DCS.is_bound())
  || (OPTIONAL_OMIT == field_tP__VP.get_selection() || field_tP__VP.is_bound())
  || (field_tP__UDL__UD.is_bound());
}
boolean SMS__SUBMIT::is_value() const
{
return field_tP__MTI.is_value()
  && field_tP__RD.is_value()
  && field_tP__VPF.is_value()
  && field_tP__SRR.is_value()
  && field_tP__UDHI.is_value()
  && field_tP__RP.is_value()
  && field_tP__MR.is_value()
  && field_tP__DA.is_value()
  && field_tP__PID.is_value()
  && field_tP__DCS.is_value()
  && (OPTIONAL_OMIT == field_tP__VP.get_selection() || field_tP__VP.is_value())
  && field_tP__UDL__UD.is_value();
}
int SMS__SUBMIT::size_of() const
{
  int ret_val = 11;
  if (field_tP__VP.ispresent()) ret_val++;
  return ret_val;
}

void SMS__SUBMIT::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_RD := ");
field_tP__RD.log();
TTCN_Logger::log_event_str(", tP_VPF := ");
field_tP__VPF.log();
TTCN_Logger::log_event_str(", tP_SRR := ");
field_tP__SRR.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_MR := ");
field_tP__MR.log();
TTCN_Logger::log_event_str(", tP_DA := ");
field_tP__DA.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_VP := ");
field_tP__VP.log();
TTCN_Logger::log_event_str(", tP_UDL_UD := ");
field_tP__UDL__UD.log();
TTCN_Logger::log_event_str(" }");
}

void SMS__SUBMIT::set_implicit_omit()
{
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__RD().is_bound()) tP__RD().set_implicit_omit();
if (tP__VPF().is_bound()) tP__VPF().set_implicit_omit();
if (tP__SRR().is_bound()) tP__SRR().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__MR().is_bound()) tP__MR().set_implicit_omit();
if (tP__DA().is_bound()) tP__DA().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__VP().is_bound()) tP__VP() = OMIT_VALUE;
else tP__VP().set_implicit_omit();
if (tP__UDL__UD().is_bound()) tP__UDL__UD().set_implicit_omit();
}

void SMS__SUBMIT::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_SUBMIT 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__RD().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__VPF().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__SRR().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__RP().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__MR().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__DA().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__VP().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_RD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_VPF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__VPF().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_SRR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_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_DA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_VP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__VP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_SUBMIT");
  }
}

void SMS__SUBMIT::encode_text(Text_Buf& text_buf) const
{
field_tP__MTI.encode_text(text_buf);
field_tP__RD.encode_text(text_buf);
field_tP__VPF.encode_text(text_buf);
field_tP__SRR.encode_text(text_buf);
field_tP__UDHI.encode_text(text_buf);
field_tP__RP.encode_text(text_buf);
field_tP__MR.encode_text(text_buf);
field_tP__DA.encode_text(text_buf);
field_tP__PID.encode_text(text_buf);
field_tP__DCS.encode_text(text_buf);
field_tP__VP.encode_text(text_buf);
field_tP__UDL__UD.encode_text(text_buf);
}

void SMS__SUBMIT::decode_text(Text_Buf& text_buf)
{
field_tP__MTI.decode_text(text_buf);
field_tP__RD.decode_text(text_buf);
field_tP__VPF.decode_text(text_buf);
field_tP__SRR.decode_text(text_buf);
field_tP__UDHI.decode_text(text_buf);
field_tP__RP.decode_text(text_buf);
field_tP__MR.decode_text(text_buf);
field_tP__DA.decode_text(text_buf);
field_tP__PID.decode_text(text_buf);
field_tP__DCS.decode_text(text_buf);
field_tP__VP.decode_text(text_buf);
field_tP__UDL__UD.decode_text(text_buf);
}

void SMS__SUBMIT::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::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::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  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__RD.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_tP__VPF.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__SRR.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__UDHI.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__RP.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::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_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__DA_descr_.raw->forceomit);
  decoded_field_length = field_tP__DA.RAW_decode(TP__DA_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());
  if (field_tP__VPF ==  bs_1) selected_field = 0;
  else if (field_tP__VPF ==  bs_0) selected_field = 1;
  else if (field_tP__VPF ==  bs_2) selected_field = 2;
  else selected_field = -1;
  if (limit > 0 && (field_tP__VPF ==  bs_1 || field_tP__VPF ==  bs_0 || field_tP__VPF ==  bs_2)&& selected_field!=-1){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_tP__VP = 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_tP__VP_descr_.raw->forceomit);
  decoded_field_length = field_tP__VP().RAW_decode(SMS__SUBMIT_tP__VP_descr_, p_buf, limit, local_top_order, TRUE, selected_field, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_tP__VP = 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__VP=OMIT_VALUE;
  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_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::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::BIT2_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::OCT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, TP__DA_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);
  if (field_tP__VP.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, SMS__SUBMIT_tP__VP_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  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__RD.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__VPF.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tP__SRR.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__UDHI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_tP__RP.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tP__MR.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_tP__DA.RAW_encode(TP__DA_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]);
  if (field_tP__VP.ispresent()) {
  encoded_length += field_tP__VP().RAW_encode(SMS__SUBMIT_tP__VP_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__VP.ispresent() && (field_tP__VPF !=  bs_1 && field_tP__VPF !=  bs_0 && field_tP__VPF !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT2_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+1;
  int new_pos1[]={2};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT2_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+1;
  int new_pos2[]={2};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   bs_2.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_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_tP__VP.ispresent()) {
  switch (field_tP__VP().get_selection()) {
  case TP__VP::ALT_tP__VP__relative__format:
  if (field_tP__VPF !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(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_pos.pos);
  }
  break;
  case TP__VP::ALT_tP__VP__enhanced__format:
  if (field_tP__VPF !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(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_pos.pos);
  }
  break;
  case TP__VP::ALT_tP__VP__absolute__format:
  if (field_tP__VPF !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.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_pos.pos);
  }
  break;
  default:;
  }
  }
  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_template::single_value_struct {
BITSTRING_template field_tP__MTI;
BITSTRING_template field_tP__RD;
BITSTRING_template field_tP__VPF;
BITSTRING_template field_tP__SRR;
BITSTRING_template field_tP__UDHI;
BITSTRING_template field_tP__RP;
OCTETSTRING_template field_tP__MR;
TP__DA_template field_tP__DA;
OCTETSTRING_template field_tP__PID;
OCTETSTRING_template field_tP__DCS;
TP__VP_template field_tP__VP;
TP__UDL__UD_template field_tP__UDL__UD;
};

void SMS__SUBMIT_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__RD = ANY_VALUE;
single_value->field_tP__VPF = ANY_VALUE;
single_value->field_tP__SRR = ANY_VALUE;
single_value->field_tP__UDHI = ANY_VALUE;
single_value->field_tP__RP = ANY_VALUE;
single_value->field_tP__MR = ANY_VALUE;
single_value->field_tP__DA = ANY_VALUE;
single_value->field_tP__PID = ANY_VALUE;
single_value->field_tP__DCS = ANY_VALUE;
single_value->field_tP__VP = ANY_OR_OMIT;
single_value->field_tP__UDL__UD = ANY_VALUE;
}
}
}

void SMS__SUBMIT_template::copy_value(const SMS__SUBMIT& 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__RD().is_bound()) {
  single_value->field_tP__RD = other_value.tP__RD();
} else {
  single_value->field_tP__RD.clean_up();
}
if (other_value.tP__VPF().is_bound()) {
  single_value->field_tP__VPF = other_value.tP__VPF();
} else {
  single_value->field_tP__VPF.clean_up();
}
if (other_value.tP__SRR().is_bound()) {
  single_value->field_tP__SRR = other_value.tP__SRR();
} else {
  single_value->field_tP__SRR.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__MR().is_bound()) {
  single_value->field_tP__MR = other_value.tP__MR();
} else {
  single_value->field_tP__MR.clean_up();
}
if (other_value.tP__DA().is_bound()) {
  single_value->field_tP__DA = other_value.tP__DA();
} else {
  single_value->field_tP__DA.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__VP().is_bound()) {
  if (other_value.tP__VP().ispresent()) single_value->field_tP__VP = other_value.tP__VP()();
  else single_value->field_tP__VP = OMIT_VALUE;
} else {
  single_value->field_tP__VP.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__SUBMIT_template::copy_template(const SMS__SUBMIT_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__RD().get_selection()) {
single_value->field_tP__RD = other_value.tP__RD();
} else {
single_value->field_tP__RD.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__VPF().get_selection()) {
single_value->field_tP__VPF = other_value.tP__VPF();
} else {
single_value->field_tP__VPF.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__SRR().get_selection()) {
single_value->field_tP__SRR = other_value.tP__SRR();
} else {
single_value->field_tP__SRR.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__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__DA().get_selection()) {
single_value->field_tP__DA = other_value.tP__DA();
} else {
single_value->field_tP__DA.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__VP().get_selection()) {
single_value->field_tP__VP = other_value.tP__VP();
} else {
single_value->field_tP__VP.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_template[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_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__SUBMIT_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.");
break;
}
set_selection(other_value);
}

SMS__SUBMIT_template::SMS__SUBMIT_template()
{
}

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

SMS__SUBMIT_template::SMS__SUBMIT_template(const SMS__SUBMIT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMS__SUBMIT_template::match(const SMS__SUBMIT& 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__RD().is_bound()) return FALSE;
if(!single_value->field_tP__RD.match(other_value.tP__RD(), legacy))return FALSE;
if(!other_value.tP__VPF().is_bound()) return FALSE;
if(!single_value->field_tP__VPF.match(other_value.tP__VPF(), legacy))return FALSE;
if(!other_value.tP__SRR().is_bound()) return FALSE;
if(!single_value->field_tP__SRR.match(other_value.tP__SRR(), 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__MR().is_bound()) return FALSE;
if(!single_value->field_tP__MR.match(other_value.tP__MR(), legacy))return FALSE;
if(!other_value.tP__DA().is_bound()) return FALSE;
if(!single_value->field_tP__DA.match(other_value.tP__DA(), 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__VP().is_bound()) return FALSE;
if((other_value.tP__VP().ispresent() ? !single_value->field_tP__VP.match((const TP__VP&)other_value.tP__VP(), legacy) : !single_value->field_tP__VP.match_omit(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_SUBMIT.");
}
return FALSE;
}

boolean SMS__SUBMIT_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__RD.is_bound()
 || single_value->field_tP__VPF.is_bound()
 || single_value->field_tP__SRR.is_bound()
 || single_value->field_tP__UDHI.is_bound()
 || single_value->field_tP__RP.is_bound()
 || single_value->field_tP__MR.is_bound()
 || single_value->field_tP__DA.is_bound()
 || single_value->field_tP__PID.is_bound()
 || single_value->field_tP__DCS.is_bound()
 || (single_value->field_tP__VP.is_omit() || single_value->field_tP__VP.is_bound())
 || single_value->field_tP__UDL__UD.is_bound();
}

boolean SMS__SUBMIT_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__RD.is_value()
 && single_value->field_tP__VPF.is_value()
 && single_value->field_tP__SRR.is_value()
 && single_value->field_tP__UDHI.is_value()
 && single_value->field_tP__RP.is_value()
 && single_value->field_tP__MR.is_value()
 && single_value->field_tP__DA.is_value()
 && single_value->field_tP__PID.is_value()
 && single_value->field_tP__DCS.is_value()
 && (single_value->field_tP__VP.is_omit() || single_value->field_tP__VP.is_value())
 && single_value->field_tP__UDL__UD.is_value();
}

void SMS__SUBMIT_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 SMS__SUBMIT_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.");
SMS__SUBMIT 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__RD.is_bound()) {
ret_val.tP__RD() = single_value->field_tP__RD.valueof();
}
if (single_value->field_tP__VPF.is_bound()) {
ret_val.tP__VPF() = single_value->field_tP__VPF.valueof();
}
if (single_value->field_tP__SRR.is_bound()) {
ret_val.tP__SRR() = single_value->field_tP__SRR.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__MR.is_bound()) {
ret_val.tP__MR() = single_value->field_tP__MR.valueof();
}
if (single_value->field_tP__DA.is_bound()) {
ret_val.tP__DA() = single_value->field_tP__DA.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__VP.is_omit()) ret_val.tP__VP() = OMIT_VALUE;
else if (single_value->field_tP__VP.is_bound()) {
ret_val.tP__VP() = single_value->field_tP__VP.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__SUBMIT_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.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SMS__SUBMIT_template[list_length];
}

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

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

const BITSTRING_template& SMS__SUBMIT_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.");
return single_value->field_tP__MTI;
}

BITSTRING_template& SMS__SUBMIT_template::tP__RD()
{
set_specific();
return single_value->field_tP__RD;
}

const BITSTRING_template& SMS__SUBMIT_template::tP__RD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_RD of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT.");
return single_value->field_tP__RD;
}

BITSTRING_template& SMS__SUBMIT_template::tP__VPF()
{
set_specific();
return single_value->field_tP__VPF;
}

const BITSTRING_template& SMS__SUBMIT_template::tP__VPF() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_VPF of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT.");
return single_value->field_tP__VPF;
}

BITSTRING_template& SMS__SUBMIT_template::tP__SRR()
{
set_specific();
return single_value->field_tP__SRR;
}

const BITSTRING_template& SMS__SUBMIT_template::tP__SRR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SRR of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT.");
return single_value->field_tP__SRR;
}

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

const BITSTRING_template& SMS__SUBMIT_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.");
return single_value->field_tP__UDHI;
}

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

const BITSTRING_template& SMS__SUBMIT_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_SUBMIT.");
return single_value->field_tP__RP;
}

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

const OCTETSTRING_template& SMS__SUBMIT_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_SUBMIT.");
return single_value->field_tP__MR;
}

TP__DA_template& SMS__SUBMIT_template::tP__DA()
{
set_specific();
return single_value->field_tP__DA;
}

const TP__DA_template& SMS__SUBMIT_template::tP__DA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DA of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT.");
return single_value->field_tP__DA;
}

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

const OCTETSTRING_template& SMS__SUBMIT_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.");
return single_value->field_tP__PID;
}

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

const OCTETSTRING_template& SMS__SUBMIT_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.");
return single_value->field_tP__DCS;
}

TP__VP_template& SMS__SUBMIT_template::tP__VP()
{
set_specific();
return single_value->field_tP__VP;
}

const TP__VP_template& SMS__SUBMIT_template::tP__VP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_VP of a non-specific template of type @MobileL3_SMS_Types.SMS_SUBMIT.");
return single_value->field_tP__VP;
}

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

const TP__UDL__UD_template& SMS__SUBMIT_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.");
return single_value->field_tP__UDL__UD;
}

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

void SMS__SUBMIT_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_RD := ");
single_value->field_tP__RD.log();
TTCN_Logger::log_event_str(", tP_VPF := ");
single_value->field_tP__VPF.log();
TTCN_Logger::log_event_str(", tP_SRR := ");
single_value->field_tP__SRR.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_MR := ");
single_value->field_tP__MR.log();
TTCN_Logger::log_event_str(", tP_DA := ");
single_value->field_tP__DA.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_VP := ");
single_value->field_tP__VP.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_template::log_match(const SMS__SUBMIT& 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__RD.match(match_value.tP__RD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_RD");
single_value->field_tP__RD.log_match(match_value.tP__RD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__VPF.match(match_value.tP__VPF(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_VPF");
single_value->field_tP__VPF.log_match(match_value.tP__VPF(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__SRR.match(match_value.tP__SRR(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SRR");
single_value->field_tP__SRR.log_match(match_value.tP__SRR(), 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__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__DA.match(match_value.tP__DA(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DA");
single_value->field_tP__DA.log_match(match_value.tP__DA(), 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 (match_value.tP__VP().ispresent()){
if(!single_value->field_tP__VP.match(match_value.tP__VP(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_VP");
single_value->field_tP__VP.log_match(match_value.tP__VP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tP__VP.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tP_VP := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tP__VP.log();
TTCN_Logger::log_event_str(" unmatched");
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_RD := ");
single_value->field_tP__RD.log_match(match_value.tP__RD(), legacy);
TTCN_Logger::log_event_str(", tP_VPF := ");
single_value->field_tP__VPF.log_match(match_value.tP__VPF(), legacy);
TTCN_Logger::log_event_str(", tP_SRR := ");
single_value->field_tP__SRR.log_match(match_value.tP__SRR(), 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_MR := ");
single_value->field_tP__MR.log_match(match_value.tP__MR(), legacy);
TTCN_Logger::log_event_str(", tP_DA := ");
single_value->field_tP__DA.log_match(match_value.tP__DA(), 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_VP := ");
if (match_value.tP__VP().ispresent()) {
single_value->field_tP__VP.log_match(match_value.tP__VP(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tP__VP.log();
if (single_value->field_tP__VP.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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__SUBMIT_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__MTI().is_bound()) tP__MTI().set_implicit_omit();
if (tP__RD().is_bound()) tP__RD().set_implicit_omit();
if (tP__VPF().is_bound()) tP__VPF().set_implicit_omit();
if (tP__SRR().is_bound()) tP__SRR().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__MR().is_bound()) tP__MR().set_implicit_omit();
if (tP__DA().is_bound()) tP__DA().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__VP().is_bound()) tP__VP() = OMIT_VALUE;
else tP__VP().set_implicit_omit();
if (tP__UDL__UD().is_bound()) tP__UDL__UD().set_implicit_omit();
}

void SMS__SUBMIT_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__RD.encode_text(text_buf);
single_value->field_tP__VPF.encode_text(text_buf);
single_value->field_tP__SRR.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__MR.encode_text(text_buf);
single_value->field_tP__DA.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__VP.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.");
}
}

void SMS__SUBMIT_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__RD.decode_text(text_buf);
single_value->field_tP__VPF.decode_text(text_buf);
single_value->field_tP__SRR.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__MR.decode_text(text_buf);
single_value->field_tP__DA.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__VP.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_template[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.");
}
}

void SMS__SUBMIT_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_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_SUBMIT 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__RD().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tP__VPF().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__SRR().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__RP().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__MR().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__DA().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__VP().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_RD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__RD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_VPF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__VPF().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_SRR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_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_DA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_VP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__VP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__SUBMIT_template* precondition = new SMS__SUBMIT_template;
    precondition->set_param(*param.get_elem(0));
    SMS__SUBMIT_template* implied_template = new SMS__SUBMIT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__SUBMIT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_SUBMIT");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__SUBMIT_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");
single_value->field_tP__RD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__VPF.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__SRR.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__RP.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__MR.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__DA.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__VP.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
single_value->field_tP__UDL__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_SUBMIT");
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");
}

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

boolean SMS__SUBMIT_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 TP__VP::copy_value(const TP__VP& other_value)
{
switch (other_value.union_selection) {
case ALT_tP__VP__relative__format:
field_tP__VP__relative__format = new OCTETSTRING(*other_value.field_tP__VP__relative__format);
break;
case ALT_tP__VP__enhanced__format:
field_tP__VP__enhanced__format = new OCTETSTRING(*other_value.field_tP__VP__enhanced__format);
break;
case ALT_tP__VP__absolute__format:
field_tP__VP__absolute__format = new OCTETSTRING(*other_value.field_tP__VP__absolute__format);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.TP_VP.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TP__VP::operator==(const TP__VP& 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.TP_VP.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_SMS_Types.TP_VP.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_tP__VP__relative__format:
return *field_tP__VP__relative__format == *other_value.field_tP__VP__relative__format;
case ALT_tP__VP__enhanced__format:
return *field_tP__VP__enhanced__format == *other_value.field_tP__VP__enhanced__format;
case ALT_tP__VP__absolute__format:
return *field_tP__VP__absolute__format == *other_value.field_tP__VP__absolute__format;
default:
return FALSE;
}
}

OCTETSTRING& TP__VP::tP__VP__relative__format()
{
if (union_selection != ALT_tP__VP__relative__format) {
clean_up();
field_tP__VP__relative__format = new OCTETSTRING;
union_selection = ALT_tP__VP__relative__format;
}
return *field_tP__VP__relative__format;
}

const OCTETSTRING& TP__VP::tP__VP__relative__format() const
{
if (union_selection != ALT_tP__VP__relative__format) TTCN_error("Using non-selected field tP_VP_relative_format in a value of union type @MobileL3_SMS_Types.TP_VP.");
return *field_tP__VP__relative__format;
}

OCTETSTRING& TP__VP::tP__VP__enhanced__format()
{
if (union_selection != ALT_tP__VP__enhanced__format) {
clean_up();
field_tP__VP__enhanced__format = new OCTETSTRING;
union_selection = ALT_tP__VP__enhanced__format;
}
return *field_tP__VP__enhanced__format;
}

const OCTETSTRING& TP__VP::tP__VP__enhanced__format() const
{
if (union_selection != ALT_tP__VP__enhanced__format) TTCN_error("Using non-selected field tP_VP_enhanced_format in a value of union type @MobileL3_SMS_Types.TP_VP.");
return *field_tP__VP__enhanced__format;
}

OCTETSTRING& TP__VP::tP__VP__absolute__format()
{
if (union_selection != ALT_tP__VP__absolute__format) {
clean_up();
field_tP__VP__absolute__format = new OCTETSTRING;
union_selection = ALT_tP__VP__absolute__format;
}
return *field_tP__VP__absolute__format;
}

const OCTETSTRING& TP__VP::tP__VP__absolute__format() const
{
if (union_selection != ALT_tP__VP__absolute__format) TTCN_error("Using non-selected field tP_VP_absolute_format in a value of union type @MobileL3_SMS_Types.TP_VP.");
return *field_tP__VP__absolute__format;
}

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

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

boolean TP__VP::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_tP__VP__relative__format: return field_tP__VP__relative__format->is_value();
case ALT_tP__VP__enhanced__format: return field_tP__VP__enhanced__format->is_value();
case ALT_tP__VP__absolute__format: return field_tP__VP__absolute__format->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TP__VP::clean_up()
{
switch (union_selection) {
case ALT_tP__VP__relative__format:
  delete field_tP__VP__relative__format;
  break;
case ALT_tP__VP__enhanced__format:
  delete field_tP__VP__enhanced__format;
  break;
case ALT_tP__VP__absolute__format:
  delete field_tP__VP__absolute__format;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TP__VP::log() const
{
switch (union_selection) {
case ALT_tP__VP__relative__format:
TTCN_Logger::log_event_str("{ tP_VP_relative_format := ");
field_tP__VP__relative__format->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_tP__VP__enhanced__format:
TTCN_Logger::log_event_str("{ tP_VP_enhanced_format := ");
field_tP__VP__enhanced__format->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_tP__VP__absolute__format:
TTCN_Logger::log_event_str("{ tP_VP_absolute_format := ");
field_tP__VP__absolute__format->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TP__VP::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, "tP_VP_relative_format")) {
    tP__VP__relative__format().set_param(*mp_last);
    if (!tP__VP__relative__format().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "tP_VP_enhanced_format")) {
    tP__VP__enhanced__format().set_param(*mp_last);
    if (!tP__VP__enhanced__format().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "tP_VP_absolute_format")) {
    tP__VP__absolute__format().set_param(*mp_last);
    if (!tP__VP__absolute__format().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TP_VP.", last_name);
}

void TP__VP::set_implicit_omit()
{
switch (union_selection) {
case ALT_tP__VP__relative__format:
field_tP__VP__relative__format->set_implicit_omit(); break;
case ALT_tP__VP__enhanced__format:
field_tP__VP__enhanced__format->set_implicit_omit(); break;
case ALT_tP__VP__absolute__format:
field_tP__VP__absolute__format->set_implicit_omit(); break;
default: break;
}
}

void TP__VP::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_tP__VP__relative__format:
field_tP__VP__relative__format->encode_text(text_buf);
break;
case ALT_tP__VP__enhanced__format:
field_tP__VP__enhanced__format->encode_text(text_buf);
break;
case ALT_tP__VP__absolute__format:
field_tP__VP__absolute__format->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.TP_VP.");
}
}

void TP__VP::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_tP__VP__relative__format:
tP__VP__relative__format().decode_text(text_buf);
break;
case ALT_tP__VP__enhanced__format:
tP__VP__enhanced__format().decode_text(text_buf);
break;
case ALT_tP__VP__absolute__format:
tP__VP__absolute__format().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.TP_VP.");
}
}

void TP__VP::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 TP__VP::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__VP::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = tP__VP__relative__format().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, General__Types::OCT7_descr_.raw->forceomit);
      decoded_length = tP__VP__enhanced__format().RAW_decode(General__Types::OCT7_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, General__Types::OCT7_descr_.raw->forceomit);
      decoded_length = tP__VP__absolute__format().RAW_decode(General__Types::OCT7_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
      decoded_length = tP__VP__relative__format().RAW_decode(General__Types::OCT1_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT7_descr_.raw->forceomit);
      decoded_length = tP__VP__enhanced__format().RAW_decode(General__Types::OCT7_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT7_descr_.raw->forceomit);
      decoded_length = tP__VP__absolute__format().RAW_decode(General__Types::OCT7_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int TP__VP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_tP__VP__relative__format:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, General__Types::OCT1_descr_.raw);
    encoded_length = field_tP__VP__relative__format->RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &General__Types::OCT1_descr_;
    break;
  case ALT_tP__VP__enhanced__format:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, General__Types::OCT7_descr_.raw);
    encoded_length = field_tP__VP__enhanced__format->RAW_encode(General__Types::OCT7_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &General__Types::OCT7_descr_;
    break;
  case ALT_tP__VP__absolute__format:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, General__Types::OCT7_descr_.raw);
    encoded_length = field_tP__VP__absolute__format->RAW_encode(General__Types::OCT7_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &General__Types::OCT7_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TP__VP_template::copy_value(const TP__VP& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TP__VP::ALT_tP__VP__relative__format:
single_value.field_tP__VP__relative__format = new OCTETSTRING_template(other_value.tP__VP__relative__format());
break;
case TP__VP::ALT_tP__VP__enhanced__format:
single_value.field_tP__VP__enhanced__format = new OCTETSTRING_template(other_value.tP__VP__enhanced__format());
break;
case TP__VP::ALT_tP__VP__absolute__format:
single_value.field_tP__VP__absolute__format = new OCTETSTRING_template(other_value.tP__VP__absolute__format());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.TP_VP.");
}
set_selection(SPECIFIC_VALUE);
}

void TP__VP_template::copy_template(const TP__VP_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 TP__VP::ALT_tP__VP__relative__format:
single_value.field_tP__VP__relative__format = new OCTETSTRING_template(*other_value.single_value.field_tP__VP__relative__format);
break;
case TP__VP::ALT_tP__VP__enhanced__format:
single_value.field_tP__VP__enhanced__format = new OCTETSTRING_template(*other_value.single_value.field_tP__VP__enhanced__format);
break;
case TP__VP::ALT_tP__VP__absolute__format:
single_value.field_tP__VP__absolute__format = new OCTETSTRING_template(*other_value.single_value.field_tP__VP__absolute__format);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_SMS_Types.TP_VP.");
}
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__VP_template[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__VP_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__VP_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.TP_VP.");
}
set_selection(other_value);
}

TP__VP_template::TP__VP_template()
{
}

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

TP__VP_template::TP__VP_template(const TP__VP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void TP__VP_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TP__VP::ALT_tP__VP__relative__format:
delete single_value.field_tP__VP__relative__format;
break;
case TP__VP::ALT_tP__VP__enhanced__format:
delete single_value.field_tP__VP__enhanced__format;
break;
case TP__VP::ALT_tP__VP__absolute__format:
delete single_value.field_tP__VP__absolute__format;
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;
}

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

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

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

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

boolean TP__VP_template::match(const TP__VP& 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:
{
TP__VP::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TP__VP::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TP__VP::ALT_tP__VP__relative__format:
return single_value.field_tP__VP__relative__format->match(other_value.tP__VP__relative__format(), legacy);
case TP__VP::ALT_tP__VP__enhanced__format:
return single_value.field_tP__VP__enhanced__format->match(other_value.tP__VP__enhanced__format(), legacy);
case TP__VP::ALT_tP__VP__absolute__format:
return single_value.field_tP__VP__absolute__format->match(other_value.tP__VP__absolute__format(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_SMS_Types.TP_VP.");
}
}
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.TP_VP.");
}
return FALSE;
}

boolean TP__VP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TP__VP::ALT_tP__VP__relative__format:
return single_value.field_tP__VP__relative__format->is_value();
case TP__VP::ALT_tP__VP__enhanced__format:
return single_value.field_tP__VP__enhanced__format->is_value();
case TP__VP::ALT_tP__VP__absolute__format:
return single_value.field_tP__VP__absolute__format->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.TP_VP.");
}
}

TP__VP TP__VP_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.TP_VP.");
TP__VP ret_val;
switch (single_value.union_selection) {
case TP__VP::ALT_tP__VP__relative__format:
ret_val.tP__VP__relative__format() = single_value.field_tP__VP__relative__format->valueof();
break;
case TP__VP::ALT_tP__VP__enhanced__format:
ret_val.tP__VP__enhanced__format() = single_value.field_tP__VP__enhanced__format->valueof();
break;
case TP__VP::ALT_tP__VP__absolute__format:
ret_val.tP__VP__absolute__format() = single_value.field_tP__VP__absolute__format->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.TP_VP.");
}
return ret_val;
}

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

OCTETSTRING_template& TP__VP_template::tP__VP__relative__format()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TP__VP::ALT_tP__VP__relative__format) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tP__VP__relative__format = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_tP__VP__relative__format = new OCTETSTRING_template;
single_value.union_selection = TP__VP::ALT_tP__VP__relative__format;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_tP__VP__relative__format;
}

const OCTETSTRING_template& TP__VP_template::tP__VP__relative__format() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tP_VP_relative_format in a non-specific template of union type @MobileL3_SMS_Types.TP_VP.");
if (single_value.union_selection != TP__VP::ALT_tP__VP__relative__format) TTCN_error("Accessing non-selected field tP_VP_relative_format in a template of union type @MobileL3_SMS_Types.TP_VP.");
return *single_value.field_tP__VP__relative__format;
}

OCTETSTRING_template& TP__VP_template::tP__VP__enhanced__format()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TP__VP::ALT_tP__VP__enhanced__format) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tP__VP__enhanced__format = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_tP__VP__enhanced__format = new OCTETSTRING_template;
single_value.union_selection = TP__VP::ALT_tP__VP__enhanced__format;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_tP__VP__enhanced__format;
}

const OCTETSTRING_template& TP__VP_template::tP__VP__enhanced__format() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tP_VP_enhanced_format in a non-specific template of union type @MobileL3_SMS_Types.TP_VP.");
if (single_value.union_selection != TP__VP::ALT_tP__VP__enhanced__format) TTCN_error("Accessing non-selected field tP_VP_enhanced_format in a template of union type @MobileL3_SMS_Types.TP_VP.");
return *single_value.field_tP__VP__enhanced__format;
}

OCTETSTRING_template& TP__VP_template::tP__VP__absolute__format()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TP__VP::ALT_tP__VP__absolute__format) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tP__VP__absolute__format = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_tP__VP__absolute__format = new OCTETSTRING_template;
single_value.union_selection = TP__VP::ALT_tP__VP__absolute__format;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_tP__VP__absolute__format;
}

const OCTETSTRING_template& TP__VP_template::tP__VP__absolute__format() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tP_VP_absolute_format in a non-specific template of union type @MobileL3_SMS_Types.TP_VP.");
if (single_value.union_selection != TP__VP::ALT_tP__VP__absolute__format) TTCN_error("Accessing non-selected field tP_VP_absolute_format in a template of union type @MobileL3_SMS_Types.TP_VP.");
return *single_value.field_tP__VP__absolute__format;
}

boolean TP__VP_template::ischosen(TP__VP::union_selection_type checked_selection) const
{
if (checked_selection == TP__VP::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.TP_VP.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TP__VP::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.TP_VP.");
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.TP_VP 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 TP__VP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TP__VP::ALT_tP__VP__relative__format:
TTCN_Logger::log_event_str("{ tP_VP_relative_format := ");
single_value.field_tP__VP__relative__format->log();
TTCN_Logger::log_event_str(" }");
break;
case TP__VP::ALT_tP__VP__enhanced__format:
TTCN_Logger::log_event_str("{ tP_VP_enhanced_format := ");
single_value.field_tP__VP__enhanced__format->log();
TTCN_Logger::log_event_str(" }");
break;
case TP__VP::ALT_tP__VP__absolute__format:
TTCN_Logger::log_event_str("{ tP_VP_absolute_format := ");
single_value.field_tP__VP__absolute__format->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 TP__VP_template::log_match(const TP__VP& 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 TP__VP::ALT_tP__VP__relative__format:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".tP_VP_relative_format");
single_value.field_tP__VP__relative__format->log_match(match_value.tP__VP__relative__format(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ tP_VP_relative_format := ");
single_value.field_tP__VP__relative__format->log_match(match_value.tP__VP__relative__format(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TP__VP::ALT_tP__VP__enhanced__format:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".tP_VP_enhanced_format");
single_value.field_tP__VP__enhanced__format->log_match(match_value.tP__VP__enhanced__format(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ tP_VP_enhanced_format := ");
single_value.field_tP__VP__enhanced__format->log_match(match_value.tP__VP__enhanced__format(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TP__VP::ALT_tP__VP__absolute__format:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".tP_VP_absolute_format");
single_value.field_tP__VP__absolute__format->log_match(match_value.tP__VP__absolute__format(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ tP_VP_absolute_format := ");
single_value.field_tP__VP__absolute__format->log_match(match_value.tP__VP__absolute__format(), 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 TP__VP_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TP__VP::ALT_tP__VP__relative__format:
single_value.field_tP__VP__relative__format->set_implicit_omit(); break;
case TP__VP::ALT_tP__VP__enhanced__format:
single_value.field_tP__VP__enhanced__format->set_implicit_omit(); break;
case TP__VP::ALT_tP__VP__absolute__format:
single_value.field_tP__VP__absolute__format->set_implicit_omit(); break;
default: break;
}
}

void TP__VP_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 TP__VP::ALT_tP__VP__relative__format:
single_value.field_tP__VP__relative__format->encode_text(text_buf);
break;
case TP__VP::ALT_tP__VP__enhanced__format:
single_value.field_tP__VP__enhanced__format->encode_text(text_buf);
break;
case TP__VP::ALT_tP__VP__absolute__format:
single_value.field_tP__VP__absolute__format->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.TP_VP.");
}
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.TP_VP.");
}
}

void TP__VP_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TP__VP::UNBOUND_VALUE;
TP__VP::union_selection_type new_selection = (TP__VP::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TP__VP::ALT_tP__VP__relative__format:
single_value.field_tP__VP__relative__format = new OCTETSTRING_template;
single_value.field_tP__VP__relative__format->decode_text(text_buf);
break;
case TP__VP::ALT_tP__VP__enhanced__format:
single_value.field_tP__VP__enhanced__format = new OCTETSTRING_template;
single_value.field_tP__VP__enhanced__format->decode_text(text_buf);
break;
case TP__VP::ALT_tP__VP__absolute__format:
single_value.field_tP__VP__absolute__format = new OCTETSTRING_template;
single_value.field_tP__VP__absolute__format->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_SMS_Types.TP_VP.");
}
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 TP__VP_template[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.TP_VP.");
}
}

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

boolean TP__VP_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 TP__VP_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.TP_VP'");
    }
    if (strcmp("tP_VP_relative_format", param_field) == 0) {
      tP__VP__relative__format().set_param(param);
      return;
    } else if (strcmp("tP_VP_enhanced_format", param_field) == 0) {
      tP__VP__enhanced__format().set_param(param);
      return;
    } else if (strcmp("tP_VP_absolute_format", param_field) == 0) {
      tP__VP__absolute__format().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.TP_VP'", 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: {
    TP__VP_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.TP_VP");
    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, "tP_VP_relative_format")) {
      tP__VP__relative__format().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "tP_VP_enhanced_format")) {
      tP__VP__enhanced__format().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "tP_VP_absolute_format")) {
      tP__VP__absolute__format().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TP_VP.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TP__VP_template* precondition = new TP__VP_template;
    precondition->set_param(*m_p->get_elem(0));
    TP__VP_template* implied_template = new TP__VP_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TP__VP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.TP_VP");
  }
  is_ifpresent = param.get_ifpresent();
}

void TP__VP_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 TP__VP::ALT_tP__VP__relative__format:
single_value.field_tP__VP__relative__format->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_VP");
return;
case TP__VP::ALT_tP__VP__enhanced__format:
single_value.field_tP__VP__enhanced__format->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_VP");
return;
case TP__VP::ALT_tP__VP__absolute__format:
single_value.field_tP__VP__absolute__format->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_VP");
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.TP_VP.");
}
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_VP");
}

TP__CDL__CD::TP__CDL__CD()
{
}

TP__CDL__CD::TP__CDL__CD(const INTEGER& par_tP__CDL,
    const OCTETSTRING& par_tP__CD)
  :   field_tP__CDL(par_tP__CDL),
  field_tP__CD(par_tP__CD)
{
}

TP__CDL__CD::TP__CDL__CD(const TP__CDL__CD& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.TP_CDL_CD.");
if (other_value.tP__CDL().is_bound()) field_tP__CDL = other_value.tP__CDL();
else field_tP__CDL.clean_up();
if (other_value.tP__CD().is_bound()) field_tP__CD = other_value.tP__CD();
else field_tP__CD.clean_up();
}

void TP__CDL__CD::clean_up()
{
field_tP__CDL.clean_up();
field_tP__CD.clean_up();
}

const TTCN_Typedescriptor_t* TP__CDL__CD::get_descriptor() const { return &TP__CDL__CD_descr_; }
TP__CDL__CD& TP__CDL__CD::operator=(const TP__CDL__CD& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.TP_CDL_CD.");
  if (other_value.tP__CDL().is_bound()) field_tP__CDL = other_value.tP__CDL();
  else field_tP__CDL.clean_up();
  if (other_value.tP__CD().is_bound()) field_tP__CD = other_value.tP__CD();
  else field_tP__CD.clean_up();
}
return *this;
}

boolean TP__CDL__CD::operator==(const TP__CDL__CD& other_value) const
{
return field_tP__CDL==other_value.field_tP__CDL
  && field_tP__CD==other_value.field_tP__CD;
}

boolean TP__CDL__CD::is_bound() const
{
return (field_tP__CDL.is_bound())
  || (field_tP__CD.is_bound());
}
boolean TP__CDL__CD::is_value() const
{
return field_tP__CDL.is_value()
  && field_tP__CD.is_value();
}
void TP__CDL__CD::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tP_CDL := ");
field_tP__CDL.log();
TTCN_Logger::log_event_str(", tP_CD := ");
field_tP__CD.log();
TTCN_Logger::log_event_str(" }");
}

void TP__CDL__CD::set_implicit_omit()
{
if (tP__CDL().is_bound()) tP__CDL().set_implicit_omit();
if (tP__CD().is_bound()) tP__CD().set_implicit_omit();
}

void TP__CDL__CD::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.TP_CDL_CD 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) tP__CDL().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__CD().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(), "tP_CDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_CD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CDL_CD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.TP_CDL_CD");
  }
}

void TP__CDL__CD::encode_text(Text_Buf& text_buf) const
{
field_tP__CDL.encode_text(text_buf);
field_tP__CD.encode_text(text_buf);
}

void TP__CDL__CD::decode_text(Text_Buf& text_buf)
{
field_tP__CDL.decode_text(text_buf);
field_tP__CD.decode_text(text_buf);
}

void TP__CDL__CD::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__CDL__CD::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__CDL__CD::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__CDL__CD_tP__CDL_descr_.raw->forceomit);
  decoded_field_length = field_tP__CDL.RAW_decode(TP__CDL__CD_tP__CDL_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__CDL.convert_to_Integer(TP__CDL__CD_tP__CDL_descr_);
  field_tP__CDL = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_tP__CD.RAW_decode(OCTETSTRING_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 TP__CDL__CD::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, TP__CDL__CD_tP__CDL_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, OCTETSTRING_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &TP__CDL__CD_tP__CDL_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_tP__CD.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct TP__CDL__CD_template::single_value_struct {
INTEGER_template field_tP__CDL;
OCTETSTRING_template field_tP__CD;
};

void TP__CDL__CD_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__CDL = ANY_VALUE;
single_value->field_tP__CD = ANY_VALUE;
}
}
}

void TP__CDL__CD_template::copy_value(const TP__CDL__CD& other_value)
{
single_value = new single_value_struct;
if (other_value.tP__CDL().is_bound()) {
  single_value->field_tP__CDL = other_value.tP__CDL();
} else {
  single_value->field_tP__CDL.clean_up();
}
if (other_value.tP__CD().is_bound()) {
  single_value->field_tP__CD = other_value.tP__CD();
} else {
  single_value->field_tP__CD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TP__CDL__CD_template::copy_template(const TP__CDL__CD_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tP__CDL().get_selection()) {
single_value->field_tP__CDL = other_value.tP__CDL();
} else {
single_value->field_tP__CDL.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__CD().get_selection()) {
single_value->field_tP__CD = other_value.tP__CD();
} else {
single_value->field_tP__CD.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__CDL__CD_template[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__CDL__CD_template(*other_value.implication_.precondition);
implication_.implied_template = new TP__CDL__CD_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_CDL_CD.");
break;
}
set_selection(other_value);
}

TP__CDL__CD_template::TP__CDL__CD_template()
{
}

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

TP__CDL__CD_template::TP__CDL__CD_template(const TP__CDL__CD& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TP__CDL__CD_template::match(const TP__CDL__CD& 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__CDL().is_bound()) return FALSE;
if(!single_value->field_tP__CDL.match(other_value.tP__CDL(), legacy))return FALSE;
if(!other_value.tP__CD().is_bound()) return FALSE;
if(!single_value->field_tP__CD.match(other_value.tP__CD(), 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_CDL_CD.");
}
return FALSE;
}

boolean TP__CDL__CD_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__CDL.is_bound()
 || single_value->field_tP__CD.is_bound();
}

boolean TP__CDL__CD_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tP__CDL.is_value()
 && single_value->field_tP__CD.is_value();
}

void TP__CDL__CD_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__CDL__CD TP__CDL__CD_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_CDL_CD.");
TP__CDL__CD ret_val;
if (single_value->field_tP__CDL.is_bound()) {
ret_val.tP__CDL() = single_value->field_tP__CDL.valueof();
}
if (single_value->field_tP__CD.is_bound()) {
ret_val.tP__CD() = single_value->field_tP__CD.valueof();
}
return ret_val;
}

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

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

INTEGER_template& TP__CDL__CD_template::tP__CDL()
{
set_specific();
return single_value->field_tP__CDL;
}

const INTEGER_template& TP__CDL__CD_template::tP__CDL() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_CDL of a non-specific template of type @MobileL3_SMS_Types.TP_CDL_CD.");
return single_value->field_tP__CDL;
}

OCTETSTRING_template& TP__CDL__CD_template::tP__CD()
{
set_specific();
return single_value->field_tP__CD;
}

const OCTETSTRING_template& TP__CDL__CD_template::tP__CD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_CD of a non-specific template of type @MobileL3_SMS_Types.TP_CDL_CD.");
return single_value->field_tP__CD;
}

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

void TP__CDL__CD_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tP_CDL := ");
single_value->field_tP__CDL.log();
TTCN_Logger::log_event_str(", tP_CD := ");
single_value->field_tP__CD.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__CDL__CD_template::log_match(const TP__CDL__CD& 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__CDL.match(match_value.tP__CDL(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_CDL");
single_value->field_tP__CDL.log_match(match_value.tP__CDL(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__CD.match(match_value.tP__CD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_CD");
single_value->field_tP__CD.log_match(match_value.tP__CD(), 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_CDL := ");
single_value->field_tP__CDL.log_match(match_value.tP__CDL(), legacy);
TTCN_Logger::log_event_str(", tP_CD := ");
single_value->field_tP__CD.log_match(match_value.tP__CD(), 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__CDL__CD_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tP__CDL().is_bound()) tP__CDL().set_implicit_omit();
if (tP__CD().is_bound()) tP__CD().set_implicit_omit();
}

void TP__CDL__CD_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tP__CDL.encode_text(text_buf);
single_value->field_tP__CD.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_CDL_CD.");
}
}

void TP__CDL__CD_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__CDL.decode_text(text_buf);
single_value->field_tP__CD.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__CDL__CD_template[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_CDL_CD.");
}
}

void TP__CDL__CD_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__CDL__CD_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.TP_CDL_CD 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) tP__CDL().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tP__CD().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(), "tP_CDL")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CDL().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_CD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CDL_CD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TP__CDL__CD_template* precondition = new TP__CDL__CD_template;
    precondition->set_param(*param.get_elem(0));
    TP__CDL__CD_template* implied_template = new TP__CDL__CD_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TP__CDL__CD_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.TP_CDL_CD");
  }
  is_ifpresent = param.get_ifpresent();
}

void TP__CDL__CD_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__CDL.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_CDL_CD");
single_value->field_tP__CD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TP_CDL_CD");
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_CDL_CD");
}

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

boolean TP__CDL__CD_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__COMMAND::SMS__COMMAND()
{
}

SMS__COMMAND::SMS__COMMAND(const BITSTRING& par_tP__MTI,
    const BITSTRING& par_tP__Spare1,
    const BITSTRING& par_tP__SRR,
    const BITSTRING& par_tP__UDHI,
    const BITSTRING& par_tP__Spare2,
    const OCTETSTRING& par_tP__MR,
    const OCTETSTRING& par_tP__PID,
    const OCTETSTRING& par_tP__CT,
    const OCTETSTRING& par_tP__MN,
    const TP__DA& par_tP__DA,
    const TP__CDL__CD& par_tP__CDL__CD)
  :   field_tP__MTI(par_tP__MTI),
  field_tP__Spare1(par_tP__Spare1),
  field_tP__SRR(par_tP__SRR),
  field_tP__UDHI(par_tP__UDHI),
  field_tP__Spare2(par_tP__Spare2),
  field_tP__MR(par_tP__MR),
  field_tP__PID(par_tP__PID),
  field_tP__CT(par_tP__CT),
  field_tP__MN(par_tP__MN),
  field_tP__DA(par_tP__DA),
  field_tP__CDL__CD(par_tP__CDL__CD)
{
}

SMS__COMMAND::SMS__COMMAND(const SMS__COMMAND& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_COMMAND.");
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__SRR().is_bound()) field_tP__SRR = other_value.tP__SRR();
else field_tP__SRR.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__PID().is_bound()) field_tP__PID = other_value.tP__PID();
else field_tP__PID.clean_up();
if (other_value.tP__CT().is_bound()) field_tP__CT = other_value.tP__CT();
else field_tP__CT.clean_up();
if (other_value.tP__MN().is_bound()) field_tP__MN = other_value.tP__MN();
else field_tP__MN.clean_up();
if (other_value.tP__DA().is_bound()) field_tP__DA = other_value.tP__DA();
else field_tP__DA.clean_up();
if (other_value.tP__CDL__CD().is_bound()) field_tP__CDL__CD = other_value.tP__CDL__CD();
else field_tP__CDL__CD.clean_up();
}

void SMS__COMMAND::clean_up()
{
field_tP__MTI.clean_up();
field_tP__Spare1.clean_up();
field_tP__SRR.clean_up();
field_tP__UDHI.clean_up();
field_tP__Spare2.clean_up();
field_tP__MR.clean_up();
field_tP__PID.clean_up();
field_tP__CT.clean_up();
field_tP__MN.clean_up();
field_tP__DA.clean_up();
field_tP__CDL__CD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__COMMAND::get_descriptor() const { return &SMS__COMMAND_descr_; }
SMS__COMMAND& SMS__COMMAND::operator=(const SMS__COMMAND& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.SMS_COMMAND.");
  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__SRR().is_bound()) field_tP__SRR = other_value.tP__SRR();
  else field_tP__SRR.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__PID().is_bound()) field_tP__PID = other_value.tP__PID();
  else field_tP__PID.clean_up();
  if (other_value.tP__CT().is_bound()) field_tP__CT = other_value.tP__CT();
  else field_tP__CT.clean_up();
  if (other_value.tP__MN().is_bound()) field_tP__MN = other_value.tP__MN();
  else field_tP__MN.clean_up();
  if (other_value.tP__DA().is_bound()) field_tP__DA = other_value.tP__DA();
  else field_tP__DA.clean_up();
  if (other_value.tP__CDL__CD().is_bound()) field_tP__CDL__CD = other_value.tP__CDL__CD();
  else field_tP__CDL__CD.clean_up();
}
return *this;
}

boolean SMS__COMMAND::operator==(const SMS__COMMAND& other_value) const
{
return field_tP__MTI==other_value.field_tP__MTI
  && field_tP__Spare1==other_value.field_tP__Spare1
  && field_tP__SRR==other_value.field_tP__SRR
  && 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__PID==other_value.field_tP__PID
  && field_tP__CT==other_value.field_tP__CT
  && field_tP__MN==other_value.field_tP__MN
  && field_tP__DA==other_value.field_tP__DA
  && field_tP__CDL__CD==other_value.field_tP__CDL__CD;
}

boolean SMS__COMMAND::is_bound() const
{
return (field_tP__MTI.is_bound())
  || (field_tP__Spare1.is_bound())
  || (field_tP__SRR.is_bound())
  || (field_tP__UDHI.is_bound())
  || (field_tP__Spare2.is_bound())
  || (field_tP__MR.is_bound())
  || (field_tP__PID.is_bound())
  || (field_tP__CT.is_bound())
  || (field_tP__MN.is_bound())
  || (field_tP__DA.is_bound())
  || (field_tP__CDL__CD.is_bound());
}
boolean SMS__COMMAND::is_value() const
{
return field_tP__MTI.is_value()
  && field_tP__Spare1.is_value()
  && field_tP__SRR.is_value()
  && field_tP__UDHI.is_value()
  && field_tP__Spare2.is_value()
  && field_tP__MR.is_value()
  && field_tP__PID.is_value()
  && field_tP__CT.is_value()
  && field_tP__MN.is_value()
  && field_tP__DA.is_value()
  && field_tP__CDL__CD.is_value();
}
void SMS__COMMAND::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_SRR := ");
field_tP__SRR.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_PID := ");
field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_CT := ");
field_tP__CT.log();
TTCN_Logger::log_event_str(", tP_MN := ");
field_tP__MN.log();
TTCN_Logger::log_event_str(", tP_DA := ");
field_tP__DA.log();
TTCN_Logger::log_event_str(", tP_CDL_CD := ");
field_tP__CDL__CD.log();
TTCN_Logger::log_event_str(" }");
}

void SMS__COMMAND::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__SRR().is_bound()) tP__SRR().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__PID().is_bound()) tP__PID().set_implicit_omit();
if (tP__CT().is_bound()) tP__CT().set_implicit_omit();
if (tP__MN().is_bound()) tP__MN().set_implicit_omit();
if (tP__DA().is_bound()) tP__DA().set_implicit_omit();
if (tP__CDL__CD().is_bound()) tP__CDL__CD().set_implicit_omit();
}

void SMS__COMMAND::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.SMS_COMMAND has 11 fields but 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__SRR().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__MR().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__CT().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__MN().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__DA().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__CDL__CD().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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_SRR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_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_CT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_MN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_DA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_CDL_CD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CDL__CD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_COMMAND: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_COMMAND");
  }
}

void SMS__COMMAND::encode_text(Text_Buf& text_buf) const
{
field_tP__MTI.encode_text(text_buf);
field_tP__Spare1.encode_text(text_buf);
field_tP__SRR.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__PID.encode_text(text_buf);
field_tP__CT.encode_text(text_buf);
field_tP__MN.encode_text(text_buf);
field_tP__DA.encode_text(text_buf);
field_tP__CDL__CD.encode_text(text_buf);
}

void SMS__COMMAND::decode_text(Text_Buf& text_buf)
{
field_tP__MTI.decode_text(text_buf);
field_tP__Spare1.decode_text(text_buf);
field_tP__SRR.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__PID.decode_text(text_buf);
field_tP__CT.decode_text(text_buf);
field_tP__MN.decode_text(text_buf);
field_tP__DA.decode_text(text_buf);
field_tP__CDL__CD.decode_text(text_buf);
}

void SMS__COMMAND::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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__COMMAND::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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__COMMAND::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_tP__Spare1.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__SRR.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__UDHI.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__Spare2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::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_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::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_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__CT.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, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_tP__MN.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__DA_descr_.raw->forceomit);
  decoded_field_length = field_tP__DA.RAW_decode(TP__DA_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, TP__CDL__CD_descr_.raw->forceomit);
  decoded_field_length = field_tP__CDL__CD.RAW_decode(TP__CDL__CD_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 (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__COMMAND::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 11;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(11);
  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::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::OCT1_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, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, TP__DA_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, TP__CDL__CD_descr_.raw);
  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::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tP__SRR.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tP__UDHI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_tP__Spare2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_tP__MR.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tP__PID.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_tP__CT.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_tP__MN.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_tP__DA.RAW_encode(TP__DA_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_tP__CDL__CD.RAW_encode(TP__CDL__CD_descr_, *myleaf.body.node.nodes[10]);
  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__COMMAND_template::single_value_struct {
BITSTRING_template field_tP__MTI;
BITSTRING_template field_tP__Spare1;
BITSTRING_template field_tP__SRR;
BITSTRING_template field_tP__UDHI;
BITSTRING_template field_tP__Spare2;
OCTETSTRING_template field_tP__MR;
OCTETSTRING_template field_tP__PID;
OCTETSTRING_template field_tP__CT;
OCTETSTRING_template field_tP__MN;
TP__DA_template field_tP__DA;
TP__CDL__CD_template field_tP__CDL__CD;
};

void SMS__COMMAND_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_tP__MTI = ANY_VALUE;
single_value->field_tP__Spare1 = ANY_VALUE;
single_value->field_tP__SRR = 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__PID = ANY_VALUE;
single_value->field_tP__CT = ANY_VALUE;
single_value->field_tP__MN = ANY_VALUE;
single_value->field_tP__DA = ANY_VALUE;
single_value->field_tP__CDL__CD = ANY_VALUE;
}
}
}

void SMS__COMMAND_template::copy_value(const SMS__COMMAND& 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__SRR().is_bound()) {
  single_value->field_tP__SRR = other_value.tP__SRR();
} else {
  single_value->field_tP__SRR.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__PID().is_bound()) {
  single_value->field_tP__PID = other_value.tP__PID();
} else {
  single_value->field_tP__PID.clean_up();
}
if (other_value.tP__CT().is_bound()) {
  single_value->field_tP__CT = other_value.tP__CT();
} else {
  single_value->field_tP__CT.clean_up();
}
if (other_value.tP__MN().is_bound()) {
  single_value->field_tP__MN = other_value.tP__MN();
} else {
  single_value->field_tP__MN.clean_up();
}
if (other_value.tP__DA().is_bound()) {
  single_value->field_tP__DA = other_value.tP__DA();
} else {
  single_value->field_tP__DA.clean_up();
}
if (other_value.tP__CDL__CD().is_bound()) {
  single_value->field_tP__CDL__CD = other_value.tP__CDL__CD();
} else {
  single_value->field_tP__CDL__CD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SMS__COMMAND_template::copy_template(const SMS__COMMAND_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__SRR().get_selection()) {
single_value->field_tP__SRR = other_value.tP__SRR();
} else {
single_value->field_tP__SRR.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__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__CT().get_selection()) {
single_value->field_tP__CT = other_value.tP__CT();
} else {
single_value->field_tP__CT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__MN().get_selection()) {
single_value->field_tP__MN = other_value.tP__MN();
} else {
single_value->field_tP__MN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__DA().get_selection()) {
single_value->field_tP__DA = other_value.tP__DA();
} else {
single_value->field_tP__DA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tP__CDL__CD().get_selection()) {
single_value->field_tP__CDL__CD = other_value.tP__CDL__CD();
} else {
single_value->field_tP__CDL__CD.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__COMMAND_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new SMS__COMMAND_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__COMMAND_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_SMS_Types.SMS_COMMAND.");
break;
}
set_selection(other_value);
}

SMS__COMMAND_template::SMS__COMMAND_template()
{
}

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

SMS__COMMAND_template::SMS__COMMAND_template(const SMS__COMMAND& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SMS__COMMAND_template::match(const SMS__COMMAND& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.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__SRR().is_bound()) return FALSE;
if(!single_value->field_tP__SRR.match(other_value.tP__SRR(), 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__PID().is_bound()) return FALSE;
if(!single_value->field_tP__PID.match(other_value.tP__PID(), legacy))return FALSE;
if(!other_value.tP__CT().is_bound()) return FALSE;
if(!single_value->field_tP__CT.match(other_value.tP__CT(), legacy))return FALSE;
if(!other_value.tP__MN().is_bound()) return FALSE;
if(!single_value->field_tP__MN.match(other_value.tP__MN(), legacy))return FALSE;
if(!other_value.tP__DA().is_bound()) return FALSE;
if(!single_value->field_tP__DA.match(other_value.tP__DA(), legacy))return FALSE;
if(!other_value.tP__CDL__CD().is_bound()) return FALSE;
if(!single_value->field_tP__CDL__CD.match(other_value.tP__CDL__CD(), 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_COMMAND.");
}
return FALSE;
}

boolean SMS__COMMAND_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tP__MTI.is_bound()
 || single_value->field_tP__Spare1.is_bound()
 || single_value->field_tP__SRR.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__PID.is_bound()
 || single_value->field_tP__CT.is_bound()
 || single_value->field_tP__MN.is_bound()
 || single_value->field_tP__DA.is_bound()
 || single_value->field_tP__CDL__CD.is_bound();
}

boolean SMS__COMMAND_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__SRR.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__PID.is_value()
 && single_value->field_tP__CT.is_value()
 && single_value->field_tP__MN.is_value()
 && single_value->field_tP__DA.is_value()
 && single_value->field_tP__CDL__CD.is_value();
}

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

SMS__COMMAND SMS__COMMAND_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_SMS_Types.SMS_COMMAND.");
SMS__COMMAND 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__SRR.is_bound()) {
ret_val.tP__SRR() = single_value->field_tP__SRR.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__PID.is_bound()) {
ret_val.tP__PID() = single_value->field_tP__PID.valueof();
}
if (single_value->field_tP__CT.is_bound()) {
ret_val.tP__CT() = single_value->field_tP__CT.valueof();
}
if (single_value->field_tP__MN.is_bound()) {
ret_val.tP__MN() = single_value->field_tP__MN.valueof();
}
if (single_value->field_tP__DA.is_bound()) {
ret_val.tP__DA() = single_value->field_tP__DA.valueof();
}
if (single_value->field_tP__CDL__CD.is_bound()) {
ret_val.tP__CDL__CD() = single_value->field_tP__CDL__CD.valueof();
}
return ret_val;
}

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

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

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

const BITSTRING_template& SMS__COMMAND_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_COMMAND.");
return single_value->field_tP__MTI;
}

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

const BITSTRING_template& SMS__COMMAND_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_COMMAND.");
return single_value->field_tP__Spare1;
}

BITSTRING_template& SMS__COMMAND_template::tP__SRR()
{
set_specific();
return single_value->field_tP__SRR;
}

const BITSTRING_template& SMS__COMMAND_template::tP__SRR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_SRR of a non-specific template of type @MobileL3_SMS_Types.SMS_COMMAND.");
return single_value->field_tP__SRR;
}

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

const BITSTRING_template& SMS__COMMAND_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_COMMAND.");
return single_value->field_tP__UDHI;
}

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

const BITSTRING_template& SMS__COMMAND_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_COMMAND.");
return single_value->field_tP__Spare2;
}

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

const OCTETSTRING_template& SMS__COMMAND_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_COMMAND.");
return single_value->field_tP__MR;
}

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

const OCTETSTRING_template& SMS__COMMAND_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_COMMAND.");
return single_value->field_tP__PID;
}

OCTETSTRING_template& SMS__COMMAND_template::tP__CT()
{
set_specific();
return single_value->field_tP__CT;
}

const OCTETSTRING_template& SMS__COMMAND_template::tP__CT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_CT of a non-specific template of type @MobileL3_SMS_Types.SMS_COMMAND.");
return single_value->field_tP__CT;
}

OCTETSTRING_template& SMS__COMMAND_template::tP__MN()
{
set_specific();
return single_value->field_tP__MN;
}

const OCTETSTRING_template& SMS__COMMAND_template::tP__MN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_MN of a non-specific template of type @MobileL3_SMS_Types.SMS_COMMAND.");
return single_value->field_tP__MN;
}

TP__DA_template& SMS__COMMAND_template::tP__DA()
{
set_specific();
return single_value->field_tP__DA;
}

const TP__DA_template& SMS__COMMAND_template::tP__DA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_DA of a non-specific template of type @MobileL3_SMS_Types.SMS_COMMAND.");
return single_value->field_tP__DA;
}

TP__CDL__CD_template& SMS__COMMAND_template::tP__CDL__CD()
{
set_specific();
return single_value->field_tP__CDL__CD;
}

const TP__CDL__CD_template& SMS__COMMAND_template::tP__CDL__CD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tP_CDL_CD of a non-specific template of type @MobileL3_SMS_Types.SMS_COMMAND.");
return single_value->field_tP__CDL__CD;
}

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

void SMS__COMMAND_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_SRR := ");
single_value->field_tP__SRR.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_PID := ");
single_value->field_tP__PID.log();
TTCN_Logger::log_event_str(", tP_CT := ");
single_value->field_tP__CT.log();
TTCN_Logger::log_event_str(", tP_MN := ");
single_value->field_tP__MN.log();
TTCN_Logger::log_event_str(", tP_DA := ");
single_value->field_tP__DA.log();
TTCN_Logger::log_event_str(", tP_CDL_CD := ");
single_value->field_tP__CDL__CD.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__COMMAND_template::log_match(const SMS__COMMAND& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_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__SRR.match(match_value.tP__SRR(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_SRR");
single_value->field_tP__SRR.log_match(match_value.tP__SRR(), 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__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__CT.match(match_value.tP__CT(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_CT");
single_value->field_tP__CT.log_match(match_value.tP__CT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__MN.match(match_value.tP__MN(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_MN");
single_value->field_tP__MN.log_match(match_value.tP__MN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__DA.match(match_value.tP__DA(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_DA");
single_value->field_tP__DA.log_match(match_value.tP__DA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tP__CDL__CD.match(match_value.tP__CDL__CD(), legacy)){
TTCN_Logger::log_logmatch_info(".tP_CDL_CD");
single_value->field_tP__CDL__CD.log_match(match_value.tP__CDL__CD(), 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_Spare1 := ");
single_value->field_tP__Spare1.log_match(match_value.tP__Spare1(), legacy);
TTCN_Logger::log_event_str(", tP_SRR := ");
single_value->field_tP__SRR.log_match(match_value.tP__SRR(), 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_PID := ");
single_value->field_tP__PID.log_match(match_value.tP__PID(), legacy);
TTCN_Logger::log_event_str(", tP_CT := ");
single_value->field_tP__CT.log_match(match_value.tP__CT(), legacy);
TTCN_Logger::log_event_str(", tP_MN := ");
single_value->field_tP__MN.log_match(match_value.tP__MN(), legacy);
TTCN_Logger::log_event_str(", tP_DA := ");
single_value->field_tP__DA.log_match(match_value.tP__DA(), legacy);
TTCN_Logger::log_event_str(", tP_CDL_CD := ");
single_value->field_tP__CDL__CD.log_match(match_value.tP__CDL__CD(), 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__COMMAND_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__SRR().is_bound()) tP__SRR().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__PID().is_bound()) tP__PID().set_implicit_omit();
if (tP__CT().is_bound()) tP__CT().set_implicit_omit();
if (tP__MN().is_bound()) tP__MN().set_implicit_omit();
if (tP__DA().is_bound()) tP__DA().set_implicit_omit();
if (tP__CDL__CD().is_bound()) tP__CDL__CD().set_implicit_omit();
}

void SMS__COMMAND_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__SRR.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__PID.encode_text(text_buf);
single_value->field_tP__CT.encode_text(text_buf);
single_value->field_tP__MN.encode_text(text_buf);
single_value->field_tP__DA.encode_text(text_buf);
single_value->field_tP__CDL__CD.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_COMMAND.");
}
}

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

void SMS__COMMAND_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    SMS__COMMAND_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.SMS_COMMAND has 11 fields but 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__SRR().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tP__UDHI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tP__Spare2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tP__MR().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tP__PID().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tP__CT().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tP__MN().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tP__DA().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__CDL__CD().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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_SRR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__SRR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_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_CT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_MN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__MN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_DA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__DA().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_CDL_CD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tP__CDL__CD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_COMMAND: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__COMMAND_template* precondition = new SMS__COMMAND_template;
    precondition->set_param(*param.get_elem(0));
    SMS__COMMAND_template* implied_template = new SMS__COMMAND_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__COMMAND_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_COMMAND");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__COMMAND_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_tP__MTI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__Spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__SRR.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__Spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__MR.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__CT.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__MN.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__DA.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
single_value->field_tP__CDL__CD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_SMS_Types.SMS_COMMAND");
}

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

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

RP__DATA__User__DataLV__MS__SGSN::RP__DATA__User__DataLV__MS__SGSN()
{
}

RP__DATA__User__DataLV__MS__SGSN::RP__DATA__User__DataLV__MS__SGSN(const INTEGER& par_rP__LengthIndicator,
    const TPDU__RP__DATA__MS__SGSN& par_rP__TPDU)
  :   field_rP__LengthIndicator(par_rP__LengthIndicator),
  field_rP__TPDU(par_rP__TPDU)
{
}

RP__DATA__User__DataLV__MS__SGSN::RP__DATA__User__DataLV__MS__SGSN(const RP__DATA__User__DataLV__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_DATA_User_DataLV_MS_SGSN.");
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__MS__SGSN::clean_up()
{
field_rP__LengthIndicator.clean_up();
field_rP__TPDU.clean_up();
}

const TTCN_Typedescriptor_t* RP__DATA__User__DataLV__MS__SGSN::get_descriptor() const { return &RP__DATA__User__DataLV__MS__SGSN_descr_; }
RP__DATA__User__DataLV__MS__SGSN& RP__DATA__User__DataLV__MS__SGSN::operator=(const RP__DATA__User__DataLV__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const RP__DATA__User__DataLV__MS__SGSN& 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__MS__SGSN::is_bound() const
{
return (field_rP__LengthIndicator.is_bound())
  || (field_rP__TPDU.is_bound());
}
boolean RP__DATA__User__DataLV__MS__SGSN::is_value() const
{
return field_rP__LengthIndicator.is_value()
  && field_rP__TPDU.is_value();
}
void RP__DATA__User__DataLV__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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_MS_SGSN 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_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_DATA_User_DataLV_MS_SGSN");
  }
}

void RP__DATA__User__DataLV__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_rP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_rP__LengthIndicator.RAW_decode(RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_rP__TPDU.RAW_decode(TPDU__RP__DATA__MS__SGSN_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__MS__SGSN::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__MS__SGSN_rP__LengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TPDU__RP__DATA__MS__SGSN_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RP__DATA__User__DataLV__MS__SGSN_template::single_value_struct {
INTEGER_template field_rP__LengthIndicator;
TPDU__RP__DATA__MS__SGSN_template field_rP__TPDU;
};

void RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN_template::copy_value(const RP__DATA__User__DataLV__MS__SGSN& 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__MS__SGSN_template::copy_template(const RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__DATA__User__DataLV__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

RP__DATA__User__DataLV__MS__SGSN_template::RP__DATA__User__DataLV__MS__SGSN_template()
{
}

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

RP__DATA__User__DataLV__MS__SGSN_template::RP__DATA__User__DataLV__MS__SGSN_template(const RP__DATA__User__DataLV__MS__SGSN& other_value)
{
copy_value(other_value);
}

RP__DATA__User__DataLV__MS__SGSN_template::RP__DATA__User__DataLV__MS__SGSN_template(const OPTIONAL<RP__DATA__User__DataLV__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RP__DATA__User__DataLV__MS__SGSN&)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_MS_SGSN from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

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

boolean RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN RP__DATA__User__DataLV__MS__SGSN_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_MS_SGSN.");
RP__DATA__User__DataLV__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RP__DATA__User__DataLV__MS__SGSN_template[list_length];
}

RP__DATA__User__DataLV__MS__SGSN_template& RP__DATA__User__DataLV__MS__SGSN_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_MS_SGSN.");
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_MS_SGSN.");
return value_list.list_value[list_index];
}

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

const INTEGER_template& RP__DATA__User__DataLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__LengthIndicator;
}

TPDU__RP__DATA__MS__SGSN_template& RP__DATA__User__DataLV__MS__SGSN_template::rP__TPDU()
{
set_specific();
return single_value->field_rP__TPDU;
}

const TPDU__RP__DATA__MS__SGSN_template& RP__DATA__User__DataLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__TPDU;
}

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

void RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN_template::log_match(const RP__DATA__User__DataLV__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void RP__DATA__User__DataLV__MS__SGSN_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_MS_SGSN");
single_value->field_rP__TPDU.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_User_DataLV_MS_SGSN");
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_MS_SGSN");
}

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

boolean RP__DATA__User__DataLV__MS__SGSN_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__MS__SGSN::RP__DATA__MS__SGSN()
{
}

RP__DATA__MS__SGSN::RP__DATA__MS__SGSN(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__MS__SGSN& 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__MS__SGSN::RP__DATA__MS__SGSN(const RP__DATA__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_DATA_MS_SGSN.");
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__MS__SGSN::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__MS__SGSN::get_descriptor() const { return &RP__DATA__MS__SGSN_descr_; }
RP__DATA__MS__SGSN& RP__DATA__MS__SGSN::operator=(const RP__DATA__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const RP__DATA__MS__SGSN& 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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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_MS_SGSN 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_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_DATA_MS_SGSN");
  }
}

void RP__DATA__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_rP__User__Data.RAW_decode(RP__DATA__User__DataLV__MS__SGSN_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_10) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__DATA__MS__SGSN::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__MS__SGSN_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__MS__SGSN_descr_, *myleaf.body.node.nodes[5]);
  if (field_rP__MTI !=  bs_10) {
  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_10.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__MS__SGSN_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__MS__SGSN_template field_rP__User__Data;
};

void RP__DATA__MS__SGSN_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__MS__SGSN_template::copy_value(const RP__DATA__MS__SGSN& 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__MS__SGSN_template::copy_template(const RP__DATA__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__DATA__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

RP__DATA__MS__SGSN_template::RP__DATA__MS__SGSN_template()
{
}

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

RP__DATA__MS__SGSN_template::RP__DATA__MS__SGSN_template(const RP__DATA__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean RP__DATA__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN RP__DATA__MS__SGSN_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_MS_SGSN.");
RP__DATA__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RP__DATA__MS__SGSN_template[list_length];
}

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

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

const BITSTRING_template& RP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__MTI;
}

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

const BITSTRING_template& RP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__Spare;
}

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

const OCTETSTRING_template& RP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__MessageReference;
}

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

const RP__OriginatorAddressLV_template& RP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__OriginatorAddress;
}

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

const RP__DestinationAddressLV_template& RP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__DestinationAddress;
}

RP__DATA__User__DataLV__MS__SGSN_template& RP__DATA__MS__SGSN_template::rP__User__Data()
{
set_specific();
return single_value->field_rP__User__Data;
}

const RP__DATA__User__DataLV__MS__SGSN_template& RP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__User__Data;
}

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

void RP__DATA__MS__SGSN_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__MS__SGSN_template::log_match(const RP__DATA__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void RP__DATA__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void RP__DATA__MS__SGSN_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_MS_SGSN");
single_value->field_rP__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_MS_SGSN");
single_value->field_rP__MessageReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_MS_SGSN");
single_value->field_rP__OriginatorAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_MS_SGSN");
single_value->field_rP__DestinationAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_MS_SGSN");
single_value->field_rP__User__Data.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_DATA_MS_SGSN");
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_MS_SGSN");
}

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

boolean RP__DATA__MS__SGSN_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__MS__SGSN::RP__ACK__MS__SGSN()
{
}

RP__ACK__MS__SGSN::RP__ACK__MS__SGSN(const BITSTRING& par_rP__MTI,
    const BITSTRING& par_rP__Spare,
    const OCTETSTRING& par_rP__MessageReference,
    const OPTIONAL< RP__ACK__User__DataTLV__MS__SGSN >& 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__MS__SGSN::RP__ACK__MS__SGSN(const RP__ACK__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ACK_MS_SGSN.");
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__MS__SGSN::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__MS__SGSN::get_descriptor() const { return &RP__ACK__MS__SGSN_descr_; }
RP__ACK__MS__SGSN& RP__ACK__MS__SGSN::operator=(const RP__ACK__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const RP__ACK__MS__SGSN& 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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::size_of() const
{
  int ret_val = 3;
  if (field_rP__User__Data.ispresent()) ret_val++;
  return ret_val;
}

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

void RP__ACK__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_rP__User__Data().RAW_decode(RP__ACK__User__DataTLV__MS__SGSN_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_11) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__ACK__MS__SGSN::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__MS__SGSN_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__MS__SGSN_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_rP__MTI !=  bs_11) {
  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_11.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__MS__SGSN_template::single_value_struct {
BITSTRING_template field_rP__MTI;
BITSTRING_template field_rP__Spare;
OCTETSTRING_template field_rP__MessageReference;
RP__ACK__User__DataTLV__MS__SGSN_template field_rP__User__Data;
};

void RP__ACK__MS__SGSN_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__MS__SGSN_template::copy_value(const RP__ACK__MS__SGSN& 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__MS__SGSN_template::copy_template(const RP__ACK__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ACK__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

RP__ACK__MS__SGSN_template::RP__ACK__MS__SGSN_template()
{
}

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

RP__ACK__MS__SGSN_template::RP__ACK__MS__SGSN_template(const RP__ACK__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__ACK__MS__SGSN_template::match(const RP__ACK__MS__SGSN& 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__MS__SGSN&)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_MS_SGSN.");
}
return FALSE;
}

boolean RP__ACK__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN RP__ACK__MS__SGSN_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_MS_SGSN.");
RP__ACK__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RP__ACK__MS__SGSN_template[list_length];
}

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

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

const BITSTRING_template& RP__ACK__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__MTI;
}

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

const BITSTRING_template& RP__ACK__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__Spare;
}

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

const OCTETSTRING_template& RP__ACK__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__MessageReference;
}

RP__ACK__User__DataTLV__MS__SGSN_template& RP__ACK__MS__SGSN_template::rP__User__Data()
{
set_specific();
return single_value->field_rP__User__Data;
}

const RP__ACK__User__DataTLV__MS__SGSN_template& RP__ACK__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__User__Data;
}

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

void RP__ACK__MS__SGSN_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__MS__SGSN_template::log_match(const RP__ACK__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void RP__ACK__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void RP__ACK__MS__SGSN_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_MS_SGSN");
single_value->field_rP__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ACK_MS_SGSN");
single_value->field_rP__MessageReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ACK_MS_SGSN");
single_value->field_rP__User__Data.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ACK_MS_SGSN");
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_MS_SGSN");
}

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

boolean RP__ACK__MS__SGSN_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__MS__SGSN::copy_value(const TPDU__RP__ACK__MS__SGSN& other_value)
{
switch (other_value.union_selection) {
case ALT_sMS__DELIVER__REPORT:
field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ACK(*other_value.field_sMS__DELIVER__REPORT);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TPDU__RP__ACK__MS__SGSN::operator==(const TPDU__RP__ACK__MS__SGSN& 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_MS_SGSN.");
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_MS_SGSN.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
return *field_sMS__DELIVER__REPORT == *other_value.field_sMS__DELIVER__REPORT;
default:
return FALSE;
}
}

SMS__DELIVER__REPORT__in__RP__ACK& TPDU__RP__ACK__MS__SGSN::sMS__DELIVER__REPORT()
{
if (union_selection != ALT_sMS__DELIVER__REPORT) {
clean_up();
field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ACK;
union_selection = ALT_sMS__DELIVER__REPORT;
}
return *field_sMS__DELIVER__REPORT;
}

const SMS__DELIVER__REPORT__in__RP__ACK& TPDU__RP__ACK__MS__SGSN::sMS__DELIVER__REPORT() const
{
if (union_selection != ALT_sMS__DELIVER__REPORT) TTCN_error("Using non-selected field sMS_DELIVER_REPORT in a value of union type @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN.");
return *field_sMS__DELIVER__REPORT;
}

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

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

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

void TPDU__RP__ACK__MS__SGSN::clean_up()
{
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
  delete field_sMS__DELIVER__REPORT;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TPDU__RP__ACK__MS__SGSN::log() const
{
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
TTCN_Logger::log_event_str("{ sMS_DELIVER_REPORT := ");
field_sMS__DELIVER__REPORT->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

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

void TPDU__RP__ACK__MS__SGSN::set_implicit_omit()
{
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
field_sMS__DELIVER__REPORT->set_implicit_omit(); break;
default: break;
}
}

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

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

void TPDU__RP__ACK__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__REPORT__in__RP__ACK_descr_.raw->forceomit);
      decoded_length = sMS__DELIVER__REPORT().RAW_decode(SMS__DELIVER__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_3) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, SMS__DELIVER__REPORT__in__RP__ACK_descr_.raw->forceomit);
          decoded_length = sMS__DELIVER__REPORT().RAW_decode(SMS__DELIVER__REPORT__in__RP__ACK_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__DELIVER__REPORT).tP__MTI() ==  bs_3) {
               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__MS__SGSN::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__DELIVER__REPORT:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SMS__DELIVER__REPORT__in__RP__ACK_descr_.raw);
    encoded_length = field_sMS__DELIVER__REPORT->RAW_encode(SMS__DELIVER__REPORT__in__RP__ACK_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SMS__DELIVER__REPORT__in__RP__ACK_descr_;
    if ((*field_sMS__DELIVER__REPORT).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;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TPDU__RP__ACK__MS__SGSN_template::copy_value(const TPDU__RP__ACK__MS__SGSN& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ACK_template(other_value.sMS__DELIVER__REPORT());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN.");
}
set_selection(SPECIFIC_VALUE);
}

void TPDU__RP__ACK__MS__SGSN_template::copy_template(const TPDU__RP__ACK__MS__SGSN_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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ACK_template(*other_value.single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new TPDU__RP__ACK__MS__SGSN_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_MS_SGSN.");
}
set_selection(other_value);
}

TPDU__RP__ACK__MS__SGSN_template::TPDU__RP__ACK__MS__SGSN_template()
{
}

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

TPDU__RP__ACK__MS__SGSN_template::TPDU__RP__ACK__MS__SGSN_template(const TPDU__RP__ACK__MS__SGSN& other_value)
{
copy_value(other_value);
}

TPDU__RP__ACK__MS__SGSN_template::TPDU__RP__ACK__MS__SGSN_template(const OPTIONAL<TPDU__RP__ACK__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TPDU__RP__ACK__MS__SGSN&)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_MS_SGSN from an unbound optional field.");
}
}

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

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

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

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

void TPDU__RP__ACK__MS__SGSN_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
delete single_value.field_sMS__DELIVER__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__MS__SGSN_template& TPDU__RP__ACK__MS__SGSN_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

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

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

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

boolean TPDU__RP__ACK__MS__SGSN_template::match(const TPDU__RP__ACK__MS__SGSN& 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__MS__SGSN::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TPDU__RP__ACK__MS__SGSN::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
return single_value.field_sMS__DELIVER__REPORT->match(other_value.sMS__DELIVER__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_MS_SGSN.");
}
}
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_MS_SGSN.");
}
return FALSE;
}

boolean TPDU__RP__ACK__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
return single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
}

TPDU__RP__ACK__MS__SGSN TPDU__RP__ACK__MS__SGSN_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_MS_SGSN.");
TPDU__RP__ACK__MS__SGSN ret_val;
switch (single_value.union_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
ret_val.sMS__DELIVER__REPORT() = single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
return ret_val;
}

TPDU__RP__ACK__MS__SGSN_template& TPDU__RP__ACK__MS__SGSN_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_MS_SGSN.");
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_MS_SGSN.");
return value_list.list_value[list_index];
}
void TPDU__RP__ACK__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TPDU__RP__ACK__MS__SGSN_template[list_length];
}

SMS__DELIVER__REPORT__in__RP__ACK_template& TPDU__RP__ACK__MS__SGSN_template::sMS__DELIVER__REPORT()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ACK_template(ANY_VALUE);
else single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ACK_template;
single_value.union_selection = TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__DELIVER__REPORT;
}

const SMS__DELIVER__REPORT__in__RP__ACK_template& TPDU__RP__ACK__MS__SGSN_template::sMS__DELIVER__REPORT() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_DELIVER_REPORT in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN.");
if (single_value.union_selection != TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT) TTCN_error("Accessing non-selected field sMS_DELIVER_REPORT in a template of union type @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN.");
return *single_value.field_sMS__DELIVER__REPORT;
}

boolean TPDU__RP__ACK__MS__SGSN_template::ischosen(TPDU__RP__ACK__MS__SGSN::union_selection_type checked_selection) const
{
if (checked_selection == TPDU__RP__ACK__MS__SGSN::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TPDU__RP__ACK__MS__SGSN::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_MS_SGSN.");
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_MS_SGSN 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__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
TTCN_Logger::log_event_str("{ sMS_DELIVER_REPORT := ");
single_value.field_sMS__DELIVER__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__MS__SGSN_template::log_match(const TPDU__RP__ACK__MS__SGSN& 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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_DELIVER_REPORT");
single_value.field_sMS__DELIVER__REPORT->log_match(match_value.sMS__DELIVER__REPORT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_DELIVER_REPORT := ");
single_value.field_sMS__DELIVER__REPORT->log_match(match_value.sMS__DELIVER__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__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__ACK__MS__SGSN_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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
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_MS_SGSN.");
}
}

void TPDU__RP__ACK__MS__SGSN_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__MS__SGSN::UNBOUND_VALUE;
TPDU__RP__ACK__MS__SGSN::union_selection_type new_selection = (TPDU__RP__ACK__MS__SGSN::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TPDU__RP__ACK__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ACK_template;
single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

boolean TPDU__RP__ACK__MS__SGSN_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__MS__SGSN_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_MS_SGSN'");
    }
    if (strcmp("sMS_DELIVER_REPORT", param_field) == 0) {
      sMS__DELIVER__REPORT().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN'", 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__MS__SGSN_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_MS_SGSN");
    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_REPORT")) {
      sMS__DELIVER__REPORT().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TPDU__RP__ACK__MS__SGSN_template* precondition = new TPDU__RP__ACK__MS__SGSN_template;
    precondition->set_param(*m_p->get_elem(0));
    TPDU__RP__ACK__MS__SGSN_template* implied_template = new TPDU__RP__ACK__MS__SGSN_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TPDU__RP__ACK__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void TPDU__RP__ACK__MS__SGSN_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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_ACK_MS_SGSN");
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_MS_SGSN.");
}
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_MS_SGSN");
}

SMS__DELIVER__REPORT__in__RP__ACK::SMS__DELIVER__REPORT__in__RP__ACK()
{
}

SMS__DELIVER__REPORT__in__RP__ACK::SMS__DELIVER__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 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__PID(par_tP__PID),
  field_tP__DCS(par_tP__DCS),
  field_tP__UDL__UD(par_tP__UDL__UD)
{
}

SMS__DELIVER__REPORT__in__RP__ACK::SMS__DELIVER__REPORT__in__RP__ACK(const SMS__DELIVER__REPORT__in__RP__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_DELIVER_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__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__DELIVER__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__PID.clean_up();
field_tP__DCS.clean_up();
field_tP__UDL__UD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__DELIVER__REPORT__in__RP__ACK::get_descriptor() const { return &SMS__DELIVER__REPORT__in__RP__ACK_descr_; }
SMS__DELIVER__REPORT__in__RP__ACK& SMS__DELIVER__REPORT__in__RP__ACK::operator=(const SMS__DELIVER__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_DELIVER_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__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__DELIVER__REPORT__in__RP__ACK::operator==(const SMS__DELIVER__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__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__DELIVER__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())
  || (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__DELIVER__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()
  && (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__DELIVER__REPORT__in__RP__ACK::size_of() const
{
  int ret_val = 9;
  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__DELIVER__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_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__DELIVER__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__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__DELIVER__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 (12<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK 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__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__PID().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().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_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_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_DELIVER_REPORT_in_RP_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
  }
}

void SMS__DELIVER__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__PID.encode_text(text_buf);
field_tP__DCS.encode_text(text_buf);
field_tP__UDL__UD.encode_text(text_buf);
}

void SMS__DELIVER__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__PID.decode_text(text_buf);
field_tP__DCS.decode_text(text_buf);
field_tP__UDL__UD.decode_text(text_buf);
}

void SMS__DELIVER__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__DELIVER__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__DELIVER__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());
  if (limit > 0 && field_tP__PresenceBitTP__PID ==  bs_4){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_tP__PID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_descr_.raw->forceomit);
  decoded_field_length = field_tP__PID().RAW_decode(SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_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)(10)) {
    field_tP__DCS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_descr_.raw->forceomit);
  decoded_field_length = field_tP__DCS().RAW_decode(SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_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)(11)) {
    field_tP__UDL__UD = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_descr_.raw->forceomit);
  decoded_field_length = field_tP__UDL__UD().RAW_decode(SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_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_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__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 = 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::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);
  if (field_tP__PID.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_tP__DCS.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_tP__UDL__UD.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = 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]);
  if (field_tP__PID.ispresent()) {
  encoded_length += field_tP__PID().RAW_encode(SMS__DELIVER__REPORT__in__RP__ACK_tP__PID_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_tP__DCS.ispresent()) {
  encoded_length += field_tP__DCS().RAW_encode(SMS__DELIVER__REPORT__in__RP__ACK_tP__DCS_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_tP__UDL__UD.ispresent()) {
  encoded_length += field_tP__UDL__UD().RAW_encode(SMS__DELIVER__REPORT__in__RP__ACK_tP__UDL__UD_descr_, *myleaf.body.node.nodes[11]);
  }
  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_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__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__PID;
OCTETSTRING_template field_tP__DCS;
TP__UDL__UD_template field_tP__UDL__UD;
};

void SMS__DELIVER__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__PID = ANY_OR_OMIT;
single_value->field_tP__DCS = ANY_OR_OMIT;
single_value->field_tP__UDL__UD = ANY_OR_OMIT;
}
}
}

void SMS__DELIVER__REPORT__in__RP__ACK_template::copy_value(const SMS__DELIVER__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__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__DELIVER__REPORT__in__RP__ACK_template::copy_template(const SMS__DELIVER__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__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__DELIVER__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__DELIVER__REPORT__in__RP__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
break;
}
set_selection(other_value);
}

SMS__DELIVER__REPORT__in__RP__ACK_template::SMS__DELIVER__REPORT__in__RP__ACK_template()
{
}

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

SMS__DELIVER__REPORT__in__RP__ACK_template::SMS__DELIVER__REPORT__in__RP__ACK_template(const SMS__DELIVER__REPORT__in__RP__ACK& other_value)
{
copy_value(other_value);
}

SMS__DELIVER__REPORT__in__RP__ACK_template::SMS__DELIVER__REPORT__in__RP__ACK_template(const OPTIONAL<SMS__DELIVER__REPORT__in__RP__ACK>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean SMS__DELIVER__REPORT__in__RP__ACK_template::match(const SMS__DELIVER__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__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_DELIVER_REPORT_in_RP_ACK.");
}
return FALSE;
}

boolean SMS__DELIVER__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__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__DELIVER__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__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__DELIVER__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__DELIVER__REPORT__in__RP__ACK SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
SMS__DELIVER__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__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__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SMS__DELIVER__REPORT__in__RP__ACK_template[list_length];
}

SMS__DELIVER__REPORT__in__RP__ACK_template& SMS__DELIVER__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_DELIVER_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_DELIVER_REPORT_in_RP_ACK.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__MTI;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__Spare1;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__UDHI;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__Spare2;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__PresenceBitTP__PID;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__PresenceBitTP__DCS;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__PresenceBitTP__UDL;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__Reserved;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__ExtensionBit;
}

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

const OCTETSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__PID;
}

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

const OCTETSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__DCS;
}

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

const TP__UDL__UD_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
return single_value->field_tP__UDL__UD;
}

int SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 9;
      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_DELIVER_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_DELIVER_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_DELIVER_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_DELIVER_REPORT_in_RP_ACK containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_DELIVER_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_DELIVER_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_DELIVER_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_DELIVER_REPORT_in_RP_ACK.");
  }
  return 0;
}

void SMS__DELIVER__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_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__DELIVER__REPORT__in__RP__ACK_template::log_match(const SMS__DELIVER__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 (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_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__DELIVER__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__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__DELIVER__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__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_DELIVER_REPORT_in_RP_ACK.");
}
}

void SMS__DELIVER__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__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__DELIVER__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_DELIVER_REPORT_in_RP_ACK.");
}
}

void SMS__DELIVER__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__DELIVER__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 (12<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK 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__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__PID().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tP__DCS().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_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_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_DELIVER_REPORT_in_RP_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__DELIVER__REPORT__in__RP__ACK_template* precondition = new SMS__DELIVER__REPORT__in__RP__ACK_template;
    precondition->set_param(*param.get_elem(0));
    SMS__DELIVER__REPORT__in__RP__ACK_template* implied_template = new SMS__DELIVER__REPORT__in__RP__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__DELIVER__REPORT__in__RP__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__DELIVER__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_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__Spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__Spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__PresenceBitTP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__PresenceBitTP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__PresenceBitTP__UDL.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__Reserved.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__ExtensionBit.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ACK");
single_value->field_tP__UDL__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_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_DELIVER_REPORT_in_RP_ACK");
}

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

boolean SMS__DELIVER__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__MS__SGSN::RP__ACK__User__DataTLV__MS__SGSN()
{
}

RP__ACK__User__DataTLV__MS__SGSN::RP__ACK__User__DataTLV__MS__SGSN(const BITSTRING& par_rP__Spare,
    const BITSTRING& par_rP__UserDataIEI,
    const INTEGER& par_rP__LengthIndicator,
    const TPDU__RP__ACK__MS__SGSN& 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__MS__SGSN::RP__ACK__User__DataTLV__MS__SGSN(const RP__ACK__User__DataTLV__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN.");
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__MS__SGSN::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__MS__SGSN::get_descriptor() const { return &RP__ACK__User__DataTLV__MS__SGSN_descr_; }
RP__ACK__User__DataTLV__MS__SGSN& RP__ACK__User__DataTLV__MS__SGSN::operator=(const RP__ACK__User__DataTLV__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const RP__ACK__User__DataTLV__MS__SGSN& 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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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_MS_SGSN 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_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN");
  }
}

void RP__ACK__User__DataTLV__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_rP__Spare_descr_.raw->forceomit);
  decoded_field_length = field_rP__Spare.RAW_decode(RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_rP__UserDataIEI_descr_.raw->forceomit);
  decoded_field_length = field_rP__UserDataIEI.RAW_decode(RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_rP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_rP__LengthIndicator.RAW_decode(RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_rP__TPDU.RAW_decode(TPDU__RP__ACK__MS__SGSN_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__MS__SGSN::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__MS__SGSN_rP__Spare_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RP__ACK__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RP__ACK__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TPDU__RP__ACK__MS__SGSN_descr_.raw);
  encoded_length += field_rP__Spare.RAW_encode(RP__ACK__User__DataTLV__MS__SGSN_rP__Spare_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__UserDataIEI.RAW_encode(RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN_template::single_value_struct {
BITSTRING_template field_rP__Spare;
BITSTRING_template field_rP__UserDataIEI;
INTEGER_template field_rP__LengthIndicator;
TPDU__RP__ACK__MS__SGSN_template field_rP__TPDU;
};

void RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_template::copy_value(const RP__ACK__User__DataTLV__MS__SGSN& 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__MS__SGSN_template::copy_template(const RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

RP__ACK__User__DataTLV__MS__SGSN_template::RP__ACK__User__DataTLV__MS__SGSN_template()
{
}

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

RP__ACK__User__DataTLV__MS__SGSN_template::RP__ACK__User__DataTLV__MS__SGSN_template(const RP__ACK__User__DataTLV__MS__SGSN& other_value)
{
copy_value(other_value);
}

RP__ACK__User__DataTLV__MS__SGSN_template::RP__ACK__User__DataTLV__MS__SGSN_template(const OPTIONAL<RP__ACK__User__DataTLV__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RP__ACK__User__DataTLV__MS__SGSN&)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_MS_SGSN from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

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

boolean RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN.");
RP__ACK__User__DataTLV__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RP__ACK__User__DataTLV__MS__SGSN_template[list_length];
}

RP__ACK__User__DataTLV__MS__SGSN_template& RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN.");
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_MS_SGSN.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__Spare;
}

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

const BITSTRING_template& RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__UserDataIEI;
}

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

const INTEGER_template& RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__LengthIndicator;
}

TPDU__RP__ACK__MS__SGSN_template& RP__ACK__User__DataTLV__MS__SGSN_template::rP__TPDU()
{
set_specific();
return single_value->field_rP__TPDU;
}

const TPDU__RP__ACK__MS__SGSN_template& RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__TPDU;
}

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

void RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_template::log_match(const RP__ACK__User__DataTLV__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void RP__ACK__User__DataTLV__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void RP__ACK__User__DataTLV__MS__SGSN_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_MS_SGSN");
single_value->field_rP__UserDataIEI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN");
single_value->field_rP__LengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN");
single_value->field_rP__TPDU.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ACK_User_DataTLV_MS_SGSN");
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_MS_SGSN");
}

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

boolean RP__ACK__User__DataTLV__MS__SGSN_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__CauseV::RP__CauseV()
{
}

RP__CauseV::RP__CauseV(const BITSTRING& par_causeValue,
    const BITSTRING& par_ext)
  :   field_causeValue(par_causeValue),
  field_ext(par_ext)
{
}

RP__CauseV::RP__CauseV(const RP__CauseV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_CauseV.");
if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
else field_causeValue.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
}

void RP__CauseV::clean_up()
{
field_causeValue.clean_up();
field_ext.clean_up();
}

const TTCN_Typedescriptor_t* RP__CauseV::get_descriptor() const { return &RP__CauseV_descr_; }
RP__CauseV& RP__CauseV::operator=(const RP__CauseV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_CauseV.");
  if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
  else field_causeValue.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
}
return *this;
}

boolean RP__CauseV::operator==(const RP__CauseV& other_value) const
{
return field_causeValue==other_value.field_causeValue
  && field_ext==other_value.field_ext;
}

boolean RP__CauseV::is_bound() const
{
return (field_causeValue.is_bound())
  || (field_ext.is_bound());
}
boolean RP__CauseV::is_value() const
{
return field_causeValue.is_value()
  && field_ext.is_value();
}
void RP__CauseV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ causeValue := ");
field_causeValue.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(" }");
}

void RP__CauseV::set_implicit_omit()
{
if (causeValue().is_bound()) causeValue().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
}

void RP__CauseV::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_CauseV 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) causeValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CauseV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_CauseV");
  }
}

void RP__CauseV::encode_text(Text_Buf& text_buf) const
{
field_causeValue.encode_text(text_buf);
field_ext.encode_text(text_buf);
}

void RP__CauseV::decode_text(Text_Buf& text_buf)
{
field_causeValue.decode_text(text_buf);
field_ext.decode_text(text_buf);
}

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

int RP__CauseV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_causeValue.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RP__CauseV_template::single_value_struct {
BITSTRING_template field_causeValue;
BITSTRING_template field_ext;
};

void RP__CauseV_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_causeValue = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
}
}
}

void RP__CauseV_template::copy_value(const RP__CauseV& other_value)
{
single_value = new single_value_struct;
if (other_value.causeValue().is_bound()) {
  single_value->field_causeValue = other_value.causeValue();
} else {
  single_value->field_causeValue.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__CauseV_template::copy_template(const RP__CauseV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.causeValue().get_selection()) {
single_value->field_causeValue = other_value.causeValue();
} else {
single_value->field_causeValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.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__CauseV_template[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__CauseV_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__CauseV_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_CauseV.");
break;
}
set_selection(other_value);
}

RP__CauseV_template::RP__CauseV_template()
{
}

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

RP__CauseV_template::RP__CauseV_template(const RP__CauseV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__CauseV_template::match(const RP__CauseV& 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.causeValue().is_bound()) return FALSE;
if(!single_value->field_causeValue.match(other_value.causeValue(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), 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_CauseV.");
}
return FALSE;
}

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

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

void RP__CauseV_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__CauseV RP__CauseV_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_CauseV.");
RP__CauseV ret_val;
if (single_value->field_causeValue.is_bound()) {
ret_val.causeValue() = single_value->field_causeValue.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& RP__CauseV_template::causeValue()
{
set_specific();
return single_value->field_causeValue;
}

const BITSTRING_template& RP__CauseV_template::causeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeValue of a non-specific template of type @MobileL3_SMS_Types.RP_CauseV.");
return single_value->field_causeValue;
}

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

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

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

void RP__CauseV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ causeValue := ");
single_value->field_causeValue.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.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__CauseV_template::log_match(const RP__CauseV& 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_causeValue.match(match_value.causeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".causeValue");
single_value->field_causeValue.log_match(match_value.causeValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ causeValue := ");
single_value->field_causeValue.log_match(match_value.causeValue(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), 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__CauseV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (causeValue().is_bound()) causeValue().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
}

void RP__CauseV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_causeValue.encode_text(text_buf);
single_value->field_ext.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_CauseV.");
}
}

void RP__CauseV_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_causeValue.decode_text(text_buf);
single_value->field_ext.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__CauseV_template[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_CauseV.");
}
}

void RP__CauseV_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__CauseV_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_CauseV 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) causeValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CauseV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__CauseV_template* precondition = new RP__CauseV_template;
    precondition->set_param(*param.get_elem(0));
    RP__CauseV_template* implied_template = new RP__CauseV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__CauseV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_CauseV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RP__CauseV_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_causeValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_CauseV");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_CauseV");
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_CauseV");
}

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

boolean RP__CauseV_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__CauseLV::RP__CauseLV()
{
}

RP__CauseLV::RP__CauseLV(const INTEGER& par_rP__LengthIndicator,
    const RP__CauseV& par_rP__CauseV,
    const OPTIONAL< OCTETSTRING >& par_rP__diagnisticField)
  :   field_rP__LengthIndicator(par_rP__LengthIndicator),
  field_rP__CauseV(par_rP__CauseV),
  field_rP__diagnisticField(par_rP__diagnisticField)
{
}

RP__CauseLV::RP__CauseLV(const RP__CauseLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_CauseLV.");
if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
else field_rP__LengthIndicator.clean_up();
if (other_value.rP__CauseV().is_bound()) field_rP__CauseV = other_value.rP__CauseV();
else field_rP__CauseV.clean_up();
if (other_value.rP__diagnisticField().is_bound()) field_rP__diagnisticField = other_value.rP__diagnisticField();
else field_rP__diagnisticField.clean_up();
}

void RP__CauseLV::clean_up()
{
field_rP__LengthIndicator.clean_up();
field_rP__CauseV.clean_up();
field_rP__diagnisticField.clean_up();
}

const TTCN_Typedescriptor_t* RP__CauseLV::get_descriptor() const { return &RP__CauseLV_descr_; }
RP__CauseLV& RP__CauseLV::operator=(const RP__CauseLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.RP_CauseLV.");
  if (other_value.rP__LengthIndicator().is_bound()) field_rP__LengthIndicator = other_value.rP__LengthIndicator();
  else field_rP__LengthIndicator.clean_up();
  if (other_value.rP__CauseV().is_bound()) field_rP__CauseV = other_value.rP__CauseV();
  else field_rP__CauseV.clean_up();
  if (other_value.rP__diagnisticField().is_bound()) field_rP__diagnisticField = other_value.rP__diagnisticField();
  else field_rP__diagnisticField.clean_up();
}
return *this;
}

boolean RP__CauseLV::operator==(const RP__CauseLV& other_value) const
{
return field_rP__LengthIndicator==other_value.field_rP__LengthIndicator
  && field_rP__CauseV==other_value.field_rP__CauseV
  && field_rP__diagnisticField==other_value.field_rP__diagnisticField;
}

boolean RP__CauseLV::is_bound() const
{
return (field_rP__LengthIndicator.is_bound())
  || (field_rP__CauseV.is_bound())
  || (OPTIONAL_OMIT == field_rP__diagnisticField.get_selection() || field_rP__diagnisticField.is_bound());
}
boolean RP__CauseLV::is_value() const
{
return field_rP__LengthIndicator.is_value()
  && field_rP__CauseV.is_value()
  && (OPTIONAL_OMIT == field_rP__diagnisticField.get_selection() || field_rP__diagnisticField.is_value());
}
int RP__CauseLV::size_of() const
{
  int ret_val = 2;
  if (field_rP__diagnisticField.ispresent()) ret_val++;
  return ret_val;
}

void RP__CauseLV::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_CauseV := ");
field_rP__CauseV.log();
TTCN_Logger::log_event_str(", rP_diagnisticField := ");
field_rP__diagnisticField.log();
TTCN_Logger::log_event_str(" }");
}

void RP__CauseLV::set_implicit_omit()
{
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__CauseV().is_bound()) rP__CauseV().set_implicit_omit();
if (!rP__diagnisticField().is_bound()) rP__diagnisticField() = OMIT_VALUE;
else rP__diagnisticField().set_implicit_omit();
}

void RP__CauseLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_CauseLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) rP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__CauseV().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__diagnisticField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_CauseV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__CauseV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_diagnisticField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__diagnisticField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CauseLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_CauseLV");
  }
}

void RP__CauseLV::encode_text(Text_Buf& text_buf) const
{
field_rP__LengthIndicator.encode_text(text_buf);
field_rP__CauseV.encode_text(text_buf);
field_rP__diagnisticField.encode_text(text_buf);
}

void RP__CauseLV::decode_text(Text_Buf& text_buf)
{
field_rP__LengthIndicator.decode_text(text_buf);
field_rP__CauseV.decode_text(text_buf);
field_rP__diagnisticField.decode_text(text_buf);
}

void RP__CauseLV::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__CauseLV::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__CauseLV::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__CauseLV_rP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_rP__LengthIndicator.RAW_decode(RP__CauseLV_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__CauseLV_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, RP__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_rP__CauseV.RAW_decode(RP__CauseV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_rP__diagnisticField = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rP__diagnisticField().RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_rP__diagnisticField = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_rP__diagnisticField=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__CauseLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, RP__CauseLV_rP__LengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RP__CauseV_descr_.raw);
  if (field_rP__diagnisticField.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RP__CauseLV_rP__LengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  if (field_rP__diagnisticField.ispresent()) {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = 0;
  }
  encoded_length += field_rP__CauseV.RAW_encode(RP__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_rP__diagnisticField.ispresent()) {
  encoded_length += field_rP__diagnisticField().RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  }
  return myleaf.length = encoded_length;
}

struct RP__CauseLV_template::single_value_struct {
INTEGER_template field_rP__LengthIndicator;
RP__CauseV_template field_rP__CauseV;
OCTETSTRING_template field_rP__diagnisticField;
};

void RP__CauseLV_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__CauseV = ANY_VALUE;
single_value->field_rP__diagnisticField = ANY_OR_OMIT;
}
}
}

void RP__CauseLV_template::copy_value(const RP__CauseLV& 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__CauseV().is_bound()) {
  single_value->field_rP__CauseV = other_value.rP__CauseV();
} else {
  single_value->field_rP__CauseV.clean_up();
}
if (other_value.rP__diagnisticField().is_bound()) {
  if (other_value.rP__diagnisticField().ispresent()) single_value->field_rP__diagnisticField = other_value.rP__diagnisticField()();
  else single_value->field_rP__diagnisticField = OMIT_VALUE;
} else {
  single_value->field_rP__diagnisticField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RP__CauseLV_template::copy_template(const RP__CauseLV_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__CauseV().get_selection()) {
single_value->field_rP__CauseV = other_value.rP__CauseV();
} else {
single_value->field_rP__CauseV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rP__diagnisticField().get_selection()) {
single_value->field_rP__diagnisticField = other_value.rP__diagnisticField();
} else {
single_value->field_rP__diagnisticField.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__CauseLV_template[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__CauseLV_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__CauseLV_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_CauseLV.");
break;
}
set_selection(other_value);
}

RP__CauseLV_template::RP__CauseLV_template()
{
}

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

RP__CauseLV_template::RP__CauseLV_template(const RP__CauseLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__CauseLV_template::match(const RP__CauseLV& 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__CauseV().is_bound()) return FALSE;
if(!single_value->field_rP__CauseV.match(other_value.rP__CauseV(), legacy))return FALSE;
if(!other_value.rP__diagnisticField().is_bound()) return FALSE;
if((other_value.rP__diagnisticField().ispresent() ? !single_value->field_rP__diagnisticField.match((const OCTETSTRING&)other_value.rP__diagnisticField(), legacy) : !single_value->field_rP__diagnisticField.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_CauseLV.");
}
return FALSE;
}

boolean RP__CauseLV_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__CauseV.is_bound()
 || (single_value->field_rP__diagnisticField.is_omit() || single_value->field_rP__diagnisticField.is_bound());
}

boolean RP__CauseLV_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__CauseV.is_value()
 && (single_value->field_rP__diagnisticField.is_omit() || single_value->field_rP__diagnisticField.is_value());
}

void RP__CauseLV_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__CauseLV RP__CauseLV_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_CauseLV.");
RP__CauseLV 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__CauseV.is_bound()) {
ret_val.rP__CauseV() = single_value->field_rP__CauseV.valueof();
}
if (single_value->field_rP__diagnisticField.is_omit()) ret_val.rP__diagnisticField() = OMIT_VALUE;
else if (single_value->field_rP__diagnisticField.is_bound()) {
ret_val.rP__diagnisticField() = single_value->field_rP__diagnisticField.valueof();
}
return ret_val;
}

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

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

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

const INTEGER_template& RP__CauseLV_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_CauseLV.");
return single_value->field_rP__LengthIndicator;
}

RP__CauseV_template& RP__CauseLV_template::rP__CauseV()
{
set_specific();
return single_value->field_rP__CauseV;
}

const RP__CauseV_template& RP__CauseLV_template::rP__CauseV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_CauseV of a non-specific template of type @MobileL3_SMS_Types.RP_CauseLV.");
return single_value->field_rP__CauseV;
}

OCTETSTRING_template& RP__CauseLV_template::rP__diagnisticField()
{
set_specific();
return single_value->field_rP__diagnisticField;
}

const OCTETSTRING_template& RP__CauseLV_template::rP__diagnisticField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rP_diagnisticField of a non-specific template of type @MobileL3_SMS_Types.RP_CauseLV.");
return single_value->field_rP__diagnisticField;
}

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

void RP__CauseLV_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_CauseV := ");
single_value->field_rP__CauseV.log();
TTCN_Logger::log_event_str(", rP_diagnisticField := ");
single_value->field_rP__diagnisticField.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__CauseLV_template::log_match(const RP__CauseLV& 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__CauseV.match(match_value.rP__CauseV(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_CauseV");
single_value->field_rP__CauseV.log_match(match_value.rP__CauseV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rP__diagnisticField().ispresent()){
if(!single_value->field_rP__diagnisticField.match(match_value.rP__diagnisticField(), legacy)){
TTCN_Logger::log_logmatch_info(".rP_diagnisticField");
single_value->field_rP__diagnisticField.log_match(match_value.rP__diagnisticField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rP__diagnisticField.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rP_diagnisticField := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rP__diagnisticField.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_LengthIndicator := ");
single_value->field_rP__LengthIndicator.log_match(match_value.rP__LengthIndicator(), legacy);
TTCN_Logger::log_event_str(", rP_CauseV := ");
single_value->field_rP__CauseV.log_match(match_value.rP__CauseV(), legacy);
TTCN_Logger::log_event_str(", rP_diagnisticField := ");
if (match_value.rP__diagnisticField().ispresent()) {
single_value->field_rP__diagnisticField.log_match(match_value.rP__diagnisticField(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rP__diagnisticField.log();
if (single_value->field_rP__diagnisticField.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__CauseLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rP__LengthIndicator().is_bound()) rP__LengthIndicator().set_implicit_omit();
if (rP__CauseV().is_bound()) rP__CauseV().set_implicit_omit();
if (!rP__diagnisticField().is_bound()) rP__diagnisticField() = OMIT_VALUE;
else rP__diagnisticField().set_implicit_omit();
}

void RP__CauseLV_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__CauseV.encode_text(text_buf);
single_value->field_rP__diagnisticField.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_CauseLV.");
}
}

void RP__CauseLV_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__CauseV.decode_text(text_buf);
single_value->field_rP__diagnisticField.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__CauseLV_template[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_CauseLV.");
}
}

void RP__CauseLV_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__CauseLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_CauseLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) rP__LengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rP__CauseV().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rP__diagnisticField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_CauseV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__CauseV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_diagnisticField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rP__diagnisticField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CauseLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__CauseLV_template* precondition = new RP__CauseLV_template;
    precondition->set_param(*param.get_elem(0));
    RP__CauseLV_template* implied_template = new RP__CauseLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__CauseLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_CauseLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RP__CauseLV_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_CauseLV");
single_value->field_rP__CauseV.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_CauseLV");
single_value->field_rP__diagnisticField.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_CauseLV");
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_CauseLV");
}

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

boolean RP__CauseLV_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__MS__SGSN::RP__ERROR__MS__SGSN()
{
}

RP__ERROR__MS__SGSN::RP__ERROR__MS__SGSN(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__MS__SGSN >& 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__MS__SGSN::RP__ERROR__MS__SGSN(const RP__ERROR__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ERROR_MS_SGSN.");
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__MS__SGSN::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__MS__SGSN::get_descriptor() const { return &RP__ERROR__MS__SGSN_descr_; }
RP__ERROR__MS__SGSN& RP__ERROR__MS__SGSN::operator=(const RP__ERROR__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const RP__ERROR__MS__SGSN& 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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::size_of() const
{
  int ret_val = 4;
  if (field_rP__User__Data.ispresent()) ret_val++;
  return ret_val;
}

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

void RP__ERROR__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_rP__User__Data().RAW_decode(RP__ERROR__User__DataTLV__MS__SGSN_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_12) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__ERROR__MS__SGSN::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__MS__SGSN_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__MS__SGSN_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_rP__MTI !=  bs_12) {
  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_12.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__MS__SGSN_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__MS__SGSN_template field_rP__User__Data;
};

void RP__ERROR__MS__SGSN_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__MS__SGSN_template::copy_value(const RP__ERROR__MS__SGSN& 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__MS__SGSN_template::copy_template(const RP__ERROR__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ERROR__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

RP__ERROR__MS__SGSN_template::RP__ERROR__MS__SGSN_template()
{
}

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

RP__ERROR__MS__SGSN_template::RP__ERROR__MS__SGSN_template(const RP__ERROR__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RP__ERROR__MS__SGSN_template::match(const RP__ERROR__MS__SGSN& 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__MS__SGSN&)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_MS_SGSN.");
}
return FALSE;
}

boolean RP__ERROR__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN RP__ERROR__MS__SGSN_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_MS_SGSN.");
RP__ERROR__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RP__ERROR__MS__SGSN_template[list_length];
}

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

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

const BITSTRING_template& RP__ERROR__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__MTI;
}

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

const BITSTRING_template& RP__ERROR__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__Spare;
}

OCTETSTRING_template& RP__ERROR__MS__SGSN_template::rP__Message__Reference()
{
set_specific();
return single_value->field_rP__Message__Reference;
}

const OCTETSTRING_template& RP__ERROR__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__Message__Reference;
}

RP__CauseLV_template& RP__ERROR__MS__SGSN_template::rP__CauseLV()
{
set_specific();
return single_value->field_rP__CauseLV;
}

const RP__CauseLV_template& RP__ERROR__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__CauseLV;
}

RP__ERROR__User__DataTLV__MS__SGSN_template& RP__ERROR__MS__SGSN_template::rP__User__Data()
{
set_specific();
return single_value->field_rP__User__Data;
}

const RP__ERROR__User__DataTLV__MS__SGSN_template& RP__ERROR__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__User__Data;
}

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

void RP__ERROR__MS__SGSN_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__MS__SGSN_template::log_match(const RP__ERROR__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void RP__ERROR__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void RP__ERROR__MS__SGSN_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_MS_SGSN");
single_value->field_rP__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN");
single_value->field_rP__Message__Reference.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN");
single_value->field_rP__CauseLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN");
single_value->field_rP__User__Data.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ERROR_MS_SGSN");
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_MS_SGSN");
}

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

boolean RP__ERROR__MS__SGSN_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__MS__SGSN::copy_value(const TPDU__RP__ERROR__MS__SGSN& other_value)
{
switch (other_value.union_selection) {
case ALT_sMS__DELIVER__REPORT:
field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ERROR(*other_value.field_sMS__DELIVER__REPORT);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean TPDU__RP__ERROR__MS__SGSN::operator==(const TPDU__RP__ERROR__MS__SGSN& 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_MS_SGSN.");
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_MS_SGSN.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
return *field_sMS__DELIVER__REPORT == *other_value.field_sMS__DELIVER__REPORT;
default:
return FALSE;
}
}

SMS__DELIVER__REPORT__in__RP__ERROR& TPDU__RP__ERROR__MS__SGSN::sMS__DELIVER__REPORT()
{
if (union_selection != ALT_sMS__DELIVER__REPORT) {
clean_up();
field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ERROR;
union_selection = ALT_sMS__DELIVER__REPORT;
}
return *field_sMS__DELIVER__REPORT;
}

const SMS__DELIVER__REPORT__in__RP__ERROR& TPDU__RP__ERROR__MS__SGSN::sMS__DELIVER__REPORT() const
{
if (union_selection != ALT_sMS__DELIVER__REPORT) TTCN_error("Using non-selected field sMS_DELIVER_REPORT in a value of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN.");
return *field_sMS__DELIVER__REPORT;
}

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

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

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

void TPDU__RP__ERROR__MS__SGSN::clean_up()
{
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
  delete field_sMS__DELIVER__REPORT;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TPDU__RP__ERROR__MS__SGSN::log() const
{
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
TTCN_Logger::log_event_str("{ sMS_DELIVER_REPORT := ");
field_sMS__DELIVER__REPORT->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

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

void TPDU__RP__ERROR__MS__SGSN::set_implicit_omit()
{
switch (union_selection) {
case ALT_sMS__DELIVER__REPORT:
field_sMS__DELIVER__REPORT->set_implicit_omit(); break;
default: break;
}
}

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

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

void TPDU__RP__ERROR__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__REPORT__in__RP__ERROR_descr_.raw->forceomit);
      decoded_length = sMS__DELIVER__REPORT().RAW_decode(SMS__DELIVER__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_3) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, SMS__DELIVER__REPORT__in__RP__ERROR_descr_.raw->forceomit);
          decoded_length = sMS__DELIVER__REPORT().RAW_decode(SMS__DELIVER__REPORT__in__RP__ERROR_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_sMS__DELIVER__REPORT).tP__MTI() ==  bs_3) {
               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__MS__SGSN::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__DELIVER__REPORT:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SMS__DELIVER__REPORT__in__RP__ERROR_descr_.raw);
    encoded_length = field_sMS__DELIVER__REPORT->RAW_encode(SMS__DELIVER__REPORT__in__RP__ERROR_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SMS__DELIVER__REPORT__in__RP__ERROR_descr_;
    if ((*field_sMS__DELIVER__REPORT).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;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TPDU__RP__ERROR__MS__SGSN_template::copy_value(const TPDU__RP__ERROR__MS__SGSN& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ERROR_template(other_value.sMS__DELIVER__REPORT());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN.");
}
set_selection(SPECIFIC_VALUE);
}

void TPDU__RP__ERROR__MS__SGSN_template::copy_template(const TPDU__RP__ERROR__MS__SGSN_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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ERROR_template(*other_value.single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new TPDU__RP__ERROR__MS__SGSN_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_MS_SGSN.");
}
set_selection(other_value);
}

TPDU__RP__ERROR__MS__SGSN_template::TPDU__RP__ERROR__MS__SGSN_template()
{
}

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

TPDU__RP__ERROR__MS__SGSN_template::TPDU__RP__ERROR__MS__SGSN_template(const TPDU__RP__ERROR__MS__SGSN& other_value)
{
copy_value(other_value);
}

TPDU__RP__ERROR__MS__SGSN_template::TPDU__RP__ERROR__MS__SGSN_template(const OPTIONAL<TPDU__RP__ERROR__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TPDU__RP__ERROR__MS__SGSN&)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_MS_SGSN from an unbound optional field.");
}
}

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

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

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

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

void TPDU__RP__ERROR__MS__SGSN_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
delete single_value.field_sMS__DELIVER__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__MS__SGSN_template& TPDU__RP__ERROR__MS__SGSN_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

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

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

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

boolean TPDU__RP__ERROR__MS__SGSN_template::match(const TPDU__RP__ERROR__MS__SGSN& 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__MS__SGSN::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TPDU__RP__ERROR__MS__SGSN::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
return single_value.field_sMS__DELIVER__REPORT->match(other_value.sMS__DELIVER__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_MS_SGSN.");
}
}
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_MS_SGSN.");
}
return FALSE;
}

boolean TPDU__RP__ERROR__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
return single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
}

TPDU__RP__ERROR__MS__SGSN TPDU__RP__ERROR__MS__SGSN_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_MS_SGSN.");
TPDU__RP__ERROR__MS__SGSN ret_val;
switch (single_value.union_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
ret_val.sMS__DELIVER__REPORT() = single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
return ret_val;
}

TPDU__RP__ERROR__MS__SGSN_template& TPDU__RP__ERROR__MS__SGSN_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_MS_SGSN.");
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_MS_SGSN.");
return value_list.list_value[list_index];
}
void TPDU__RP__ERROR__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TPDU__RP__ERROR__MS__SGSN_template[list_length];
}

SMS__DELIVER__REPORT__in__RP__ERROR_template& TPDU__RP__ERROR__MS__SGSN_template::sMS__DELIVER__REPORT()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ERROR_template(ANY_VALUE);
else single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ERROR_template;
single_value.union_selection = TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sMS__DELIVER__REPORT;
}

const SMS__DELIVER__REPORT__in__RP__ERROR_template& TPDU__RP__ERROR__MS__SGSN_template::sMS__DELIVER__REPORT() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sMS_DELIVER_REPORT in a non-specific template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN.");
if (single_value.union_selection != TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT) TTCN_error("Accessing non-selected field sMS_DELIVER_REPORT in a template of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN.");
return *single_value.field_sMS__DELIVER__REPORT;
}

boolean TPDU__RP__ERROR__MS__SGSN_template::ischosen(TPDU__RP__ERROR__MS__SGSN::union_selection_type checked_selection) const
{
if (checked_selection == TPDU__RP__ERROR__MS__SGSN::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TPDU__RP__ERROR__MS__SGSN::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_MS_SGSN.");
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_MS_SGSN 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__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
TTCN_Logger::log_event_str("{ sMS_DELIVER_REPORT := ");
single_value.field_sMS__DELIVER__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__MS__SGSN_template::log_match(const TPDU__RP__ERROR__MS__SGSN& 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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sMS_DELIVER_REPORT");
single_value.field_sMS__DELIVER__REPORT->log_match(match_value.sMS__DELIVER__REPORT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sMS_DELIVER_REPORT := ");
single_value.field_sMS__DELIVER__REPORT->log_match(match_value.sMS__DELIVER__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__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT->set_implicit_omit(); break;
default: break;
}
}

void TPDU__RP__ERROR__MS__SGSN_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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
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_MS_SGSN.");
}
}

void TPDU__RP__ERROR__MS__SGSN_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__MS__SGSN::UNBOUND_VALUE;
TPDU__RP__ERROR__MS__SGSN::union_selection_type new_selection = (TPDU__RP__ERROR__MS__SGSN::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TPDU__RP__ERROR__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT = new SMS__DELIVER__REPORT__in__RP__ERROR_template;
single_value.field_sMS__DELIVER__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_MS_SGSN.");
}
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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

boolean TPDU__RP__ERROR__MS__SGSN_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__MS__SGSN_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_MS_SGSN'");
    }
    if (strcmp("sMS_DELIVER_REPORT", param_field) == 0) {
      sMS__DELIVER__REPORT().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN'", 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__MS__SGSN_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_MS_SGSN");
    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_REPORT")) {
      sMS__DELIVER__REPORT().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TPDU__RP__ERROR__MS__SGSN_template* precondition = new TPDU__RP__ERROR__MS__SGSN_template;
    precondition->set_param(*m_p->get_elem(0));
    TPDU__RP__ERROR__MS__SGSN_template* implied_template = new TPDU__RP__ERROR__MS__SGSN_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TPDU__RP__ERROR__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void TPDU__RP__ERROR__MS__SGSN_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__MS__SGSN::ALT_sMS__DELIVER__REPORT:
single_value.field_sMS__DELIVER__REPORT->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.TPDU_RP_ERROR_MS_SGSN");
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_MS_SGSN.");
}
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_MS_SGSN");
}

SMS__DELIVER__REPORT__in__RP__ERROR::SMS__DELIVER__REPORT__in__RP__ERROR()
{
}

SMS__DELIVER__REPORT__in__RP__ERROR::SMS__DELIVER__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 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__PID(par_tP__PID),
  field_tP__DCS(par_tP__DCS),
  field_tP__UDL__UD(par_tP__UDL__UD)
{
}

SMS__DELIVER__REPORT__in__RP__ERROR::SMS__DELIVER__REPORT__in__RP__ERROR(const SMS__DELIVER__REPORT__in__RP__ERROR& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.SMS_DELIVER_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__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__DELIVER__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__PID.clean_up();
field_tP__DCS.clean_up();
field_tP__UDL__UD.clean_up();
}

const TTCN_Typedescriptor_t* SMS__DELIVER__REPORT__in__RP__ERROR::get_descriptor() const { return &SMS__DELIVER__REPORT__in__RP__ERROR_descr_; }
SMS__DELIVER__REPORT__in__RP__ERROR& SMS__DELIVER__REPORT__in__RP__ERROR::operator=(const SMS__DELIVER__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_DELIVER_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__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__DELIVER__REPORT__in__RP__ERROR::operator==(const SMS__DELIVER__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__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__DELIVER__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())
  || (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__DELIVER__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()
  && (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__DELIVER__REPORT__in__RP__ERROR::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__DELIVER__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_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__DELIVER__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__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__DELIVER__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 (13<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR 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__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__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_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_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_DELIVER_REPORT_in_RP_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
  }
}

void SMS__DELIVER__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__PID.encode_text(text_buf);
field_tP__DCS.encode_text(text_buf);
field_tP__UDL__UD.encode_text(text_buf);
}

void SMS__DELIVER__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__PID.decode_text(text_buf);
field_tP__DCS.decode_text(text_buf);
field_tP__UDL__UD.decode_text(text_buf);
}

void SMS__DELIVER__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__DELIVER__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__DELIVER__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());
  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__DELIVER__REPORT__in__RP__ERROR_tP__PID_descr_.raw->forceomit);
  decoded_field_length = field_tP__PID().RAW_decode(SMS__DELIVER__REPORT__in__RP__ERROR_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__DELIVER__REPORT__in__RP__ERROR_tP__DCS_descr_.raw->forceomit);
  decoded_field_length = field_tP__DCS().RAW_decode(SMS__DELIVER__REPORT__in__RP__ERROR_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__DELIVER__REPORT__in__RP__ERROR_tP__UDL__UD_descr_.raw->forceomit);
  decoded_field_length = field_tP__UDL__UD().RAW_decode(SMS__DELIVER__REPORT__in__RP__ERROR_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_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__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 = 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::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);
  if (field_tP__PID.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, SMS__DELIVER__REPORT__in__RP__ERROR_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__DELIVER__REPORT__in__RP__ERROR_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__DELIVER__REPORT__in__RP__ERROR_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__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]);
  if (field_tP__PID.ispresent()) {
  encoded_length += field_tP__PID().RAW_encode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__PID_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_tP__DCS.ispresent()) {
  encoded_length += field_tP__DCS().RAW_encode(SMS__DELIVER__REPORT__in__RP__ERROR_tP__DCS_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_tP__UDL__UD.ispresent()) {
  encoded_length += field_tP__UDL__UD().RAW_encode(SMS__DELIVER__REPORT__in__RP__ERROR_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[]={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_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__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__PID;
OCTETSTRING_template field_tP__DCS;
TP__UDL__UD_template field_tP__UDL__UD;
};

void SMS__DELIVER__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__PID = ANY_OR_OMIT;
single_value->field_tP__DCS = ANY_OR_OMIT;
single_value->field_tP__UDL__UD = ANY_OR_OMIT;
}
}
}

void SMS__DELIVER__REPORT__in__RP__ERROR_template::copy_value(const SMS__DELIVER__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__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__DELIVER__REPORT__in__RP__ERROR_template::copy_template(const SMS__DELIVER__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__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__DELIVER__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__DELIVER__REPORT__in__RP__ERROR_template(*other_value.implication_.precondition);
implication_.implied_template = new SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
break;
}
set_selection(other_value);
}

SMS__DELIVER__REPORT__in__RP__ERROR_template::SMS__DELIVER__REPORT__in__RP__ERROR_template()
{
}

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

SMS__DELIVER__REPORT__in__RP__ERROR_template::SMS__DELIVER__REPORT__in__RP__ERROR_template(const SMS__DELIVER__REPORT__in__RP__ERROR& other_value)
{
copy_value(other_value);
}

SMS__DELIVER__REPORT__in__RP__ERROR_template::SMS__DELIVER__REPORT__in__RP__ERROR_template(const OPTIONAL<SMS__DELIVER__REPORT__in__RP__ERROR>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean SMS__DELIVER__REPORT__in__RP__ERROR_template::match(const SMS__DELIVER__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__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_DELIVER_REPORT_in_RP_ERROR.");
}
return FALSE;
}

boolean SMS__DELIVER__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__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__DELIVER__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__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__DELIVER__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__DELIVER__REPORT__in__RP__ERROR SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
SMS__DELIVER__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__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__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SMS__DELIVER__REPORT__in__RP__ERROR_template[list_length];
}

SMS__DELIVER__REPORT__in__RP__ERROR_template& SMS__DELIVER__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_DELIVER_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_DELIVER_REPORT_in_RP_ERROR.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__MTI;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__Spare1;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__UDHI;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__Spare2;
}

OCTETSTRING_template& SMS__DELIVER__REPORT__in__RP__ERROR_template::tP__FCS()
{
set_specific();
return single_value->field_tP__FCS;
}

const OCTETSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__FCS;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__PresenceBitTP__PID;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__PresenceBitTP__DCS;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__PresenceBitTP__UDL;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__Reserved;
}

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

const BITSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__ExtensionBit;
}

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

const OCTETSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__PID;
}

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

const OCTETSTRING_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__DCS;
}

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

const TP__UDL__UD_template& SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
return single_value->field_tP__UDL__UD;
}

int SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR 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_DELIVER_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_DELIVER_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_DELIVER_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_DELIVER_REPORT_in_RP_ERROR containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_SMS_Types.SMS_DELIVER_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_DELIVER_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_DELIVER_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_DELIVER_REPORT_in_RP_ERROR.");
  }
  return 0;
}

void SMS__DELIVER__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_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__DELIVER__REPORT__in__RP__ERROR_template::log_match(const SMS__DELIVER__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 (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_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__DELIVER__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__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__DELIVER__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__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_DELIVER_REPORT_in_RP_ERROR.");
}
}

void SMS__DELIVER__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__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__DELIVER__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_DELIVER_REPORT_in_RP_ERROR.");
}
}

void SMS__DELIVER__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__DELIVER__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 (13<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR 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__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__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_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_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_DELIVER_REPORT_in_RP_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SMS__DELIVER__REPORT__in__RP__ERROR_template* precondition = new SMS__DELIVER__REPORT__in__RP__ERROR_template;
    precondition->set_param(*param.get_elem(0));
    SMS__DELIVER__REPORT__in__RP__ERROR_template* implied_template = new SMS__DELIVER__REPORT__in__RP__ERROR_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SMS__DELIVER__REPORT__in__RP__ERROR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
  }
  is_ifpresent = param.get_ifpresent();
}

void SMS__DELIVER__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_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__Spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__UDHI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__Spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__FCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__PresenceBitTP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__PresenceBitTP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__PresenceBitTP__UDL.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__Reserved.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__ExtensionBit.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__PID.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__DCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_REPORT_in_RP_ERROR");
single_value->field_tP__UDL__UD.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.SMS_DELIVER_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_DELIVER_REPORT_in_RP_ERROR");
}

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

boolean SMS__DELIVER__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__MS__SGSN::RP__ERROR__User__DataTLV__MS__SGSN()
{
}

RP__ERROR__User__DataTLV__MS__SGSN::RP__ERROR__User__DataTLV__MS__SGSN(const BITSTRING& par_rP__Spare,
    const BITSTRING& par_rP__UserDataIEI,
    const INTEGER& par_rP__LengthIndicator,
    const TPDU__RP__ERROR__MS__SGSN& 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__MS__SGSN::RP__ERROR__User__DataTLV__MS__SGSN(const RP__ERROR__User__DataTLV__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN.");
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__MS__SGSN::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__MS__SGSN::get_descriptor() const { return &RP__ERROR__User__DataTLV__MS__SGSN_descr_; }
RP__ERROR__User__DataTLV__MS__SGSN& RP__ERROR__User__DataTLV__MS__SGSN::operator=(const RP__ERROR__User__DataTLV__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const RP__ERROR__User__DataTLV__MS__SGSN& 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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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_MS_SGSN 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_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN");
  }
}

void RP__ERROR__User__DataTLV__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_rP__Spare_descr_.raw->forceomit);
  decoded_field_length = field_rP__Spare.RAW_decode(RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_rP__UserDataIEI_descr_.raw->forceomit);
  decoded_field_length = field_rP__UserDataIEI.RAW_decode(RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_rP__LengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_rP__LengthIndicator.RAW_decode(RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_rP__TPDU.RAW_decode(TPDU__RP__ERROR__MS__SGSN_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__MS__SGSN::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__MS__SGSN_rP__Spare_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RP__ERROR__User__DataTLV__MS__SGSN_rP__UserDataIEI_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RP__ERROR__User__DataTLV__MS__SGSN_rP__LengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TPDU__RP__ERROR__MS__SGSN_descr_.raw);
  encoded_length += field_rP__Spare.RAW_encode(RP__ERROR__User__DataTLV__MS__SGSN_rP__Spare_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rP__UserDataIEI.RAW_encode(RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN_template::single_value_struct {
BITSTRING_template field_rP__Spare;
BITSTRING_template field_rP__UserDataIEI;
INTEGER_template field_rP__LengthIndicator;
TPDU__RP__ERROR__MS__SGSN_template field_rP__TPDU;
};

void RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_template::copy_value(const RP__ERROR__User__DataTLV__MS__SGSN& 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__MS__SGSN_template::copy_template(const RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

RP__ERROR__User__DataTLV__MS__SGSN_template::RP__ERROR__User__DataTLV__MS__SGSN_template()
{
}

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

RP__ERROR__User__DataTLV__MS__SGSN_template::RP__ERROR__User__DataTLV__MS__SGSN_template(const RP__ERROR__User__DataTLV__MS__SGSN& other_value)
{
copy_value(other_value);
}

RP__ERROR__User__DataTLV__MS__SGSN_template::RP__ERROR__User__DataTLV__MS__SGSN_template(const OPTIONAL<RP__ERROR__User__DataTLV__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RP__ERROR__User__DataTLV__MS__SGSN&)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_MS_SGSN from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

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

boolean RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN.");
RP__ERROR__User__DataTLV__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RP__ERROR__User__DataTLV__MS__SGSN_template[list_length];
}

RP__ERROR__User__DataTLV__MS__SGSN_template& RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN.");
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_MS_SGSN.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__Spare;
}

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

const BITSTRING_template& RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__UserDataIEI;
}

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

const INTEGER_template& RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__LengthIndicator;
}

TPDU__RP__ERROR__MS__SGSN_template& RP__ERROR__User__DataTLV__MS__SGSN_template::rP__TPDU()
{
set_specific();
return single_value->field_rP__TPDU;
}

const TPDU__RP__ERROR__MS__SGSN_template& RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_rP__TPDU;
}

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

void RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_template::log_match(const RP__ERROR__User__DataTLV__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void RP__ERROR__User__DataTLV__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void RP__ERROR__User__DataTLV__MS__SGSN_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_MS_SGSN");
single_value->field_rP__UserDataIEI.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN");
single_value->field_rP__LengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN");
single_value->field_rP__TPDU.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_ERROR_User_DataTLV_MS_SGSN");
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_MS_SGSN");
}

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

boolean RP__ERROR__User__DataTLV__MS__SGSN_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__SMMA::RP__SMMA()
{
}

RP__SMMA::RP__SMMA(const BITSTRING& par_rP__MTI,
    const BITSTRING& par_rP__Spare,
    const OCTETSTRING& par_rP__MessageReference)
  :   field_rP__MTI(par_rP__MTI),
  field_rP__Spare(par_rP__Spare),
  field_rP__MessageReference(par_rP__MessageReference)
{
}

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

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

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

boolean RP__SMMA::operator==(const RP__SMMA& 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;
}

boolean RP__SMMA::is_bound() const
{
return (field_rP__MTI.is_bound())
  || (field_rP__Spare.is_bound())
  || (field_rP__MessageReference.is_bound());
}
boolean RP__SMMA::is_value() const
{
return field_rP__MTI.is_value()
  && field_rP__Spare.is_value()
  && field_rP__MessageReference.is_value();
}
void RP__SMMA::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(" }");
}

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

void RP__SMMA::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.RP_SMMA has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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++) 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_SMMA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.RP_SMMA");
  }
}

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

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

void RP__SMMA::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__SMMA::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__SMMA::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 (field_rP__MTI !=  bs_9) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RP__SMMA::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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);
  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__MTI !=  bs_9) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   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);
  }
  }
  return myleaf.length = encoded_length;
}

struct RP__SMMA_template::single_value_struct {
BITSTRING_template field_rP__MTI;
BITSTRING_template field_rP__Spare;
OCTETSTRING_template field_rP__MessageReference;
};

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

void RP__SMMA_template::copy_value(const RP__SMMA& 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();
}
set_selection(SPECIFIC_VALUE);
}

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

RP__SMMA_template::RP__SMMA_template()
{
}

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

RP__SMMA_template::RP__SMMA_template(const RP__SMMA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean RP__SMMA_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();
}

boolean RP__SMMA_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();
}

void RP__SMMA_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__SMMA RP__SMMA_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_SMMA.");
RP__SMMA 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();
}
return ret_val;
}

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

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

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

const BITSTRING_template& RP__SMMA_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_SMMA.");
return single_value->field_rP__MTI;
}

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

const BITSTRING_template& RP__SMMA_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_SMMA.");
return single_value->field_rP__Spare;
}

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

const OCTETSTRING_template& RP__SMMA_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_SMMA.");
return single_value->field_rP__MessageReference;
}

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

void RP__SMMA_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(" }");
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__SMMA_template::log_match(const RP__SMMA& 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);
}
}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(" }");
} 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__SMMA_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();
}

void RP__SMMA_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);
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_SMMA.");
}
}

void RP__SMMA_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);
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__SMMA_template[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_SMMA.");
}
}

void RP__SMMA_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__SMMA_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.RP_SMMA has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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++) 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_SMMA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RP__SMMA_template* precondition = new RP__SMMA_template;
    precondition->set_param(*param.get_elem(0));
    RP__SMMA_template* implied_template = new RP__SMMA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RP__SMMA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.RP_SMMA");
  }
  is_ifpresent = param.get_ifpresent();
}

void RP__SMMA_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_SMMA");
single_value->field_rP__Spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_SMMA");
single_value->field_rP__MessageReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.RP_SMMA");
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_SMMA");
}

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

boolean RP__SMMA_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__MS__SGSN::CP__User__DataLV__MS__SGSN()
{
}

CP__User__DataLV__MS__SGSN::CP__User__DataLV__MS__SGSN(const INTEGER& par_lengthIndicator,
    const RPDU__MS__SGSN& par_cP__RPDU)
  :   field_lengthIndicator(par_lengthIndicator),
  field_cP__RPDU(par_cP__RPDU)
{
}

CP__User__DataLV__MS__SGSN::CP__User__DataLV__MS__SGSN(const CP__User__DataLV__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.CP_User_DataLV_MS_SGSN.");
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__MS__SGSN::clean_up()
{
field_lengthIndicator.clean_up();
field_cP__RPDU.clean_up();
}

const TTCN_Typedescriptor_t* CP__User__DataLV__MS__SGSN::get_descriptor() const { return &CP__User__DataLV__MS__SGSN_descr_; }
CP__User__DataLV__MS__SGSN& CP__User__DataLV__MS__SGSN::operator=(const CP__User__DataLV__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const CP__User__DataLV__MS__SGSN& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_cP__RPDU==other_value.field_cP__RPDU;
}

boolean CP__User__DataLV__MS__SGSN::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_cP__RPDU.is_bound());
}
boolean CP__User__DataLV__MS__SGSN::is_value() const
{
return field_lengthIndicator.is_value()
  && field_cP__RPDU.is_value();
}
void CP__User__DataLV__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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_MS_SGSN 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_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.CP_User_DataLV_MS_SGSN");
  }
}

void CP__User__DataLV__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_cP__RPDU.encode_text(text_buf);
}

void CP__User__DataLV__MS__SGSN::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_cP__RPDU.decode_text(text_buf);
}

void CP__User__DataLV__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(CP__User__DataLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_cP__RPDU.RAW_decode(RPDU__MS__SGSN_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__MS__SGSN::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__MS__SGSN_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RPDU__MS__SGSN_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &CP__User__DataLV__MS__SGSN_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__MS__SGSN_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct CP__User__DataLV__MS__SGSN_template::single_value_struct {
INTEGER_template field_lengthIndicator;
RPDU__MS__SGSN_template field_cP__RPDU;
};

void CP__User__DataLV__MS__SGSN_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__MS__SGSN_template::copy_value(const CP__User__DataLV__MS__SGSN& 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__MS__SGSN_template::copy_template(const CP__User__DataLV__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new CP__User__DataLV__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

CP__User__DataLV__MS__SGSN_template::CP__User__DataLV__MS__SGSN_template()
{
}

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

CP__User__DataLV__MS__SGSN_template::CP__User__DataLV__MS__SGSN_template(const CP__User__DataLV__MS__SGSN& other_value)
{
copy_value(other_value);
}

CP__User__DataLV__MS__SGSN_template::CP__User__DataLV__MS__SGSN_template(const OPTIONAL<CP__User__DataLV__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CP__User__DataLV__MS__SGSN&)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_MS_SGSN from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

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

boolean CP__User__DataLV__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN CP__User__DataLV__MS__SGSN_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_MS_SGSN.");
CP__User__DataLV__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CP__User__DataLV__MS__SGSN_template[list_length];
}

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

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

const INTEGER_template& CP__User__DataLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_lengthIndicator;
}

RPDU__MS__SGSN_template& CP__User__DataLV__MS__SGSN_template::cP__RPDU()
{
set_specific();
return single_value->field_cP__RPDU;
}

const RPDU__MS__SGSN_template& CP__User__DataLV__MS__SGSN_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_MS_SGSN.");
return single_value->field_cP__RPDU;
}

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

void CP__User__DataLV__MS__SGSN_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__MS__SGSN_template::log_match(const CP__User__DataLV__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void CP__User__DataLV__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void CP__User__DataLV__MS__SGSN_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_MS_SGSN");
single_value->field_cP__RPDU.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.CP_User_DataLV_MS_SGSN");
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_MS_SGSN");
}

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

boolean CP__User__DataLV__MS__SGSN_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__MS__SGSN::CP__DATA__MS__SGSN()
{
}

CP__DATA__MS__SGSN::CP__DATA__MS__SGSN(const BITSTRING& par_cP__messageType,
    const CP__User__DataLV__MS__SGSN& par_cP__User__Data)
  :   field_cP__messageType(par_cP__messageType),
  field_cP__User__Data(par_cP__User__Data)
{
}

CP__DATA__MS__SGSN::CP__DATA__MS__SGSN(const CP__DATA__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.CP_DATA_MS_SGSN.");
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__MS__SGSN::clean_up()
{
field_cP__messageType.clean_up();
field_cP__User__Data.clean_up();
}

const TTCN_Typedescriptor_t* CP__DATA__MS__SGSN::get_descriptor() const { return &CP__DATA__MS__SGSN_descr_; }
CP__DATA__MS__SGSN& CP__DATA__MS__SGSN::operator=(const CP__DATA__MS__SGSN& 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_MS_SGSN.");
  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__MS__SGSN::operator==(const CP__DATA__MS__SGSN& 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__MS__SGSN::is_bound() const
{
return (field_cP__messageType.is_bound())
  || (field_cP__User__Data.is_bound());
}
boolean CP__DATA__MS__SGSN::is_value() const
{
return field_cP__messageType.is_value()
  && field_cP__User__Data.is_value();
}
void CP__DATA__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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_MS_SGSN 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_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.CP_DATA_MS_SGSN");
  }
}

void CP__DATA__MS__SGSN::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__MS__SGSN::decode_text(Text_Buf& text_buf)
{
field_cP__messageType.decode_text(text_buf);
field_cP__User__Data.decode_text(text_buf);
}

void CP__DATA__MS__SGSN::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__MS__SGSN::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__MS__SGSN::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__MS__SGSN_descr_.raw->forceomit);
  decoded_field_length = field_cP__User__Data.RAW_decode(CP__User__DataLV__MS__SGSN_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__MS__SGSN::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__MS__SGSN_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__MS__SGSN_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__MS__SGSN_template::single_value_struct {
BITSTRING_template field_cP__messageType;
CP__User__DataLV__MS__SGSN_template field_cP__User__Data;
};

void CP__DATA__MS__SGSN_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__MS__SGSN_template::copy_value(const CP__DATA__MS__SGSN& 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__MS__SGSN_template::copy_template(const CP__DATA__MS__SGSN_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__MS__SGSN_template[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__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new CP__DATA__MS__SGSN_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_MS_SGSN.");
break;
}
set_selection(other_value);
}

CP__DATA__MS__SGSN_template::CP__DATA__MS__SGSN_template()
{
}

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

CP__DATA__MS__SGSN_template::CP__DATA__MS__SGSN_template(const CP__DATA__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean CP__DATA__MS__SGSN_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__MS__SGSN_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__MS__SGSN_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__MS__SGSN CP__DATA__MS__SGSN_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_MS_SGSN.");
CP__DATA__MS__SGSN 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__MS__SGSN_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_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CP__DATA__MS__SGSN_template[list_length];
}

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

BITSTRING_template& CP__DATA__MS__SGSN_template::cP__messageType()
{
set_specific();
return single_value->field_cP__messageType;
}

const BITSTRING_template& CP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_cP__messageType;
}

CP__User__DataLV__MS__SGSN_template& CP__DATA__MS__SGSN_template::cP__User__Data()
{
set_specific();
return single_value->field_cP__User__Data;
}

const CP__User__DataLV__MS__SGSN_template& CP__DATA__MS__SGSN_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_MS_SGSN.");
return single_value->field_cP__User__Data;
}

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

void CP__DATA__MS__SGSN_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__MS__SGSN_template::log_match(const CP__DATA__MS__SGSN& 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__MS__SGSN_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__MS__SGSN_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_MS_SGSN.");
}
}

void CP__DATA__MS__SGSN_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__MS__SGSN_template[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_MS_SGSN.");
}
}

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

void CP__DATA__MS__SGSN_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_MS_SGSN");
single_value->field_cP__User__Data.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.CP_DATA_MS_SGSN");
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_MS_SGSN");
}

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

boolean CP__DATA__MS__SGSN_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__ACK::CP__ACK()
{
}

CP__ACK::CP__ACK(const BITSTRING& par_cP__messageType)
  :   field_cP__messageType(par_cP__messageType)
{
}

CP__ACK::CP__ACK(const CP__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.CP_ACK.");
if (other_value.cP__messageType().is_bound()) field_cP__messageType = other_value.cP__messageType();
else field_cP__messageType.clean_up();
}

void CP__ACK::clean_up()
{
field_cP__messageType.clean_up();
}

const TTCN_Typedescriptor_t* CP__ACK::get_descriptor() const { return &CP__ACK_descr_; }
CP__ACK& CP__ACK::operator=(const CP__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.CP_ACK.");
  if (other_value.cP__messageType().is_bound()) field_cP__messageType = other_value.cP__messageType();
  else field_cP__messageType.clean_up();
}
return *this;
}

boolean CP__ACK::operator==(const CP__ACK& other_value) const
{
return field_cP__messageType==other_value.field_cP__messageType;
}

boolean CP__ACK::is_bound() const
{
return (field_cP__messageType.is_bound());
}
boolean CP__ACK::is_value() const
{
return field_cP__messageType.is_value();
}
void CP__ACK::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(" }");
}

void CP__ACK::set_implicit_omit()
{
if (cP__messageType().is_bound()) cP__messageType().set_implicit_omit();
}

void CP__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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.CP_ACK 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) cP__messageType().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(), "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++) 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_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.CP_ACK");
  }
}

void CP__ACK::encode_text(Text_Buf& text_buf) const
{
field_cP__messageType.encode_text(text_buf);
}

void CP__ACK::decode_text(Text_Buf& text_buf)
{
field_cP__messageType.decode_text(text_buf);
}

void CP__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 CP__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 CP__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::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());
  if (field_cP__messageType !=  bs_14) 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__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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  encoded_length += field_cP__messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_cP__messageType !=  bs_14) {
  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_14.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__ACK_template::single_value_struct {
BITSTRING_template field_cP__messageType;
};

void CP__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_cP__messageType = ANY_VALUE;
}
}
}

void CP__ACK_template::copy_value(const CP__ACK& 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();
}
set_selection(SPECIFIC_VALUE);
}

void CP__ACK_template::copy_template(const CP__ACK_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();
}
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__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 CP__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new CP__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.CP_ACK.");
break;
}
set_selection(other_value);
}

CP__ACK_template::CP__ACK_template()
{
}

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

CP__ACK_template::CP__ACK_template(const CP__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CP__ACK_template::match(const CP__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.cP__messageType().is_bound()) return FALSE;
if(!single_value->field_cP__messageType.match(other_value.cP__messageType(), 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_ACK.");
}
return FALSE;
}

boolean CP__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_cP__messageType.is_bound();
}

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

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

CP__ACK CP__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.CP_ACK.");
CP__ACK ret_val;
if (single_value->field_cP__messageType.is_bound()) {
ret_val.cP__messageType() = single_value->field_cP__messageType.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& CP__ACK_template::cP__messageType()
{
set_specific();
return single_value->field_cP__messageType;
}

const BITSTRING_template& CP__ACK_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_ACK.");
return single_value->field_cP__messageType;
}

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

void CP__ACK_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(" }");
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__ACK_template::log_match(const CP__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_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);
}
}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(" }");
} 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__ACK_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cP__messageType().is_bound()) cP__messageType().set_implicit_omit();
}

void CP__ACK_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);
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_ACK.");
}
}

void CP__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_cP__messageType.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__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.CP_ACK.");
}
}

void CP__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: {
    CP__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 (1<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.CP_ACK 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) cP__messageType().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(), "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++) 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_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CP__ACK_template* precondition = new CP__ACK_template;
    precondition->set_param(*param.get_elem(0));
    CP__ACK_template* implied_template = new CP__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CP__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.CP_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void CP__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_cP__messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.CP_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.CP_ACK");
}

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

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

CP__CauseV::CP__CauseV()
{
}

CP__CauseV::CP__CauseV(const OCTETSTRING& par_causeValue)
  :   field_causeValue(par_causeValue)
{
}

CP__CauseV::CP__CauseV(const CP__CauseV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.CP_CauseV.");
if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
else field_causeValue.clean_up();
}

void CP__CauseV::clean_up()
{
field_causeValue.clean_up();
}

const TTCN_Typedescriptor_t* CP__CauseV::get_descriptor() const { return &CP__CauseV_descr_; }
CP__CauseV& CP__CauseV::operator=(const CP__CauseV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.CP_CauseV.");
  if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
  else field_causeValue.clean_up();
}
return *this;
}

boolean CP__CauseV::operator==(const CP__CauseV& other_value) const
{
return field_causeValue==other_value.field_causeValue;
}

boolean CP__CauseV::is_bound() const
{
return (field_causeValue.is_bound());
}
boolean CP__CauseV::is_value() const
{
return field_causeValue.is_value();
}
void CP__CauseV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ causeValue := ");
field_causeValue.log();
TTCN_Logger::log_event_str(" }");
}

void CP__CauseV::set_implicit_omit()
{
if (causeValue().is_bound()) causeValue().set_implicit_omit();
}

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

void CP__CauseV::encode_text(Text_Buf& text_buf) const
{
field_causeValue.encode_text(text_buf);
}

void CP__CauseV::decode_text(Text_Buf& text_buf)
{
field_causeValue.decode_text(text_buf);
}

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

int CP__CauseV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  encoded_length += field_causeValue.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct CP__CauseV_template::single_value_struct {
OCTETSTRING_template field_causeValue;
};

void CP__CauseV_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_causeValue = ANY_VALUE;
}
}
}

void CP__CauseV_template::copy_value(const CP__CauseV& other_value)
{
single_value = new single_value_struct;
if (other_value.causeValue().is_bound()) {
  single_value->field_causeValue = other_value.causeValue();
} else {
  single_value->field_causeValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CP__CauseV_template::copy_template(const CP__CauseV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.causeValue().get_selection()) {
single_value->field_causeValue = other_value.causeValue();
} else {
single_value->field_causeValue.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__CauseV_template[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__CauseV_template(*other_value.implication_.precondition);
implication_.implied_template = new CP__CauseV_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_CauseV.");
break;
}
set_selection(other_value);
}

CP__CauseV_template::CP__CauseV_template()
{
}

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

CP__CauseV_template::CP__CauseV_template(const CP__CauseV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CP__CauseV_template::match(const CP__CauseV& 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.causeValue().is_bound()) return FALSE;
if(!single_value->field_causeValue.match(other_value.causeValue(), 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_CauseV.");
}
return FALSE;
}

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

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

void CP__CauseV_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__CauseV CP__CauseV_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_CauseV.");
CP__CauseV ret_val;
if (single_value->field_causeValue.is_bound()) {
ret_val.causeValue() = single_value->field_causeValue.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& CP__CauseV_template::causeValue()
{
set_specific();
return single_value->field_causeValue;
}

const OCTETSTRING_template& CP__CauseV_template::causeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeValue of a non-specific template of type @MobileL3_SMS_Types.CP_CauseV.");
return single_value->field_causeValue;
}

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

void CP__CauseV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ causeValue := ");
single_value->field_causeValue.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__CauseV_template::log_match(const CP__CauseV& 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_causeValue.match(match_value.causeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".causeValue");
single_value->field_causeValue.log_match(match_value.causeValue(), 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("{ causeValue := ");
single_value->field_causeValue.log_match(match_value.causeValue(), 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__CauseV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (causeValue().is_bound()) causeValue().set_implicit_omit();
}

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

void CP__CauseV_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_causeValue.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__CauseV_template[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_CauseV.");
}
}

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

void CP__CauseV_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_causeValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.CP_CauseV");
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_CauseV");
}

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

boolean CP__CauseV_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__ERROR::CP__ERROR()
{
}

CP__ERROR::CP__ERROR(const BITSTRING& par_cP__messageType,
    const CP__CauseV& par_cP__Cause)
  :   field_cP__messageType(par_cP__messageType),
  field_cP__Cause(par_cP__Cause)
{
}

CP__ERROR::CP__ERROR(const CP__ERROR& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_SMS_Types.CP_ERROR.");
if (other_value.cP__messageType().is_bound()) field_cP__messageType = other_value.cP__messageType();
else field_cP__messageType.clean_up();
if (other_value.cP__Cause().is_bound()) field_cP__Cause = other_value.cP__Cause();
else field_cP__Cause.clean_up();
}

void CP__ERROR::clean_up()
{
field_cP__messageType.clean_up();
field_cP__Cause.clean_up();
}

const TTCN_Typedescriptor_t* CP__ERROR::get_descriptor() const { return &CP__ERROR_descr_; }
CP__ERROR& CP__ERROR::operator=(const CP__ERROR& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_SMS_Types.CP_ERROR.");
  if (other_value.cP__messageType().is_bound()) field_cP__messageType = other_value.cP__messageType();
  else field_cP__messageType.clean_up();
  if (other_value.cP__Cause().is_bound()) field_cP__Cause = other_value.cP__Cause();
  else field_cP__Cause.clean_up();
}
return *this;
}

boolean CP__ERROR::operator==(const CP__ERROR& other_value) const
{
return field_cP__messageType==other_value.field_cP__messageType
  && field_cP__Cause==other_value.field_cP__Cause;
}

boolean CP__ERROR::is_bound() const
{
return (field_cP__messageType.is_bound())
  || (field_cP__Cause.is_bound());
}
boolean CP__ERROR::is_value() const
{
return field_cP__messageType.is_value()
  && field_cP__Cause.is_value();
}
void CP__ERROR::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_Cause := ");
field_cP__Cause.log();
TTCN_Logger::log_event_str(" }");
}

void CP__ERROR::set_implicit_omit()
{
if (cP__messageType().is_bound()) cP__messageType().set_implicit_omit();
if (cP__Cause().is_bound()) cP__Cause().set_implicit_omit();
}

void CP__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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_SMS_Types.CP_ERROR 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__Cause().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_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cP__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.CP_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_SMS_Types.CP_ERROR");
  }
}

void CP__ERROR::encode_text(Text_Buf& text_buf) const
{
field_cP__messageType.encode_text(text_buf);
field_cP__Cause.encode_text(text_buf);
}

void CP__ERROR::decode_text(Text_Buf& text_buf)
{
field_cP__messageType.decode_text(text_buf);
field_cP__Cause.decode_text(text_buf);
}

void CP__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 CP__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 CP__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::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__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_cP__Cause.RAW_decode(CP__CauseV_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_15) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CP__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 = 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__CauseV_descr_.raw);
  encoded_length += field_cP__messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cP__Cause.RAW_encode(CP__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_cP__messageType !=  bs_15) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_15.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__ERROR_template::single_value_struct {
BITSTRING_template field_cP__messageType;
CP__CauseV_template field_cP__Cause;
};

void CP__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_cP__messageType = ANY_VALUE;
single_value->field_cP__Cause = ANY_VALUE;
}
}
}

void CP__ERROR_template::copy_value(const CP__ERROR& 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__Cause().is_bound()) {
  single_value->field_cP__Cause = other_value.cP__Cause();
} else {
  single_value->field_cP__Cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CP__ERROR_template::copy_template(const CP__ERROR_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__Cause().get_selection()) {
single_value->field_cP__Cause = other_value.cP__Cause();
} else {
single_value->field_cP__Cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CP__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 CP__ERROR_template(*other_value.implication_.precondition);
implication_.implied_template = new CP__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.CP_ERROR.");
break;
}
set_selection(other_value);
}

CP__ERROR_template::CP__ERROR_template()
{
}

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

CP__ERROR_template::CP__ERROR_template(const CP__ERROR& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean CP__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_cP__messageType.is_bound()
 || single_value->field_cP__Cause.is_bound();
}

boolean CP__ERROR_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__Cause.is_value();
}

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

CP__ERROR CP__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.CP_ERROR.");
CP__ERROR 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__Cause.is_bound()) {
ret_val.cP__Cause() = single_value->field_cP__Cause.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& CP__ERROR_template::cP__messageType()
{
set_specific();
return single_value->field_cP__messageType;
}

const BITSTRING_template& CP__ERROR_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_ERROR.");
return single_value->field_cP__messageType;
}

CP__CauseV_template& CP__ERROR_template::cP__Cause()
{
set_specific();
return single_value->field_cP__Cause;
}

const CP__CauseV_template& CP__ERROR_template::cP__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cP_Cause of a non-specific template of type @MobileL3_SMS_Types.CP_ERROR.");
return single_value->field_cP__Cause;
}

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

void CP__ERROR_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_Cause := ");
single_value->field_cP__Cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void CP__ERROR_template::log_match(const CP__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_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__Cause.match(match_value.cP__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cP_Cause");
single_value->field_cP__Cause.log_match(match_value.cP__Cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ cP_messageType := ");
single_value->field_cP__messageType.log_match(match_value.cP__messageType(), legacy);
TTCN_Logger::log_event_str(", cP_Cause := ");
single_value->field_cP__Cause.log_match(match_value.cP__Cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void CP__ERROR_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cP__messageType().is_bound()) cP__messageType().set_implicit_omit();
if (cP__Cause().is_bound()) cP__Cause().set_implicit_omit();
}

void CP__ERROR_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__Cause.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_SMS_Types.CP_ERROR.");
}
}

void CP__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_cP__messageType.decode_text(text_buf);
single_value->field_cP__Cause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CP__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.CP_ERROR.");
}
}

void CP__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: {
    CP__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 (2<param.get_size()) {
      param.error("record template of type @MobileL3_SMS_Types.CP_ERROR 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__Cause().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_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cP__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_SMS_Types.CP_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CP__ERROR_template* precondition = new CP__ERROR_template;
    precondition->set_param(*param.get_elem(0));
    CP__ERROR_template* implied_template = new CP__ERROR_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CP__ERROR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_SMS_Types.CP_ERROR");
  }
  is_ifpresent = param.get_ifpresent();
}

void CP__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_cP__messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.CP_ERROR");
single_value->field_cP__Cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.CP_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.CP_ERROR");
}

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

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

void L3__SMS__SGSN__MS::copy_value(const L3__SMS__SGSN__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_cP__DATA:
field_cP__DATA = new CP__DATA__SGSN__MS(*other_value.field_cP__DATA);
break;
case ALT_cP__ACK:
field_cP__ACK = new CP__ACK(*other_value.field_cP__ACK);
break;
case ALT_cP__ERROR:
field_cP__ERROR = new CP__ERROR(*other_value.field_cP__ERROR);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean L3__SMS__SGSN__MS::operator==(const L3__SMS__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.L3_SMS_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.L3_SMS_SGSN_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_cP__DATA:
return *field_cP__DATA == *other_value.field_cP__DATA;
case ALT_cP__ACK:
return *field_cP__ACK == *other_value.field_cP__ACK;
case ALT_cP__ERROR:
return *field_cP__ERROR == *other_value.field_cP__ERROR;
default:
return FALSE;
}
}

CP__DATA__SGSN__MS& L3__SMS__SGSN__MS::cP__DATA()
{
if (union_selection != ALT_cP__DATA) {
clean_up();
field_cP__DATA = new CP__DATA__SGSN__MS;
union_selection = ALT_cP__DATA;
}
return *field_cP__DATA;
}

const CP__DATA__SGSN__MS& L3__SMS__SGSN__MS::cP__DATA() const
{
if (union_selection != ALT_cP__DATA) TTCN_error("Using non-selected field cP_DATA in a value of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
return *field_cP__DATA;
}

CP__ACK& L3__SMS__SGSN__MS::cP__ACK()
{
if (union_selection != ALT_cP__ACK) {
clean_up();
field_cP__ACK = new CP__ACK;
union_selection = ALT_cP__ACK;
}
return *field_cP__ACK;
}

const CP__ACK& L3__SMS__SGSN__MS::cP__ACK() const
{
if (union_selection != ALT_cP__ACK) TTCN_error("Using non-selected field cP_ACK in a value of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
return *field_cP__ACK;
}

CP__ERROR& L3__SMS__SGSN__MS::cP__ERROR()
{
if (union_selection != ALT_cP__ERROR) {
clean_up();
field_cP__ERROR = new CP__ERROR;
union_selection = ALT_cP__ERROR;
}
return *field_cP__ERROR;
}

const CP__ERROR& L3__SMS__SGSN__MS::cP__ERROR() const
{
if (union_selection != ALT_cP__ERROR) TTCN_error("Using non-selected field cP_ERROR in a value of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
return *field_cP__ERROR;
}

boolean L3__SMS__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.L3_SMS_SGSN_MS.");
return union_selection == checked_selection;
}

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

boolean L3__SMS__SGSN__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_cP__DATA: return field_cP__DATA->is_value();
case ALT_cP__ACK: return field_cP__ACK->is_value();
case ALT_cP__ERROR: return field_cP__ERROR->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void L3__SMS__SGSN__MS::clean_up()
{
switch (union_selection) {
case ALT_cP__DATA:
  delete field_cP__DATA;
  break;
case ALT_cP__ACK:
  delete field_cP__ACK;
  break;
case ALT_cP__ERROR:
  delete field_cP__ERROR;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void L3__SMS__SGSN__MS::log() const
{
switch (union_selection) {
case ALT_cP__DATA:
TTCN_Logger::log_event_str("{ cP_DATA := ");
field_cP__DATA->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cP__ACK:
TTCN_Logger::log_event_str("{ cP_ACK := ");
field_cP__ACK->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cP__ERROR:
TTCN_Logger::log_event_str("{ cP_ERROR := ");
field_cP__ERROR->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void L3__SMS__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, "cP_DATA")) {
    cP__DATA().set_param(*mp_last);
    if (!cP__DATA().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cP_ACK")) {
    cP__ACK().set_param(*mp_last);
    if (!cP__ACK().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cP_ERROR")) {
    cP__ERROR().set_param(*mp_last);
    if (!cP__ERROR().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.", last_name);
}

void L3__SMS__SGSN__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_cP__DATA:
field_cP__DATA->set_implicit_omit(); break;
case ALT_cP__ACK:
field_cP__ACK->set_implicit_omit(); break;
case ALT_cP__ERROR:
field_cP__ERROR->set_implicit_omit(); break;
default: break;
}
}

void L3__SMS__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_cP__DATA:
field_cP__DATA->encode_text(text_buf);
break;
case ALT_cP__ACK:
field_cP__ACK->encode_text(text_buf);
break;
case ALT_cP__ERROR:
field_cP__ERROR->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
}
}

void L3__SMS__SGSN__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_cP__DATA:
cP__DATA().decode_text(text_buf);
break;
case ALT_cP__ACK:
cP__ACK().decode_text(text_buf);
break;
case ALT_cP__ERROR:
cP__ERROR().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
}
}

void L3__SMS__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 L3__SMS__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 L3__SMS__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, CP__DATA__SGSN__MS_descr_.raw->forceomit);
      decoded_length = cP__DATA().RAW_decode(CP__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, CP__ACK_descr_.raw->forceomit);
      decoded_length = cP__ACK().RAW_decode(CP__ACK_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, CP__ERROR_descr_.raw->forceomit);
      decoded_length = cP__ERROR().RAW_decode(CP__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 {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, CP__DATA__SGSN__MS_descr_.raw->forceomit);
      decoded_length = cP__DATA().RAW_decode(CP__DATA__SGSN__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, CP__ACK_descr_.raw->forceomit);
      decoded_length = cP__ACK().RAW_decode(CP__ACK_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, CP__ERROR_descr_.raw->forceomit);
      decoded_length = cP__ERROR().RAW_decode(CP__ERROR_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int L3__SMS__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 = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_cP__DATA:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, CP__DATA__SGSN__MS_descr_.raw);
    encoded_length = field_cP__DATA->RAW_encode(CP__DATA__SGSN__MS_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &CP__DATA__SGSN__MS_descr_;
    break;
  case ALT_cP__ACK:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, CP__ACK_descr_.raw);
    encoded_length = field_cP__ACK->RAW_encode(CP__ACK_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &CP__ACK_descr_;
    break;
  case ALT_cP__ERROR:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, CP__ERROR_descr_.raw);
    encoded_length = field_cP__ERROR->RAW_encode(CP__ERROR_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &CP__ERROR_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void L3__SMS__SGSN__MS_template::copy_value(const L3__SMS__SGSN__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
single_value.field_cP__DATA = new CP__DATA__SGSN__MS_template(other_value.cP__DATA());
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
single_value.field_cP__ACK = new CP__ACK_template(other_value.cP__ACK());
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
single_value.field_cP__ERROR = new CP__ERROR_template(other_value.cP__ERROR());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void L3__SMS__SGSN__MS_template::copy_template(const L3__SMS__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 L3__SMS__SGSN__MS::ALT_cP__DATA:
single_value.field_cP__DATA = new CP__DATA__SGSN__MS_template(*other_value.single_value.field_cP__DATA);
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
single_value.field_cP__ACK = new CP__ACK_template(*other_value.single_value.field_cP__ACK);
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
single_value.field_cP__ERROR = new CP__ERROR_template(*other_value.single_value.field_cP__ERROR);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_SMS_Types.L3_SMS_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 L3__SMS__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 L3__SMS__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new L3__SMS__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.L3_SMS_SGSN_MS.");
}
set_selection(other_value);
}

L3__SMS__SGSN__MS_template::L3__SMS__SGSN__MS_template()
{
}

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

L3__SMS__SGSN__MS_template::L3__SMS__SGSN__MS_template(const L3__SMS__SGSN__MS& other_value)
{
copy_value(other_value);
}

L3__SMS__SGSN__MS_template::L3__SMS__SGSN__MS_template(const OPTIONAL<L3__SMS__SGSN__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__SMS__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.L3_SMS_SGSN_MS from an unbound optional field.");
}
}

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

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

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

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

void L3__SMS__SGSN__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
delete single_value.field_cP__DATA;
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
delete single_value.field_cP__ACK;
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
delete single_value.field_cP__ERROR;
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;
}

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

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

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

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

boolean L3__SMS__SGSN__MS_template::match(const L3__SMS__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:
{
L3__SMS__SGSN__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == L3__SMS__SGSN__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
return single_value.field_cP__DATA->match(other_value.cP__DATA(), legacy);
case L3__SMS__SGSN__MS::ALT_cP__ACK:
return single_value.field_cP__ACK->match(other_value.cP__ACK(), legacy);
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
return single_value.field_cP__ERROR->match(other_value.cP__ERROR(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_SMS_Types.L3_SMS_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.L3_SMS_SGSN_MS.");
}
return FALSE;
}

boolean L3__SMS__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
return single_value.field_cP__DATA->is_value();
case L3__SMS__SGSN__MS::ALT_cP__ACK:
return single_value.field_cP__ACK->is_value();
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
return single_value.field_cP__ERROR->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.L3_SMS_SGSN_MS.");
}
}

L3__SMS__SGSN__MS L3__SMS__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.L3_SMS_SGSN_MS.");
L3__SMS__SGSN__MS ret_val;
switch (single_value.union_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
ret_val.cP__DATA() = single_value.field_cP__DATA->valueof();
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
ret_val.cP__ACK() = single_value.field_cP__ACK->valueof();
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
ret_val.cP__ERROR() = single_value.field_cP__ERROR->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.L3_SMS_SGSN_MS.");
}
return ret_val;
}

L3__SMS__SGSN__MS_template& L3__SMS__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.L3_SMS_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.L3_SMS_SGSN_MS.");
return value_list.list_value[list_index];
}
void L3__SMS__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.L3_SMS_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new L3__SMS__SGSN__MS_template[list_length];
}

CP__DATA__SGSN__MS_template& L3__SMS__SGSN__MS_template::cP__DATA()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__SMS__SGSN__MS::ALT_cP__DATA) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cP__DATA = new CP__DATA__SGSN__MS_template(ANY_VALUE);
else single_value.field_cP__DATA = new CP__DATA__SGSN__MS_template;
single_value.union_selection = L3__SMS__SGSN__MS::ALT_cP__DATA;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cP__DATA;
}

const CP__DATA__SGSN__MS_template& L3__SMS__SGSN__MS_template::cP__DATA() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cP_DATA in a non-specific template of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
if (single_value.union_selection != L3__SMS__SGSN__MS::ALT_cP__DATA) TTCN_error("Accessing non-selected field cP_DATA in a template of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
return *single_value.field_cP__DATA;
}

CP__ACK_template& L3__SMS__SGSN__MS_template::cP__ACK()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__SMS__SGSN__MS::ALT_cP__ACK) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cP__ACK = new CP__ACK_template(ANY_VALUE);
else single_value.field_cP__ACK = new CP__ACK_template;
single_value.union_selection = L3__SMS__SGSN__MS::ALT_cP__ACK;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cP__ACK;
}

const CP__ACK_template& L3__SMS__SGSN__MS_template::cP__ACK() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cP_ACK in a non-specific template of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
if (single_value.union_selection != L3__SMS__SGSN__MS::ALT_cP__ACK) TTCN_error("Accessing non-selected field cP_ACK in a template of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
return *single_value.field_cP__ACK;
}

CP__ERROR_template& L3__SMS__SGSN__MS_template::cP__ERROR()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__SMS__SGSN__MS::ALT_cP__ERROR) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cP__ERROR = new CP__ERROR_template(ANY_VALUE);
else single_value.field_cP__ERROR = new CP__ERROR_template;
single_value.union_selection = L3__SMS__SGSN__MS::ALT_cP__ERROR;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cP__ERROR;
}

const CP__ERROR_template& L3__SMS__SGSN__MS_template::cP__ERROR() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cP_ERROR in a non-specific template of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
if (single_value.union_selection != L3__SMS__SGSN__MS::ALT_cP__ERROR) TTCN_error("Accessing non-selected field cP_ERROR in a template of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
return *single_value.field_cP__ERROR;
}

boolean L3__SMS__SGSN__MS_template::ischosen(L3__SMS__SGSN__MS::union_selection_type checked_selection) const
{
if (checked_selection == L3__SMS__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == L3__SMS__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.L3_SMS_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.L3_SMS_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 L3__SMS__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
TTCN_Logger::log_event_str("{ cP_DATA := ");
single_value.field_cP__DATA->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
TTCN_Logger::log_event_str("{ cP_ACK := ");
single_value.field_cP__ACK->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
TTCN_Logger::log_event_str("{ cP_ERROR := ");
single_value.field_cP__ERROR->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 L3__SMS__SGSN__MS_template::log_match(const L3__SMS__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 L3__SMS__SGSN__MS::ALT_cP__DATA:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cP_DATA");
single_value.field_cP__DATA->log_match(match_value.cP__DATA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cP_DATA := ");
single_value.field_cP__DATA->log_match(match_value.cP__DATA(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cP_ACK");
single_value.field_cP__ACK->log_match(match_value.cP__ACK(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cP_ACK := ");
single_value.field_cP__ACK->log_match(match_value.cP__ACK(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cP_ERROR");
single_value.field_cP__ERROR->log_match(match_value.cP__ERROR(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cP_ERROR := ");
single_value.field_cP__ERROR->log_match(match_value.cP__ERROR(), 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 L3__SMS__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
single_value.field_cP__DATA->set_implicit_omit(); break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
single_value.field_cP__ACK->set_implicit_omit(); break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
single_value.field_cP__ERROR->set_implicit_omit(); break;
default: break;
}
}

void L3__SMS__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 L3__SMS__SGSN__MS::ALT_cP__DATA:
single_value.field_cP__DATA->encode_text(text_buf);
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
single_value.field_cP__ACK->encode_text(text_buf);
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
single_value.field_cP__ERROR->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.L3_SMS_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.L3_SMS_SGSN_MS.");
}
}

void L3__SMS__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 = L3__SMS__SGSN__MS::UNBOUND_VALUE;
L3__SMS__SGSN__MS::union_selection_type new_selection = (L3__SMS__SGSN__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case L3__SMS__SGSN__MS::ALT_cP__DATA:
single_value.field_cP__DATA = new CP__DATA__SGSN__MS_template;
single_value.field_cP__DATA->decode_text(text_buf);
break;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
single_value.field_cP__ACK = new CP__ACK_template;
single_value.field_cP__ACK->decode_text(text_buf);
break;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
single_value.field_cP__ERROR = new CP__ERROR_template;
single_value.field_cP__ERROR->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_SMS_Types.L3_SMS_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 L3__SMS__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.L3_SMS_SGSN_MS.");
}
}

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

boolean L3__SMS__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 L3__SMS__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.L3_SMS_SGSN_MS'");
    }
    if (strcmp("cP_DATA", param_field) == 0) {
      cP__DATA().set_param(param);
      return;
    } else if (strcmp("cP_ACK", param_field) == 0) {
      cP__ACK().set_param(param);
      return;
    } else if (strcmp("cP_ERROR", param_field) == 0) {
      cP__ERROR().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_SMS_Types.L3_SMS_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: {
    L3__SMS__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.L3_SMS_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, "cP_DATA")) {
      cP__DATA().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cP_ACK")) {
      cP__ACK().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cP_ERROR")) {
      cP__ERROR().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_SMS_Types.L3_SMS_SGSN_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    L3__SMS__SGSN__MS_template* precondition = new L3__SMS__SGSN__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    L3__SMS__SGSN__MS_template* implied_template = new L3__SMS__SGSN__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = L3__SMS__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_SMS_Types.L3_SMS_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void L3__SMS__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 L3__SMS__SGSN__MS::ALT_cP__DATA:
single_value.field_cP__DATA->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.L3_SMS_SGSN_MS");
return;
case L3__SMS__SGSN__MS::ALT_cP__ACK:
single_value.field_cP__ACK->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.L3_SMS_SGSN_MS");
return;
case L3__SMS__SGSN__MS::ALT_cP__ERROR:
single_value.field_cP__ERROR->check_restriction(t_res, t_name ? t_name : "@MobileL3_SMS_Types.L3_SMS_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.L3_SMS_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.L3_SMS_SGSN_MS");
}


} /* end of namespace */
