// 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_MM_Types.hh"

namespace MobileL3__MM__Types {

/* Literal string constants */

const unsigned char bs_10_bits[] = { 32 },
bs_11_bits[] = { 16 },
bs_12_bits[] = { 8 },
bs_13_bits[] = { 4 },
bs_5_bits[] = { 116 },
bs_14_bits[] = { 34 },
bs_15_bits[] = { 18 },
bs_16_bits[] = { 10 },
bs_18_bits[] = { 6 },
bs_19_bits[] = { 38 },
bs_20_bits[] = { 22 },
bs_21_bits[] = { 54 },
bs_17_bits[] = { 14 },
bs_4_bits[] = { 1 },
bs_23_bits[] = { 33 },
bs_8_bits[] = { 97 },
bs_24_bits[] = { 17 },
bs_9_bits[] = { 81 },
bs_22_bits[] = { 49 },
bs_0_bits[] = { 49 },
bs_1_bits[] = { 113 },
bs_25_bits[] = { 9 },
bs_2_bits[] = { 9 },
bs_26_bits[] = { 41 },
bs_6_bits[] = { 41 },
bs_27_bits[] = { 5 },
bs_28_bits[] = { 37 },
bs_29_bits[] = { 3 },
bs_30_bits[] = { 35 },
bs_31_bits[] = { 19 },
bs_3_bits[] = { 11 },
bs_7_bits[] = { 7 };
extern const BITSTRING bs_10(6, bs_10_bits),
bs_11(6, bs_11_bits),
bs_12(6, bs_12_bits),
bs_13(6, bs_13_bits),
bs_5(7, bs_5_bits),
bs_14(6, bs_14_bits),
bs_15(6, bs_15_bits),
bs_16(6, bs_16_bits),
bs_18(6, bs_18_bits),
bs_19(6, bs_19_bits),
bs_20(6, bs_20_bits),
bs_21(6, bs_21_bits),
bs_17(6, bs_17_bits),
bs_4(4, bs_4_bits),
bs_23(6, bs_23_bits),
bs_8(7, bs_8_bits),
bs_24(6, bs_24_bits),
bs_9(7, bs_9_bits),
bs_22(6, bs_22_bits),
bs_0(7, bs_0_bits),
bs_1(7, bs_1_bits),
bs_25(6, bs_25_bits),
bs_2(7, bs_2_bits),
bs_26(6, bs_26_bits),
bs_6(7, bs_6_bits),
bs_27(6, bs_27_bits),
bs_28(6, bs_28_bits),
bs_29(6, bs_29_bits),
bs_30(6, bs_30_bits),
bs_31(6, bs_31_bits),
bs_3(4, bs_3_bits),
bs_7(4, bs_7_bits);
const unsigned char os_7_octets[] = { 19 },
os_6_octets[] = { 32 },
os_0_octets[] = { 33 },
os_1_octets[] = { 34 },
os_2_octets[] = { 48 },
os_4_octets[] = { 52 },
os_5_octets[] = { 54 },
os_3_octets[] = { 73 },
os_8_octets[] = { 161 },
os_9_octets[] = { 162 };
extern const OCTETSTRING os_7(1, os_7_octets),
os_6(1, os_6_octets),
os_0(1, os_0_octets),
os_1(1, os_1_octets),
os_2(1, os_2_octets),
os_4(1, os_4_octets),
os_5(1, os_5_octets),
os_3(1, os_3_octets),
os_8(1, os_8_octets),
os_9(1, os_9_octets);
const unsigned char pp_0[] = { 0xff };
const unsigned char module_checksum[] = { 0xfc, 0xeb, 0x8c, 0xc8, 0x93, 0x50, 0x0e, 0xaf, 0x64, 0x3b, 0x8d, 0x30, 0x84, 0x6b, 0x73, 0x4d };

/* Global variable definitions */

const XERdescriptor_t       AuthenticationParameterRANDTV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationParameterRANDTV_elementIdentifier_oer_ext_arr_[0] = {};
const int AuthenticationParameterRANDTV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationParameterRANDTV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, AuthenticationParameterRANDTV_elementIdentifier_oer_ext_arr_, 0, AuthenticationParameterRANDTV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t AuthenticationParameterRANDTV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.AuthenticationParameterRANDTV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &AuthenticationParameterRANDTV_elementIdentifier_xer_, &OCTETSTRING_json_, &AuthenticationParameterRANDTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationParameterRANDTV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       AuthenticationParameterRANDTV_randValue_xer_ = { {"randValue>\n", "randValue>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationParameterRANDTV_randValue_oer_ext_arr_[0] = {};
const int AuthenticationParameterRANDTV_randValue_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationParameterRANDTV_randValue_oer_ = { -1, TRUE, 16, FALSE, 0, 0, AuthenticationParameterRANDTV_randValue_oer_ext_arr_, 0, AuthenticationParameterRANDTV_randValue_oer_p_};
const TTCN_Typedescriptor_t AuthenticationParameterRANDTV_randValue_descr_ = { "@MobileL3_MM_Types.AuthenticationParameterRANDTV.randValue", &OCTETSTRING_ber_, &General__Types::OCT16_raw_, &OCTETSTRING_text_, &AuthenticationParameterRANDTV_randValue_xer_, &OCTETSTRING_json_, &AuthenticationParameterRANDTV_randValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationParameterRANDTV_randValue_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationParameterRANDTV_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 AuthenticationParameterRANDTV
const TTCN_Typedescriptor_t AuthenticationParameterRANDTV_descr_ = { "@MobileL3_MM_Types.AuthenticationParameterRANDTV", NULL, &AuthenticationParameterRANDTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationParameterRANDTV_default_coding("RAW");
const XERdescriptor_t       AuthenticationParameterAUTNTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationParameterAUTNTLV_elementIdentifier_oer_ext_arr_[0] = {};
const int AuthenticationParameterAUTNTLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationParameterAUTNTLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, AuthenticationParameterAUTNTLV_elementIdentifier_oer_ext_arr_, 0, AuthenticationParameterAUTNTLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t AuthenticationParameterAUTNTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &AuthenticationParameterAUTNTLV_elementIdentifier_xer_, &OCTETSTRING_json_, &AuthenticationParameterAUTNTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationParameterAUTNTLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationParameterAUTNTLV_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       AuthenticationParameterAUTNTLV_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 AuthenticationParameterAUTNTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AuthenticationParameterAUTNTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV.lengthIndicator", &INTEGER_ber_, &AuthenticationParameterAUTNTLV_lengthIndicator_raw_, &INTEGER_text_, &AuthenticationParameterAUTNTLV_lengthIndicator_xer_, &INTEGER_json_, &AuthenticationParameterAUTNTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationParameterAUTNTLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       AuthenticationParameterAUTNTLV_autnValue_xer_ = { {"autnValue>\n", "autnValue>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationParameterAUTNTLV_autnValue_oer_ext_arr_[0] = {};
const int AuthenticationParameterAUTNTLV_autnValue_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationParameterAUTNTLV_autnValue_oer_ = { -1, TRUE, 16, FALSE, 0, 0, AuthenticationParameterAUTNTLV_autnValue_oer_ext_arr_, 0, AuthenticationParameterAUTNTLV_autnValue_oer_p_};
const TTCN_Typedescriptor_t AuthenticationParameterAUTNTLV_autnValue_descr_ = { "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV.autnValue", &OCTETSTRING_ber_, &General__Types::OCT16_raw_, &OCTETSTRING_text_, &AuthenticationParameterAUTNTLV_autnValue_xer_, &OCTETSTRING_json_, &AuthenticationParameterAUTNTLV_autnValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationParameterAUTNTLV_autnValue_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationParameterAUTNTLV_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 AuthenticationParameterAUTNTLV
const TTCN_Typedescriptor_t AuthenticationParameterAUTNTLV_descr_ = { "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV", NULL, &AuthenticationParameterAUTNTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationParameterAUTNTLV_default_coding("RAW");
const XERdescriptor_t       AuthenticationResponseParameterTV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationResponseParameterTV_elementIdentifier_oer_ext_arr_[0] = {};
const int AuthenticationResponseParameterTV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationResponseParameterTV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, AuthenticationResponseParameterTV_elementIdentifier_oer_ext_arr_, 0, AuthenticationResponseParameterTV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t AuthenticationResponseParameterTV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.AuthenticationResponseParameterTV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &AuthenticationResponseParameterTV_elementIdentifier_xer_, &OCTETSTRING_json_, &AuthenticationResponseParameterTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationResponseParameterTV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationResponseParameterTV_valueField_raw_ = {32,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       AuthenticationResponseParameterTV_valueField_xer_ = { {"valueField>\n", "valueField>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationResponseParameterTV_valueField_oer_ext_arr_[0] = {};
const int AuthenticationResponseParameterTV_valueField_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationResponseParameterTV_valueField_oer_ = { -1, TRUE, 4, FALSE, 0, 0, AuthenticationResponseParameterTV_valueField_oer_ext_arr_, 0, AuthenticationResponseParameterTV_valueField_oer_p_};
const TTCN_Typedescriptor_t AuthenticationResponseParameterTV_valueField_descr_ = { "@MobileL3_MM_Types.AuthenticationResponseParameterTV.valueField", &OCTETSTRING_ber_, &AuthenticationResponseParameterTV_valueField_raw_, &OCTETSTRING_text_, &AuthenticationResponseParameterTV_valueField_xer_, &OCTETSTRING_json_, &AuthenticationResponseParameterTV_valueField_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationResponseParameterTV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationResponseParameterTV_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 AuthenticationResponseParameterTV
const TTCN_Typedescriptor_t AuthenticationResponseParameterTV_descr_ = { "@MobileL3_MM_Types.AuthenticationResponseParameterTV", NULL, &AuthenticationResponseParameterTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationResponseParameterTV_default_coding("RAW");
const XERdescriptor_t       AuthenticationResponseParameterUMTSTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationResponseParameterUMTSTLV_elementIdentifier_oer_ext_arr_[0] = {};
const int AuthenticationResponseParameterUMTSTLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationResponseParameterUMTSTLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, AuthenticationResponseParameterUMTSTLV_elementIdentifier_oer_ext_arr_, 0, AuthenticationResponseParameterUMTSTLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t AuthenticationResponseParameterUMTSTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &AuthenticationResponseParameterUMTSTLV_elementIdentifier_xer_, &OCTETSTRING_json_, &AuthenticationResponseParameterUMTSTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationResponseParameterUMTSTLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationResponseParameterUMTSTLV_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       AuthenticationResponseParameterUMTSTLV_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 AuthenticationResponseParameterUMTSTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AuthenticationResponseParameterUMTSTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV.lengthIndicator", &INTEGER_ber_, &AuthenticationResponseParameterUMTSTLV_lengthIndicator_raw_, &INTEGER_text_, &AuthenticationResponseParameterUMTSTLV_lengthIndicator_xer_, &INTEGER_json_, &AuthenticationResponseParameterUMTSTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationResponseParameterUMTSTLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       AuthenticationResponseParameterUMTSTLV_valueField_xer_ = { {"valueField>\n", "valueField>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationResponseParameterUMTSTLV_valueField_oer_ext_arr_[0] = {};
const int AuthenticationResponseParameterUMTSTLV_valueField_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationResponseParameterUMTSTLV_valueField_oer_ = { -1, TRUE, -1, FALSE, 0, 0, AuthenticationResponseParameterUMTSTLV_valueField_oer_ext_arr_, 0, AuthenticationResponseParameterUMTSTLV_valueField_oer_p_};
const TTCN_Typedescriptor_t AuthenticationResponseParameterUMTSTLV_valueField_descr_ = { "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV.valueField", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &AuthenticationResponseParameterUMTSTLV_valueField_xer_, &OCTETSTRING_json_, &AuthenticationResponseParameterUMTSTLV_valueField_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationResponseParameterUMTSTLV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationResponseParameterUMTSTLV_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 AuthenticationResponseParameterUMTSTLV
const TTCN_Typedescriptor_t AuthenticationResponseParameterUMTSTLV_descr_ = { "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV", NULL, &AuthenticationResponseParameterUMTSTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationResponseParameterUMTSTLV_default_coding("RAW");
const XERdescriptor_t       AuthenticationFailureParametersTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationFailureParametersTLV_elementIdentifier_oer_ext_arr_[0] = {};
const int AuthenticationFailureParametersTLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationFailureParametersTLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, AuthenticationFailureParametersTLV_elementIdentifier_oer_ext_arr_, 0, AuthenticationFailureParametersTLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t AuthenticationFailureParametersTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.AuthenticationFailureParametersTLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &AuthenticationFailureParametersTLV_elementIdentifier_xer_, &OCTETSTRING_json_, &AuthenticationFailureParametersTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationFailureParametersTLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationFailureParametersTLV_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       AuthenticationFailureParametersTLV_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 AuthenticationFailureParametersTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AuthenticationFailureParametersTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.AuthenticationFailureParametersTLV.lengthIndicator", &INTEGER_ber_, &AuthenticationFailureParametersTLV_lengthIndicator_raw_, &INTEGER_text_, &AuthenticationFailureParametersTLV_lengthIndicator_xer_, &INTEGER_json_, &AuthenticationFailureParametersTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationFailureParametersTLV_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationFailureParametersTLV_valueField_raw_ = {112,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       AuthenticationFailureParametersTLV_valueField_xer_ = { {"valueField>\n", "valueField>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int AuthenticationFailureParametersTLV_valueField_oer_ext_arr_[0] = {};
const int AuthenticationFailureParametersTLV_valueField_oer_p_[0] = {};
const TTCN_OERdescriptor_t AuthenticationFailureParametersTLV_valueField_oer_ = { -1, TRUE, 14, FALSE, 0, 0, AuthenticationFailureParametersTLV_valueField_oer_ext_arr_, 0, AuthenticationFailureParametersTLV_valueField_oer_p_};
const TTCN_Typedescriptor_t AuthenticationFailureParametersTLV_valueField_descr_ = { "@MobileL3_MM_Types.AuthenticationFailureParametersTLV.valueField", &OCTETSTRING_ber_, &AuthenticationFailureParametersTLV_valueField_raw_, &OCTETSTRING_text_, &AuthenticationFailureParametersTLV_valueField_xer_, &OCTETSTRING_json_, &AuthenticationFailureParametersTLV_valueField_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationFailureParametersTLV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t AuthenticationFailureParametersTLV_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 AuthenticationFailureParametersTLV
const TTCN_Typedescriptor_t AuthenticationFailureParametersTLV_descr_ = { "@MobileL3_MM_Types.AuthenticationFailureParametersTLV", NULL, &AuthenticationFailureParametersTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AuthenticationFailureParametersTLV_default_coding("RAW");
const XERdescriptor_t       LocationUpdatingType_lut_xer_ = { {"lut>\n", "lut>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t LocationUpdatingType_lut_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LocationUpdatingType_lut_descr_ = { "@MobileL3_MM_Types.LocationUpdatingType.lut", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &LocationUpdatingType_lut_xer_, &BITSTRING_json_, &LocationUpdatingType_lut_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationUpdatingType_lut_default_coding("RAW");
const XERdescriptor_t       LocationUpdatingType_spare1__1_xer_ = { {"spare1_1>\n", "spare1_1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t LocationUpdatingType_spare1__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LocationUpdatingType_spare1__1_descr_ = { "@MobileL3_MM_Types.LocationUpdatingType.spare1_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &LocationUpdatingType_spare1__1_xer_, &BITSTRING_json_, &LocationUpdatingType_spare1__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationUpdatingType_spare1__1_default_coding("RAW");
const XERdescriptor_t       LocationUpdatingType_fop_xer_ = { {"fop>\n", "fop>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t LocationUpdatingType_fop_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LocationUpdatingType_fop_descr_ = { "@MobileL3_MM_Types.LocationUpdatingType.fop", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &LocationUpdatingType_fop_xer_, &BITSTRING_json_, &LocationUpdatingType_fop_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationUpdatingType_fop_default_coding("RAW");
const TTCN_RAWdescriptor_t LocationUpdatingType_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 LocationUpdatingType
const TTCN_Typedescriptor_t LocationUpdatingType_descr_ = { "@MobileL3_MM_Types.LocationUpdatingType", NULL, &LocationUpdatingType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationUpdatingType_default_coding("RAW");
const XERdescriptor_t       NetworkNameTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t NetworkNameTLV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t NetworkNameTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.NetworkNameTLV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &NetworkNameTLV_elementIdentifier_xer_, &BITSTRING_json_, &NetworkNameTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameTLV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       NetworkNameTLV_spare1_xer_ = { {"spare1>\n", "spare1>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t NetworkNameTLV_spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t NetworkNameTLV_spare1_descr_ = { "@MobileL3_MM_Types.NetworkNameTLV.spare1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &NetworkNameTLV_spare1_xer_, &BITSTRING_json_, &NetworkNameTLV_spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameTLV_spare1_default_coding("RAW");
const TTCN_RAWdescriptor_t NetworkNameTLV_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       NetworkNameTLV_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 NetworkNameTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t NetworkNameTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.NetworkNameTLV.lengthIndicator", &INTEGER_ber_, &NetworkNameTLV_lengthIndicator_raw_, &INTEGER_text_, &NetworkNameTLV_lengthIndicator_xer_, &INTEGER_json_, &NetworkNameTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameTLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       NetworkNameV_nSpareBits_xer_ = { {"nSpareBits>\n", "nSpareBits>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t NetworkNameV_nSpareBits_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t NetworkNameV_nSpareBits_descr_ = { "@MobileL3_MM_Types.NetworkNameV.nSpareBits", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &NetworkNameV_nSpareBits_xer_, &BITSTRING_json_, &NetworkNameV_nSpareBits_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameV_nSpareBits_default_coding("RAW");
const XERdescriptor_t       NetworkNameV_addCI_xer_ = { {"addCI>\n", "addCI>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t NetworkNameV_addCI_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t NetworkNameV_addCI_descr_ = { "@MobileL3_MM_Types.NetworkNameV.addCI", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &NetworkNameV_addCI_xer_, &BITSTRING_json_, &NetworkNameV_addCI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameV_addCI_default_coding("RAW");
const XERdescriptor_t       NetworkNameV_codingScheme_xer_ = { {"codingScheme>\n", "codingScheme>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t NetworkNameV_codingScheme_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t NetworkNameV_codingScheme_descr_ = { "@MobileL3_MM_Types.NetworkNameV.codingScheme", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &NetworkNameV_codingScheme_xer_, &BITSTRING_json_, &NetworkNameV_codingScheme_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameV_codingScheme_default_coding("RAW");
const XERdescriptor_t       NetworkNameV_ext1_xer_ = { {"ext1>\n", "ext1>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t NetworkNameV_ext1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t NetworkNameV_ext1_descr_ = { "@MobileL3_MM_Types.NetworkNameV.ext1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &NetworkNameV_ext1_xer_, &BITSTRING_json_, &NetworkNameV_ext1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameV_ext1_default_coding("RAW");
const XERdescriptor_t       NetworkNameV_textString_xer_ = { {"textString>\n", "textString>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int NetworkNameV_textString_oer_ext_arr_[0] = {};
const int NetworkNameV_textString_oer_p_[0] = {};
const TTCN_OERdescriptor_t NetworkNameV_textString_oer_ = { -1, TRUE, -1, FALSE, 0, 0, NetworkNameV_textString_oer_ext_arr_, 0, NetworkNameV_textString_oer_p_};
const TTCN_Typedescriptor_t NetworkNameV_textString_descr_ = { "@MobileL3_MM_Types.NetworkNameV.textString", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &NetworkNameV_textString_xer_, &OCTETSTRING_json_, &NetworkNameV_textString_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameV_textString_default_coding("RAW");
const TTCN_RAWdescriptor_t NetworkNameV_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 NetworkNameV
const TTCN_Typedescriptor_t NetworkNameV_descr_ = { "@MobileL3_MM_Types.NetworkNameV", NULL, &NetworkNameV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameV_default_coding("RAW");
UNIVERSAL_CHARSTRING NetworkNameTLV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t NetworkNameTLV_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 NetworkNameTLV
const TTCN_Typedescriptor_t NetworkNameTLV_descr_ = { "@MobileL3_MM_Types.NetworkNameTLV", NULL, &NetworkNameTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NetworkNameTLV_default_coding("RAW");
const TTCN_Typedescriptor_t& FollowOnProceed_descr_ = MobileL3__CommonIE__Types::Type2_descr_;
UNIVERSAL_CHARSTRING FollowOnProceed_default_coding("RAW");
const XERdescriptor_t       TimeZoneTV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TimeZoneTV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TimeZoneTV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.TimeZoneTV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &TimeZoneTV_elementIdentifier_xer_, &BITSTRING_json_, &TimeZoneTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneTV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       TimeZoneTV_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TimeZoneTV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TimeZoneTV_spare_descr_ = { "@MobileL3_MM_Types.TimeZoneTV.spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TimeZoneTV_spare_xer_, &BITSTRING_json_, &TimeZoneTV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneTV_spare_default_coding("RAW");
const XERdescriptor_t       TimeZoneV_timeZone_xer_ = { {"timeZone>\n", "timeZone>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneV_timeZone_oer_ext_arr_[0] = {};
const int TimeZoneV_timeZone_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneV_timeZone_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneV_timeZone_oer_ext_arr_, 0, TimeZoneV_timeZone_oer_p_};
const TTCN_Typedescriptor_t TimeZoneV_timeZone_descr_ = { "@MobileL3_MM_Types.TimeZoneV.timeZone", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneV_timeZone_xer_, &OCTETSTRING_json_, &TimeZoneV_timeZone_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneV_timeZone_default_coding("RAW");
const TTCN_RAWdescriptor_t TimeZoneV_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 TimeZoneV
const TTCN_Typedescriptor_t TimeZoneV_descr_ = { "@MobileL3_MM_Types.TimeZoneV", NULL, &TimeZoneV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneV_default_coding("RAW");
UNIVERSAL_CHARSTRING TimeZoneTV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t TimeZoneTV_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 TimeZoneTV
const TTCN_Typedescriptor_t TimeZoneTV_descr_ = { "@MobileL3_MM_Types.TimeZoneTV", NULL, &TimeZoneTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneTV_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeTV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TimeZoneAndTimeTV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TimeZoneAndTimeTV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeTV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &TimeZoneAndTimeTV_elementIdentifier_xer_, &BITSTRING_json_, &TimeZoneAndTimeTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeTV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeTV_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TimeZoneAndTimeTV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TimeZoneAndTimeTV_spare_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeTV.spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TimeZoneAndTimeTV_spare_xer_, &BITSTRING_json_, &TimeZoneAndTimeTV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeTV_spare_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeV_year_xer_ = { {"year>\n", "year>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneAndTimeV_year_oer_ext_arr_[0] = {};
const int TimeZoneAndTimeV_year_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneAndTimeV_year_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneAndTimeV_year_oer_ext_arr_, 0, TimeZoneAndTimeV_year_oer_p_};
const TTCN_Typedescriptor_t TimeZoneAndTimeV_year_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV.year", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneAndTimeV_year_xer_, &OCTETSTRING_json_, &TimeZoneAndTimeV_year_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_year_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeV_month_xer_ = { {"month>\n", "month>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneAndTimeV_month_oer_ext_arr_[0] = {};
const int TimeZoneAndTimeV_month_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneAndTimeV_month_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneAndTimeV_month_oer_ext_arr_, 0, TimeZoneAndTimeV_month_oer_p_};
const TTCN_Typedescriptor_t TimeZoneAndTimeV_month_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV.month", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneAndTimeV_month_xer_, &OCTETSTRING_json_, &TimeZoneAndTimeV_month_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_month_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeV_day_xer_ = { {"day>\n", "day>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneAndTimeV_day_oer_ext_arr_[0] = {};
const int TimeZoneAndTimeV_day_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneAndTimeV_day_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneAndTimeV_day_oer_ext_arr_, 0, TimeZoneAndTimeV_day_oer_p_};
const TTCN_Typedescriptor_t TimeZoneAndTimeV_day_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV.day", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneAndTimeV_day_xer_, &OCTETSTRING_json_, &TimeZoneAndTimeV_day_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_day_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeV_hour_xer_ = { {"hour>\n", "hour>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneAndTimeV_hour_oer_ext_arr_[0] = {};
const int TimeZoneAndTimeV_hour_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneAndTimeV_hour_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneAndTimeV_hour_oer_ext_arr_, 0, TimeZoneAndTimeV_hour_oer_p_};
const TTCN_Typedescriptor_t TimeZoneAndTimeV_hour_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV.hour", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneAndTimeV_hour_xer_, &OCTETSTRING_json_, &TimeZoneAndTimeV_hour_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_hour_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeV_minute_xer_ = { {"minute>\n", "minute>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneAndTimeV_minute_oer_ext_arr_[0] = {};
const int TimeZoneAndTimeV_minute_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneAndTimeV_minute_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneAndTimeV_minute_oer_ext_arr_, 0, TimeZoneAndTimeV_minute_oer_p_};
const TTCN_Typedescriptor_t TimeZoneAndTimeV_minute_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV.minute", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneAndTimeV_minute_xer_, &OCTETSTRING_json_, &TimeZoneAndTimeV_minute_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_minute_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeV_second_xer_ = { {"second>\n", "second>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneAndTimeV_second_oer_ext_arr_[0] = {};
const int TimeZoneAndTimeV_second_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneAndTimeV_second_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneAndTimeV_second_oer_ext_arr_, 0, TimeZoneAndTimeV_second_oer_p_};
const TTCN_Typedescriptor_t TimeZoneAndTimeV_second_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV.second", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneAndTimeV_second_xer_, &OCTETSTRING_json_, &TimeZoneAndTimeV_second_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_second_default_coding("RAW");
const XERdescriptor_t       TimeZoneAndTimeV_timeZone_xer_ = { {"timeZone>\n", "timeZone>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TimeZoneAndTimeV_timeZone_oer_ext_arr_[0] = {};
const int TimeZoneAndTimeV_timeZone_oer_p_[0] = {};
const TTCN_OERdescriptor_t TimeZoneAndTimeV_timeZone_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TimeZoneAndTimeV_timeZone_oer_ext_arr_, 0, TimeZoneAndTimeV_timeZone_oer_p_};
const TTCN_Typedescriptor_t TimeZoneAndTimeV_timeZone_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV.timeZone", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TimeZoneAndTimeV_timeZone_xer_, &OCTETSTRING_json_, &TimeZoneAndTimeV_timeZone_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_timeZone_default_coding("RAW");
const TTCN_RAWdescriptor_t TimeZoneAndTimeV_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 TimeZoneAndTimeV
const TTCN_Typedescriptor_t TimeZoneAndTimeV_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeV", NULL, &TimeZoneAndTimeV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeV_default_coding("RAW");
UNIVERSAL_CHARSTRING TimeZoneAndTimeTV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t TimeZoneAndTimeTV_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 TimeZoneAndTimeTV
const TTCN_Typedescriptor_t TimeZoneAndTimeTV_descr_ = { "@MobileL3_MM_Types.TimeZoneAndTimeTV", NULL, &TimeZoneAndTimeTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TimeZoneAndTimeTV_default_coding("RAW");
const TTCN_Typedescriptor_t& CTS__Permission_descr_ = MobileL3__CommonIE__Types::Type2_descr_;
UNIVERSAL_CHARSTRING CTS__Permission_default_coding("RAW");
const XERdescriptor_t       LSA__IdentifierTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t LSA__IdentifierTLV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LSA__IdentifierTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.LSA_IdentifierTLV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &LSA__IdentifierTLV_elementIdentifier_xer_, &BITSTRING_json_, &LSA__IdentifierTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LSA__IdentifierTLV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       LSA__IdentifierTLV_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t LSA__IdentifierTLV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LSA__IdentifierTLV_spare_descr_ = { "@MobileL3_MM_Types.LSA_IdentifierTLV.spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &LSA__IdentifierTLV_spare_xer_, &BITSTRING_json_, &LSA__IdentifierTLV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LSA__IdentifierTLV_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t LSA__IdentifierTLV_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       LSA__IdentifierTLV_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 LSA__IdentifierTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LSA__IdentifierTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.LSA_IdentifierTLV.lengthIndicator", &INTEGER_ber_, &LSA__IdentifierTLV_lengthIndicator_raw_, &INTEGER_text_, &LSA__IdentifierTLV_lengthIndicator_xer_, &INTEGER_json_, &LSA__IdentifierTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LSA__IdentifierTLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       LSA__IdentifierV_lsa__id_xer_ = { {"lsa_id>\n", "lsa_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int LSA__IdentifierV_lsa__id_oer_ext_arr_[0] = {};
const int LSA__IdentifierV_lsa__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t LSA__IdentifierV_lsa__id_oer_ = { -1, TRUE, -1, FALSE, 0, 0, LSA__IdentifierV_lsa__id_oer_ext_arr_, 0, LSA__IdentifierV_lsa__id_oer_p_};
const TTCN_Typedescriptor_t LSA__IdentifierV_lsa__id_descr_ = { "@MobileL3_MM_Types.LSA_IdentifierV.lsa_id", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &LSA__IdentifierV_lsa__id_xer_, &OCTETSTRING_json_, &LSA__IdentifierV_lsa__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LSA__IdentifierV_lsa__id_default_coding("RAW");
const TTCN_RAWdescriptor_t LSA__IdentifierV_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 LSA__IdentifierV
const TTCN_Typedescriptor_t LSA__IdentifierV_descr_ = { "@MobileL3_MM_Types.LSA_IdentifierV", NULL, &LSA__IdentifierV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LSA__IdentifierV_default_coding("RAW");
UNIVERSAL_CHARSTRING LSA__IdentifierTLV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t LSA__IdentifierTLV_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 LSA__IdentifierTLV
const TTCN_Typedescriptor_t LSA__IdentifierTLV_descr_ = { "@MobileL3_MM_Types.LSA_IdentifierTLV", NULL, &LSA__IdentifierTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LSA__IdentifierTLV_default_coding("RAW");
const XERdescriptor_t       DaylightSavingTimeTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int DaylightSavingTimeTLV_elementIdentifier_oer_ext_arr_[0] = {};
const int DaylightSavingTimeTLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t DaylightSavingTimeTLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, DaylightSavingTimeTLV_elementIdentifier_oer_ext_arr_, 0, DaylightSavingTimeTLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t DaylightSavingTimeTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.DaylightSavingTimeTLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &DaylightSavingTimeTLV_elementIdentifier_xer_, &OCTETSTRING_json_, &DaylightSavingTimeTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DaylightSavingTimeTLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t DaylightSavingTimeTLV_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       DaylightSavingTimeTLV_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 DaylightSavingTimeTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DaylightSavingTimeTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.DaylightSavingTimeTLV.lengthIndicator", &INTEGER_ber_, &DaylightSavingTimeTLV_lengthIndicator_raw_, &INTEGER_text_, &DaylightSavingTimeTLV_lengthIndicator_xer_, &INTEGER_json_, &DaylightSavingTimeTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DaylightSavingTimeTLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       DaylightSavingTimeV_valueField_xer_ = { {"valueField>\n", "valueField>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DaylightSavingTimeV_valueField_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DaylightSavingTimeV_valueField_descr_ = { "@MobileL3_MM_Types.DaylightSavingTimeV.valueField", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &DaylightSavingTimeV_valueField_xer_, &BITSTRING_json_, &DaylightSavingTimeV_valueField_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DaylightSavingTimeV_valueField_default_coding("RAW");
const XERdescriptor_t       DaylightSavingTimeV_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DaylightSavingTimeV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DaylightSavingTimeV_spare_descr_ = { "@MobileL3_MM_Types.DaylightSavingTimeV.spare", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &DaylightSavingTimeV_spare_xer_, &BITSTRING_json_, &DaylightSavingTimeV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DaylightSavingTimeV_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t DaylightSavingTimeV_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 DaylightSavingTimeV
const TTCN_Typedescriptor_t DaylightSavingTimeV_descr_ = { "@MobileL3_MM_Types.DaylightSavingTimeV", NULL, &DaylightSavingTimeV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DaylightSavingTimeV_default_coding("RAW");
UNIVERSAL_CHARSTRING DaylightSavingTimeTLV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t DaylightSavingTimeTLV_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 DaylightSavingTimeTLV
const TTCN_Typedescriptor_t DaylightSavingTimeTLV_descr_ = { "@MobileL3_MM_Types.DaylightSavingTimeTLV", NULL, &DaylightSavingTimeTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DaylightSavingTimeTLV_default_coding("RAW");
const XERdescriptor_t       EmergencyNumberListTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int EmergencyNumberListTLV_elementIdentifier_oer_ext_arr_[0] = {};
const int EmergencyNumberListTLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t EmergencyNumberListTLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, EmergencyNumberListTLV_elementIdentifier_oer_ext_arr_, 0, EmergencyNumberListTLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t EmergencyNumberListTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.EmergencyNumberListTLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &EmergencyNumberListTLV_elementIdentifier_xer_, &OCTETSTRING_json_, &EmergencyNumberListTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyNumberListTLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t EmergencyNumberListTLV_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       EmergencyNumberListTLV_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 EmergencyNumberListTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t EmergencyNumberListTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.EmergencyNumberListTLV.lengthIndicator", &INTEGER_ber_, &EmergencyNumberListTLV_lengthIndicator_raw_, &INTEGER_text_, &EmergencyNumberListTLV_lengthIndicator_xer_, &INTEGER_json_, &EmergencyNumberListTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyNumberListTLV_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t EmergencyNumberListV_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 EmergencyNumberListV
const TTCN_Typedescriptor_t EmergencyNumberListV_descr_ = { "@MobileL3_MM_Types.EmergencyNumberListV", NULL, &EmergencyNumberListV_raw_, NULL, NULL, NULL, NULL, NULL, &EmergencyNumber_descr_, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t EmergencyNumber_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       EmergencyNumber_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 EmergencyNumber_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t EmergencyNumber_lengthIndicator_descr_ = { "@MobileL3_MM_Types.EmergencyNumber.lengthIndicator", &INTEGER_ber_, &EmergencyNumber_lengthIndicator_raw_, &INTEGER_text_, &EmergencyNumber_lengthIndicator_xer_, &INTEGER_json_, &EmergencyNumber_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyNumber_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       EmergencyServiceCategory_valueFiled_xer_ = { {"valueFiled>\n", "valueFiled>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t EmergencyServiceCategory_valueFiled_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t EmergencyServiceCategory_valueFiled_descr_ = { "@MobileL3_MM_Types.EmergencyServiceCategory.valueFiled", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &EmergencyServiceCategory_valueFiled_xer_, &BITSTRING_json_, &EmergencyServiceCategory_valueFiled_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyServiceCategory_valueFiled_default_coding("RAW");
const XERdescriptor_t       EmergencyServiceCategory_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t EmergencyServiceCategory_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t EmergencyServiceCategory_spare_descr_ = { "@MobileL3_MM_Types.EmergencyServiceCategory.spare", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &EmergencyServiceCategory_spare_xer_, &BITSTRING_json_, &EmergencyServiceCategory_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyServiceCategory_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t EmergencyServiceCategory_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 EmergencyServiceCategory
const TTCN_Typedescriptor_t EmergencyServiceCategory_descr_ = { "@MobileL3_MM_Types.EmergencyServiceCategory", NULL, &EmergencyServiceCategory_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyServiceCategory_default_coding("RAW");
UNIVERSAL_CHARSTRING EmergencyNumber_emergencyServiceCategory_default_coding("RAW");
const XERdescriptor_t       EmergencyNumber_emergencyNumber_xer_ = { {"emergencyNumber>\n", "emergencyNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t EmergencyNumber_emergencyNumber_descr_ = { "@MobileL3_MM_Types.EmergencyNumber.emergencyNumber", NULL, &HEXSTRING_raw_, NULL, &EmergencyNumber_emergencyNumber_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyNumber_emergencyNumber_default_coding("RAW");
const TTCN_RAWdescriptor_t EmergencyNumber_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 EmergencyNumber
const TTCN_Typedescriptor_t EmergencyNumber_descr_ = { "@MobileL3_MM_Types.EmergencyNumber", NULL, &EmergencyNumber_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyNumber_default_coding("RAW");
UNIVERSAL_CHARSTRING EmergencyNumberListV_0_default_coding("RAW");
UNIVERSAL_CHARSTRING EmergencyNumberListV_default_coding("RAW");
UNIVERSAL_CHARSTRING EmergencyNumberListTLV_emergencyNumberListV_default_coding("RAW");
const TTCN_RAWdescriptor_t EmergencyNumberListTLV_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 EmergencyNumberListTLV
const TTCN_Typedescriptor_t EmergencyNumberListTLV_descr_ = { "@MobileL3_MM_Types.EmergencyNumberListTLV", NULL, &EmergencyNumberListTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING EmergencyNumberListTLV_default_coding("RAW");
const XERdescriptor_t       MM__TimerTLV_elementIdentifier_xer_ = { {"elementIdentifier>\n", "elementIdentifier>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int MM__TimerTLV_elementIdentifier_oer_ext_arr_[0] = {};
const int MM__TimerTLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t MM__TimerTLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, MM__TimerTLV_elementIdentifier_oer_ext_arr_, 0, MM__TimerTLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t MM__TimerTLV_elementIdentifier_descr_ = { "@MobileL3_MM_Types.MM_TimerTLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &MM__TimerTLV_elementIdentifier_xer_, &OCTETSTRING_json_, &MM__TimerTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MM__TimerTLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t MM__TimerTLV_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       MM__TimerTLV_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 MM__TimerTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MM__TimerTLV_lengthIndicator_descr_ = { "@MobileL3_MM_Types.MM_TimerTLV.lengthIndicator", &INTEGER_ber_, &MM__TimerTLV_lengthIndicator_raw_, &INTEGER_text_, &MM__TimerTLV_lengthIndicator_xer_, &INTEGER_json_, &MM__TimerTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MM__TimerTLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       MM__TimerV_timerValue_xer_ = { {"timerValue>\n", "timerValue>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MM__TimerV_timerValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MM__TimerV_timerValue_descr_ = { "@MobileL3_MM_Types.MM_TimerV.timerValue", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &MM__TimerV_timerValue_xer_, &BITSTRING_json_, &MM__TimerV_timerValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MM__TimerV_timerValue_default_coding("RAW");
const XERdescriptor_t       MM__TimerV_unit_xer_ = { {"unit>\n", "unit>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MM__TimerV_unit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MM__TimerV_unit_descr_ = { "@MobileL3_MM_Types.MM_TimerV.unit", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &MM__TimerV_unit_xer_, &BITSTRING_json_, &MM__TimerV_unit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MM__TimerV_unit_default_coding("RAW");
const TTCN_RAWdescriptor_t MM__TimerV_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 MM__TimerV
const TTCN_Typedescriptor_t MM__TimerV_descr_ = { "@MobileL3_MM_Types.MM_TimerV", NULL, &MM__TimerV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MM__TimerV_default_coding("RAW");
UNIVERSAL_CHARSTRING MM__TimerTLV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t MM__TimerTLV_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 MM__TimerTLV
const TTCN_Typedescriptor_t MM__TimerTLV_descr_ = { "@MobileL3_MM_Types.MM_TimerTLV", NULL, &MM__TimerTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MM__TimerTLV_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationReject_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationReject_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationReject_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationReject.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__AuthenticationReject_messageType_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationReject_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationReject_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationReject_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationReject_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationReject_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationReject.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__AuthenticationReject_nsd_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationReject_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationReject_nsd_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__AuthenticationReject_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 PDU__ML3__AuthenticationReject
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationReject_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationReject", NULL, &PDU__ML3__AuthenticationReject_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationReject_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationRequest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationRequest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationRequest_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__AuthenticationRequest_messageType_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationRequest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationRequest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationRequest_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationRequest_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationRequest_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__AuthenticationRequest_nsd_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationRequest_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationRequest_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationRequest_cipheringKeySequenceNumber_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationRequest_spare2__4_xer_ = { {"spare2_4>\n", "spare2_4>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationRequest_spare2__4_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationRequest_spare2__4_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.spare2_4", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__ML3__AuthenticationRequest_spare2__4_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationRequest_spare2__4_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationRequest_spare2__4_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationRequest_authenticationParRAND_xer_ = { {"authenticationParRAND>\n", "authenticationParRAND>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__ML3__AuthenticationRequest_authenticationParRAND_oer_ext_arr_[0] = {};
const int PDU__ML3__AuthenticationRequest_authenticationParRAND_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationRequest_authenticationParRAND_oer_ = { -1, TRUE, 16, FALSE, 0, 0, PDU__ML3__AuthenticationRequest_authenticationParRAND_oer_ext_arr_, 0, PDU__ML3__AuthenticationRequest_authenticationParRAND_oer_p_};
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationRequest_authenticationParRAND_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.authenticationParRAND", &OCTETSTRING_ber_, &General__Types::OCT16_raw_, &OCTETSTRING_text_, &PDU__ML3__AuthenticationRequest_authenticationParRAND_xer_, &OCTETSTRING_json_, &PDU__ML3__AuthenticationRequest_authenticationParRAND_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationRequest_authenticationParRAND_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__AuthenticationRequest_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 PDU__ML3__AuthenticationRequest
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationRequest_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest", NULL, &PDU__ML3__AuthenticationRequest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationRequest_authenticationParAUTN_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationRequest_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationResponse_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationResponse_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationResponse_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__AuthenticationResponse_messageType_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationResponse_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationResponse_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationResponse_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationResponse_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationResponse_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__AuthenticationResponse_nsd_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationResponse_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationResponse_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationResponse_authenticationParSRES_xer_ = { {"authenticationParSRES>\n", "authenticationParSRES>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__ML3__AuthenticationResponse_authenticationParSRES_oer_ext_arr_[0] = {};
const int PDU__ML3__AuthenticationResponse_authenticationParSRES_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationResponse_authenticationParSRES_oer_ = { -1, TRUE, 4, FALSE, 0, 0, PDU__ML3__AuthenticationResponse_authenticationParSRES_oer_ext_arr_, 0, PDU__ML3__AuthenticationResponse_authenticationParSRES_oer_p_};
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationResponse_authenticationParSRES_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.authenticationParSRES", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &PDU__ML3__AuthenticationResponse_authenticationParSRES_xer_, &OCTETSTRING_json_, &PDU__ML3__AuthenticationResponse_authenticationParSRES_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationResponse_authenticationParSRES_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__AuthenticationResponse_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 PDU__ML3__AuthenticationResponse
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationResponse_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse", NULL, &PDU__ML3__AuthenticationResponse_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationResponse_authenticationParSRESext_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationResponse_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationFailure_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationFailure_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationFailure_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__AuthenticationFailure_messageType_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationFailure_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationFailure_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationFailure_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationFailure_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationFailure_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__AuthenticationFailure_nsd_xer_, &BITSTRING_json_, &PDU__ML3__AuthenticationFailure_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationFailure_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__AuthenticationFailure_rejectCause_xer_ = { {"rejectCause>\n", "rejectCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__ML3__AuthenticationFailure_rejectCause_oer_ext_arr_[0] = {};
const int PDU__ML3__AuthenticationFailure_rejectCause_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__ML3__AuthenticationFailure_rejectCause_oer_ = { -1, TRUE, 1, FALSE, 0, 0, PDU__ML3__AuthenticationFailure_rejectCause_oer_ext_arr_, 0, PDU__ML3__AuthenticationFailure_rejectCause_oer_p_};
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationFailure_rejectCause_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.rejectCause", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &PDU__ML3__AuthenticationFailure_rejectCause_xer_, &OCTETSTRING_json_, &PDU__ML3__AuthenticationFailure_rejectCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationFailure_rejectCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__AuthenticationFailure_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 PDU__ML3__AuthenticationFailure
const TTCN_Typedescriptor_t PDU__ML3__AuthenticationFailure_descr_ = { "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure", NULL, &PDU__ML3__AuthenticationFailure_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationFailure_authenticationParFailure_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__AuthenticationFailure_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMReestablishmentRequest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMReestablishmentRequest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMReestablishmentRequest_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__CMReestablishmentRequest_messageType_xer_, &BITSTRING_json_, &PDU__ML3__CMReestablishmentRequest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMReestablishmentRequest_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMReestablishmentRequest_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMReestablishmentRequest_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__CMReestablishmentRequest_nsd_xer_, &BITSTRING_json_, &PDU__ML3__CMReestablishmentRequest_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_cipheringKeySequenceNumber_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMReestablishmentRequest_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMReestablishmentRequest_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMReestablishmentRequest_spare_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.spare", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__ML3__CMReestablishmentRequest_spare_xer_, &BITSTRING_json_, &PDU__ML3__CMReestablishmentRequest_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_spare_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_mobileStationClassmark2_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_mobileIdentityLV_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__CMReestablishmentRequest_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 PDU__ML3__CMReestablishmentRequest
const TTCN_Typedescriptor_t PDU__ML3__CMReestablishmentRequest_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest", NULL, &PDU__ML3__CMReestablishmentRequest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_locationAreaIdentification_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_deviceProperties_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMReestablishmentRequest_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceAccept_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceAccept_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceAccept_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceAccept.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__CMServiceAccept_messageType_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceAccept_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceAccept_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceAccept_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceAccept_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceAccept_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceAccept.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__CMServiceAccept_nsd_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceAccept_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceAccept_nsd_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__CMServiceAccept_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 PDU__ML3__CMServiceAccept
const TTCN_Typedescriptor_t PDU__ML3__CMServiceAccept_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceAccept", NULL, &PDU__ML3__CMServiceAccept_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceAccept_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServicePrompt_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServicePrompt_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServicePrompt_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__CMServicePrompt_messageType_xer_, &BITSTRING_json_, &PDU__ML3__CMServicePrompt_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServicePrompt_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServicePrompt_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServicePrompt_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServicePrompt_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__CMServicePrompt_nsd_xer_, &BITSTRING_json_, &PDU__ML3__CMServicePrompt_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServicePrompt_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServicePrompt_pd__sapi_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__CMServicePrompt_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 PDU__ML3__CMServicePrompt
const TTCN_Typedescriptor_t PDU__ML3__CMServicePrompt_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt", NULL, &PDU__ML3__CMServicePrompt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServicePrompt_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceReject_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceReject_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceReject_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceReject.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__CMServiceReject_messageType_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceReject_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceReject_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceReject_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceReject_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceReject_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceReject.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__CMServiceReject_nsd_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceReject_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceReject_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceReject_rejectCause_xer_ = { {"rejectCause>\n", "rejectCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__ML3__CMServiceReject_rejectCause_oer_ext_arr_[0] = {};
const int PDU__ML3__CMServiceReject_rejectCause_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__ML3__CMServiceReject_rejectCause_oer_ = { -1, TRUE, 1, FALSE, 0, 0, PDU__ML3__CMServiceReject_rejectCause_oer_ext_arr_, 0, PDU__ML3__CMServiceReject_rejectCause_oer_p_};
const TTCN_Typedescriptor_t PDU__ML3__CMServiceReject_rejectCause_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceReject.rejectCause", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &PDU__ML3__CMServiceReject_rejectCause_xer_, &OCTETSTRING_json_, &PDU__ML3__CMServiceReject_rejectCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceReject_rejectCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__CMServiceReject_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 PDU__ML3__CMServiceReject
const TTCN_Typedescriptor_t PDU__ML3__CMServiceReject_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceReject", NULL, &PDU__ML3__CMServiceReject_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceReject_t3246__Value_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceReject_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceAbort_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceAbort_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceAbort_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceAbort.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__CMServiceAbort_messageType_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceAbort_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceAbort_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceAbort_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceAbort_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceAbort_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceAbort.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__CMServiceAbort_nsd_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceAbort_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceAbort_nsd_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__CMServiceAbort_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 PDU__ML3__CMServiceAbort
const TTCN_Typedescriptor_t PDU__ML3__CMServiceAbort_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceAbort", NULL, &PDU__ML3__CMServiceAbort_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceAbort_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__Abort_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__Abort_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__Abort_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_Abort.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__Abort_messageType_xer_, &BITSTRING_json_, &PDU__ML3__Abort_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__Abort_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__Abort_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__Abort_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__Abort_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_Abort.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__Abort_nsd_xer_, &BITSTRING_json_, &PDU__ML3__Abort_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__Abort_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__Abort_rejectCause_xer_ = { {"rejectCause>\n", "rejectCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__ML3__Abort_rejectCause_oer_ext_arr_[0] = {};
const int PDU__ML3__Abort_rejectCause_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__ML3__Abort_rejectCause_oer_ = { -1, TRUE, 1, FALSE, 0, 0, PDU__ML3__Abort_rejectCause_oer_ext_arr_, 0, PDU__ML3__Abort_rejectCause_oer_p_};
const TTCN_Typedescriptor_t PDU__ML3__Abort_rejectCause_descr_ = { "@MobileL3_MM_Types.PDU_ML3_Abort.rejectCause", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &PDU__ML3__Abort_rejectCause_xer_, &OCTETSTRING_json_, &PDU__ML3__Abort_rejectCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__Abort_rejectCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__Abort_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 PDU__ML3__Abort
const TTCN_Typedescriptor_t PDU__ML3__Abort_descr_ = { "@MobileL3_MM_Types.PDU_ML3_Abort", NULL, &PDU__ML3__Abort_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__Abort_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceRequest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceRequest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceRequest_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__CMServiceRequest_messageType_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceRequest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceRequest_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceRequest_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceRequest_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__CMServiceRequest_nsd_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceRequest_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__CMServiceRequest_cm__ServiceType_xer_ = { {"cm_ServiceType>\n", "cm_ServiceType>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__CMServiceRequest_cm__ServiceType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__CMServiceRequest_cm__ServiceType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest.cm_ServiceType", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__ML3__CMServiceRequest_cm__ServiceType_xer_, &BITSTRING_json_, &PDU__ML3__CMServiceRequest_cm__ServiceType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_cm__ServiceType_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_cipheringKeySequenceNumber_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_mobileStationClassmark2_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_mobileIdentity_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__CMServiceRequest_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 PDU__ML3__CMServiceRequest
const TTCN_Typedescriptor_t PDU__ML3__CMServiceRequest_descr_ = { "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest", NULL, &PDU__ML3__CMServiceRequest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_priorityLevel_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_additionalUpdateParameterTV_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_deviceProperties_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__CMServiceRequest_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IdentityRequest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IdentityRequest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IdentityRequest_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityRequest.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__IdentityRequest_messageType_xer_, &BITSTRING_json_, &PDU__ML3__IdentityRequest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityRequest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IdentityRequest_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IdentityRequest_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IdentityRequest_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityRequest.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__IdentityRequest_nsd_xer_, &BITSTRING_json_, &PDU__ML3__IdentityRequest_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityRequest_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IdentityRequest_identityType_xer_ = { {"identityType>\n", "identityType>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IdentityRequest_identityType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IdentityRequest_identityType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityRequest.identityType", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &PDU__ML3__IdentityRequest_identityType_xer_, &BITSTRING_json_, &PDU__ML3__IdentityRequest_identityType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityRequest_identityType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IdentityRequest_spare1__5_xer_ = { {"spare1_5>\n", "spare1_5>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IdentityRequest_spare1__5_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IdentityRequest_spare1__5_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityRequest.spare1_5", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &PDU__ML3__IdentityRequest_spare1__5_xer_, &BITSTRING_json_, &PDU__ML3__IdentityRequest_spare1__5_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityRequest_spare1__5_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__IdentityRequest_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 PDU__ML3__IdentityRequest
const TTCN_Typedescriptor_t PDU__ML3__IdentityRequest_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityRequest", NULL, &PDU__ML3__IdentityRequest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityRequest_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IdentityResponse_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IdentityResponse_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IdentityResponse_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityResponse.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__IdentityResponse_messageType_xer_, &BITSTRING_json_, &PDU__ML3__IdentityResponse_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityResponse_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IdentityResponse_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IdentityResponse_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IdentityResponse_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityResponse.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__IdentityResponse_nsd_xer_, &BITSTRING_json_, &PDU__ML3__IdentityResponse_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityResponse_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__IdentityResponse_mobileIdentityLV_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__IdentityResponse_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 PDU__ML3__IdentityResponse
const TTCN_Typedescriptor_t PDU__ML3__IdentityResponse_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IdentityResponse", NULL, &PDU__ML3__IdentityResponse_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IdentityResponse_p__TMSI__TypeTV_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__IdentityResponse_routingAreaIdentification2TLV_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__IdentityResponse_p__TMSISignature2TLV_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__IdentityResponse_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IMSI__DetachIndication_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IMSI__DetachIndication_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IMSI__DetachIndication_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__IMSI__DetachIndication_messageType_xer_, &BITSTRING_json_, &PDU__ML3__IMSI__DetachIndication_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IMSI__DetachIndication_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__IMSI__DetachIndication_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__IMSI__DetachIndication_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__IMSI__DetachIndication_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__IMSI__DetachIndication_nsd_xer_, &BITSTRING_json_, &PDU__ML3__IMSI__DetachIndication_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IMSI__DetachIndication_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__IMSI__DetachIndication_mobileStationClassmark1_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__IMSI__DetachIndication_mobileIdentityLV_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__IMSI__DetachIndication_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 PDU__ML3__IMSI__DetachIndication
const TTCN_Typedescriptor_t PDU__ML3__IMSI__DetachIndication_descr_ = { "@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication", NULL, &PDU__ML3__IMSI__DetachIndication_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__IMSI__DetachIndication_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__LocationUpdateAccept_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__LocationUpdateAccept_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateAccept_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__LocationUpdateAccept_messageType_xer_, &BITSTRING_json_, &PDU__ML3__LocationUpdateAccept_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__LocationUpdateAccept_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__LocationUpdateAccept_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateAccept_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__LocationUpdateAccept_nsd_xer_, &BITSTRING_json_, &PDU__ML3__LocationUpdateAccept_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_locationAreaIdentification_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__LocationUpdateAccept_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 PDU__ML3__LocationUpdateAccept
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateAccept_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept", NULL, &PDU__ML3__LocationUpdateAccept_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_mobileIdentityTLV_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_followOnProceed_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_cTS__Permission_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_equivalentPLMNs_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_emergencyNumberList_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_perMS__T3212_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateAccept_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__LocationUpdateReject_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__LocationUpdateReject_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateReject_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__LocationUpdateReject_messageType_xer_, &BITSTRING_json_, &PDU__ML3__LocationUpdateReject_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateReject_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__LocationUpdateReject_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__LocationUpdateReject_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateReject_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__LocationUpdateReject_nsd_xer_, &BITSTRING_json_, &PDU__ML3__LocationUpdateReject_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateReject_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__LocationUpdateReject_rejectCause_xer_ = { {"rejectCause>\n", "rejectCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__ML3__LocationUpdateReject_rejectCause_oer_ext_arr_[0] = {};
const int PDU__ML3__LocationUpdateReject_rejectCause_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__ML3__LocationUpdateReject_rejectCause_oer_ = { -1, TRUE, 1, FALSE, 0, 0, PDU__ML3__LocationUpdateReject_rejectCause_oer_ext_arr_, 0, PDU__ML3__LocationUpdateReject_rejectCause_oer_p_};
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateReject_rejectCause_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.rejectCause", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &PDU__ML3__LocationUpdateReject_rejectCause_xer_, &OCTETSTRING_json_, &PDU__ML3__LocationUpdateReject_rejectCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateReject_rejectCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__LocationUpdateReject_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 PDU__ML3__LocationUpdateReject
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateReject_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject", NULL, &PDU__ML3__LocationUpdateReject_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateReject_t3246__Value_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateReject_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__LocationUpdateRequest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__LocationUpdateRequest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateRequest_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__LocationUpdateRequest_messageType_xer_, &BITSTRING_json_, &PDU__ML3__LocationUpdateRequest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__LocationUpdateRequest_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__LocationUpdateRequest_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateRequest_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__LocationUpdateRequest_nsd_xer_, &BITSTRING_json_, &PDU__ML3__LocationUpdateRequest_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_locationUpdatingType_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_cipheringKeySequenceNumber_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_locationAreaIdentification_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_mobileStationClassmark1_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_mobileIdentityLV_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__LocationUpdateRequest_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 PDU__ML3__LocationUpdateRequest
const TTCN_Typedescriptor_t PDU__ML3__LocationUpdateRequest_descr_ = { "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest", NULL, &PDU__ML3__LocationUpdateRequest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_classmarkInformationType2__forUMTS_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_additionalUpdateParameterTV_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_deviceProperties_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_mS__NetworkFeatureSupport_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__LocationUpdateRequest_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MMInformation_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__MMInformation_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__MMInformation_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMInformation.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__MMInformation_messageType_xer_, &BITSTRING_json_, &PDU__ML3__MMInformation_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MMInformation_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__MMInformation_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__MMInformation_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMInformation.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__MMInformation_nsd_xer_, &BITSTRING_json_, &PDU__ML3__MMInformation_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_nsd_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__MMInformation_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 PDU__ML3__MMInformation
const TTCN_Typedescriptor_t PDU__ML3__MMInformation_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMInformation", NULL, &PDU__ML3__MMInformation_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_fullNetworkName_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_shortNetworkName_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_localtimeZone_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_univTime_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_lSAIdentity_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_networkDST_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MMInformation_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MMStatus_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__MMStatus_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__MMStatus_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMStatus.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__MMStatus_messageType_xer_, &BITSTRING_json_, &PDU__ML3__MMStatus_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMStatus_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MMStatus_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__MMStatus_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__MMStatus_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMStatus.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__MMStatus_nsd_xer_, &BITSTRING_json_, &PDU__ML3__MMStatus_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMStatus_nsd_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MMStatus_rejectCause_xer_ = { {"rejectCause>\n", "rejectCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__ML3__MMStatus_rejectCause_oer_ext_arr_[0] = {};
const int PDU__ML3__MMStatus_rejectCause_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__ML3__MMStatus_rejectCause_oer_ = { -1, TRUE, 1, FALSE, 0, 0, PDU__ML3__MMStatus_rejectCause_oer_ext_arr_, 0, PDU__ML3__MMStatus_rejectCause_oer_p_};
const TTCN_Typedescriptor_t PDU__ML3__MMStatus_rejectCause_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMStatus.rejectCause", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &PDU__ML3__MMStatus_rejectCause_xer_, &OCTETSTRING_json_, &PDU__ML3__MMStatus_rejectCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMStatus_rejectCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__MMStatus_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 PDU__ML3__MMStatus
const TTCN_Typedescriptor_t PDU__ML3__MMStatus_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMStatus", NULL, &PDU__ML3__MMStatus_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMStatus_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__TMSI__ReallocationCommand_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__TMSI__ReallocationCommand_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__TMSI__ReallocationCommand_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__TMSI__ReallocationCommand_messageType_xer_, &BITSTRING_json_, &PDU__ML3__TMSI__ReallocationCommand_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationCommand_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__TMSI__ReallocationCommand_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__TMSI__ReallocationCommand_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__TMSI__ReallocationCommand_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__TMSI__ReallocationCommand_nsd_xer_, &BITSTRING_json_, &PDU__ML3__TMSI__ReallocationCommand_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationCommand_nsd_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationCommand_locationAreaIdentification_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationCommand_mobileIdentity_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__TMSI__ReallocationCommand_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 PDU__ML3__TMSI__ReallocationCommand
const TTCN_Typedescriptor_t PDU__ML3__TMSI__ReallocationCommand_descr_ = { "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand", NULL, &PDU__ML3__TMSI__ReallocationCommand_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationCommand_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__TMSI__ReallocationComplete_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__TMSI__ReallocationComplete_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__TMSI__ReallocationComplete_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__TMSI__ReallocationComplete_messageType_xer_, &BITSTRING_json_, &PDU__ML3__TMSI__ReallocationComplete_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationComplete_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__TMSI__ReallocationComplete_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__TMSI__ReallocationComplete_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__TMSI__ReallocationComplete_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__TMSI__ReallocationComplete_nsd_xer_, &BITSTRING_json_, &PDU__ML3__TMSI__ReallocationComplete_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationComplete_nsd_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__TMSI__ReallocationComplete_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 PDU__ML3__TMSI__ReallocationComplete
const TTCN_Typedescriptor_t PDU__ML3__TMSI__ReallocationComplete_descr_ = { "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete", NULL, &PDU__ML3__TMSI__ReallocationComplete_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__TMSI__ReallocationComplete_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MMNull_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__MMNull_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__MMNull_messageType_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMNull.messageType", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &PDU__ML3__MMNull_messageType_xer_, &BITSTRING_json_, &PDU__ML3__MMNull_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMNull_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MMNull_nsd_xer_ = { {"nsd>\n", "nsd>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__MMNull_nsd_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__MMNull_nsd_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMNull.nsd", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PDU__ML3__MMNull_nsd_xer_, &BITSTRING_json_, &PDU__ML3__MMNull_nsd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMNull_nsd_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__MMNull_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 PDU__ML3__MMNull
const TTCN_Typedescriptor_t PDU__ML3__MMNull_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MMNull", NULL, &PDU__ML3__MMNull_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MMNull_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__MM_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 PDU__ML3__MM
const TTCN_Typedescriptor_t PDU__ML3__MM_descr_ = { "@MobileL3_MM_Types.PDU_ML3_MM", NULL, &PDU__ML3__MM_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MM_imsiDetachIndication_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_locationUpdateAccept_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_locationUpdateReject_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_locationUpdateRequest_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_authenticationReject_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_authenticationRequest_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_authenticationResponse_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_authenticationFailure_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_identityRequest_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_identityResponse_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_tmsiReallocCommand_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_tmsiReallocComplete_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_cMServiceAbort_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_cMServiceAccept_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_cMServiceReject_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_cMServiceRequest_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_cMServicePrompt_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_cMReEstablReq_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_abort_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_mMNull_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_mMStatus_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_mMInformation_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__ML3__MM_default_coding("RAW");
TTCN_Module module_object("MobileL3_MM_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 */

AuthenticationParameterRANDTV::AuthenticationParameterRANDTV()
{
}

AuthenticationParameterRANDTV::AuthenticationParameterRANDTV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_randValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_randValue(par_randValue)
{
}

AuthenticationParameterRANDTV::AuthenticationParameterRANDTV(const AuthenticationParameterRANDTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.AuthenticationParameterRANDTV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.randValue().is_bound()) field_randValue = other_value.randValue();
else field_randValue.clean_up();
}

void AuthenticationParameterRANDTV::clean_up()
{
field_elementIdentifier.clean_up();
field_randValue.clean_up();
}

const TTCN_Typedescriptor_t* AuthenticationParameterRANDTV::get_descriptor() const { return &AuthenticationParameterRANDTV_descr_; }
AuthenticationParameterRANDTV& AuthenticationParameterRANDTV::operator=(const AuthenticationParameterRANDTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.AuthenticationParameterRANDTV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.randValue().is_bound()) field_randValue = other_value.randValue();
  else field_randValue.clean_up();
}
return *this;
}

boolean AuthenticationParameterRANDTV::operator==(const AuthenticationParameterRANDTV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_randValue==other_value.field_randValue;
}

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

void AuthenticationParameterRANDTV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (randValue().is_bound()) randValue().set_implicit_omit();
}

void AuthenticationParameterRANDTV::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_MM_Types.AuthenticationParameterRANDTV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) randValue().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "randValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          randValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.AuthenticationParameterRANDTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.AuthenticationParameterRANDTV");
  }
}

void AuthenticationParameterRANDTV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_randValue.encode_text(text_buf);
}

void AuthenticationParameterRANDTV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_randValue.decode_text(text_buf);
}

void AuthenticationParameterRANDTV::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 AuthenticationParameterRANDTV::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 AuthenticationParameterRANDTV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT16_descr_.raw->forceomit);
  decoded_field_length = field_randValue.RAW_decode(General__Types::OCT16_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  os_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 AuthenticationParameterRANDTV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT16_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_randValue.RAW_encode(General__Types::OCT16_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_0) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct AuthenticationParameterRANDTV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_randValue;
};

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

void AuthenticationParameterRANDTV_template::copy_value(const AuthenticationParameterRANDTV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.randValue().is_bound()) {
  single_value->field_randValue = other_value.randValue();
} else {
  single_value->field_randValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AuthenticationParameterRANDTV_template::copy_template(const AuthenticationParameterRANDTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.randValue().get_selection()) {
single_value->field_randValue = other_value.randValue();
} else {
single_value->field_randValue.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 AuthenticationParameterRANDTV_template[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 AuthenticationParameterRANDTV_template(*other_value.implication_.precondition);
implication_.implied_template = new AuthenticationParameterRANDTV_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_MM_Types.AuthenticationParameterRANDTV.");
break;
}
set_selection(other_value);
}

AuthenticationParameterRANDTV_template::AuthenticationParameterRANDTV_template()
{
}

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

AuthenticationParameterRANDTV_template::AuthenticationParameterRANDTV_template(const AuthenticationParameterRANDTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AuthenticationParameterRANDTV_template::match(const AuthenticationParameterRANDTV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.randValue().is_bound()) return FALSE;
if(!single_value->field_randValue.match(other_value.randValue(), 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_MM_Types.AuthenticationParameterRANDTV.");
}
return FALSE;
}

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

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

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

AuthenticationParameterRANDTV AuthenticationParameterRANDTV_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_MM_Types.AuthenticationParameterRANDTV.");
AuthenticationParameterRANDTV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_randValue.is_bound()) {
ret_val.randValue() = single_value->field_randValue.valueof();
}
return ret_val;
}

void AuthenticationParameterRANDTV_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_MM_Types.AuthenticationParameterRANDTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AuthenticationParameterRANDTV_template[list_length];
}

AuthenticationParameterRANDTV_template& AuthenticationParameterRANDTV_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_MM_Types.AuthenticationParameterRANDTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.AuthenticationParameterRANDTV.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& AuthenticationParameterRANDTV_template::randValue()
{
set_specific();
return single_value->field_randValue;
}

const OCTETSTRING_template& AuthenticationParameterRANDTV_template::randValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field randValue of a non-specific template of type @MobileL3_MM_Types.AuthenticationParameterRANDTV.");
return single_value->field_randValue;
}

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

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

void AuthenticationParameterRANDTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_randValue.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_MM_Types.AuthenticationParameterRANDTV.");
}
}

void AuthenticationParameterRANDTV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_randValue.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 AuthenticationParameterRANDTV_template[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_MM_Types.AuthenticationParameterRANDTV.");
}
}

void AuthenticationParameterRANDTV_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: {
    AuthenticationParameterRANDTV_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_MM_Types.AuthenticationParameterRANDTV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) randValue().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "randValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          randValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.AuthenticationParameterRANDTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AuthenticationParameterRANDTV_template* precondition = new AuthenticationParameterRANDTV_template;
    precondition->set_param(*param.get_elem(0));
    AuthenticationParameterRANDTV_template* implied_template = new AuthenticationParameterRANDTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AuthenticationParameterRANDTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.AuthenticationParameterRANDTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AuthenticationParameterRANDTV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationParameterRANDTV");
single_value->field_randValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationParameterRANDTV");
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_MM_Types.AuthenticationParameterRANDTV");
}

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

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

AuthenticationParameterAUTNTLV::AuthenticationParameterAUTNTLV()
{
}

AuthenticationParameterAUTNTLV::AuthenticationParameterAUTNTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_autnValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_autnValue(par_autnValue)
{
}

AuthenticationParameterAUTNTLV::AuthenticationParameterAUTNTLV(const AuthenticationParameterAUTNTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.AuthenticationParameterAUTNTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.autnValue().is_bound()) field_autnValue = other_value.autnValue();
else field_autnValue.clean_up();
}

void AuthenticationParameterAUTNTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_autnValue.clean_up();
}

const TTCN_Typedescriptor_t* AuthenticationParameterAUTNTLV::get_descriptor() const { return &AuthenticationParameterAUTNTLV_descr_; }
AuthenticationParameterAUTNTLV& AuthenticationParameterAUTNTLV::operator=(const AuthenticationParameterAUTNTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.AuthenticationParameterAUTNTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.autnValue().is_bound()) field_autnValue = other_value.autnValue();
  else field_autnValue.clean_up();
}
return *this;
}

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

boolean AuthenticationParameterAUTNTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_autnValue.is_bound());
}
boolean AuthenticationParameterAUTNTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_autnValue.is_value();
}
void AuthenticationParameterAUTNTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", autnValue := ");
field_autnValue.log();
TTCN_Logger::log_event_str(" }");
}

void AuthenticationParameterAUTNTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (autnValue().is_bound()) autnValue().set_implicit_omit();
}

void AuthenticationParameterAUTNTLV::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_MM_Types.AuthenticationParameterAUTNTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) autnValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "autnValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          autnValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.AuthenticationParameterAUTNTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV");
  }
}

void AuthenticationParameterAUTNTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_autnValue.encode_text(text_buf);
}

void AuthenticationParameterAUTNTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_autnValue.decode_text(text_buf);
}

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

int AuthenticationParameterAUTNTLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AuthenticationParameterAUTNTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT16_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &AuthenticationParameterAUTNTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_autnValue.RAW_encode(General__Types::OCT16_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct AuthenticationParameterAUTNTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_autnValue;
};

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

void AuthenticationParameterAUTNTLV_template::copy_value(const AuthenticationParameterAUTNTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.autnValue().is_bound()) {
  single_value->field_autnValue = other_value.autnValue();
} else {
  single_value->field_autnValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AuthenticationParameterAUTNTLV_template::copy_template(const AuthenticationParameterAUTNTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.autnValue().get_selection()) {
single_value->field_autnValue = other_value.autnValue();
} else {
single_value->field_autnValue.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 AuthenticationParameterAUTNTLV_template[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 AuthenticationParameterAUTNTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new AuthenticationParameterAUTNTLV_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_MM_Types.AuthenticationParameterAUTNTLV.");
break;
}
set_selection(other_value);
}

AuthenticationParameterAUTNTLV_template::AuthenticationParameterAUTNTLV_template()
{
}

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

AuthenticationParameterAUTNTLV_template::AuthenticationParameterAUTNTLV_template(const AuthenticationParameterAUTNTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AuthenticationParameterAUTNTLV_template::match(const AuthenticationParameterAUTNTLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.autnValue().is_bound()) return FALSE;
if(!single_value->field_autnValue.match(other_value.autnValue(), 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_MM_Types.AuthenticationParameterAUTNTLV.");
}
return FALSE;
}

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

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

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

AuthenticationParameterAUTNTLV AuthenticationParameterAUTNTLV_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_MM_Types.AuthenticationParameterAUTNTLV.");
AuthenticationParameterAUTNTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_autnValue.is_bound()) {
ret_val.autnValue() = single_value->field_autnValue.valueof();
}
return ret_val;
}

void AuthenticationParameterAUTNTLV_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_MM_Types.AuthenticationParameterAUTNTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AuthenticationParameterAUTNTLV_template[list_length];
}

AuthenticationParameterAUTNTLV_template& AuthenticationParameterAUTNTLV_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_MM_Types.AuthenticationParameterAUTNTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.AuthenticationParameterAUTNTLV.");
return value_list.list_value[list_index];
}

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

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

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

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

OCTETSTRING_template& AuthenticationParameterAUTNTLV_template::autnValue()
{
set_specific();
return single_value->field_autnValue;
}

const OCTETSTRING_template& AuthenticationParameterAUTNTLV_template::autnValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field autnValue of a non-specific template of type @MobileL3_MM_Types.AuthenticationParameterAUTNTLV.");
return single_value->field_autnValue;
}

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

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

void AuthenticationParameterAUTNTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_autnValue.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_MM_Types.AuthenticationParameterAUTNTLV.");
}
}

void AuthenticationParameterAUTNTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_autnValue.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 AuthenticationParameterAUTNTLV_template[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_MM_Types.AuthenticationParameterAUTNTLV.");
}
}

void AuthenticationParameterAUTNTLV_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: {
    AuthenticationParameterAUTNTLV_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_MM_Types.AuthenticationParameterAUTNTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) autnValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "autnValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          autnValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.AuthenticationParameterAUTNTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AuthenticationParameterAUTNTLV_template* precondition = new AuthenticationParameterAUTNTLV_template;
    precondition->set_param(*param.get_elem(0));
    AuthenticationParameterAUTNTLV_template* implied_template = new AuthenticationParameterAUTNTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AuthenticationParameterAUTNTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AuthenticationParameterAUTNTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV");
single_value->field_autnValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationParameterAUTNTLV");
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_MM_Types.AuthenticationParameterAUTNTLV");
}

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

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

AuthenticationResponseParameterTV::AuthenticationResponseParameterTV()
{
}

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

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

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

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

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

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

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

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

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

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

void AuthenticationResponseParameterTV::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 AuthenticationResponseParameterTV::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 AuthenticationResponseParameterTV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AuthenticationResponseParameterTV_valueField_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(AuthenticationResponseParameterTV_valueField_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  os_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 AuthenticationResponseParameterTV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AuthenticationResponseParameterTV_valueField_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_valueField.RAW_encode(AuthenticationResponseParameterTV_valueField_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_1) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct AuthenticationResponseParameterTV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_valueField;
};

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

void AuthenticationResponseParameterTV_template::copy_value(const AuthenticationResponseParameterTV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AuthenticationResponseParameterTV_template::copy_template(const AuthenticationResponseParameterTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AuthenticationResponseParameterTV_template[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 AuthenticationResponseParameterTV_template(*other_value.implication_.precondition);
implication_.implied_template = new AuthenticationResponseParameterTV_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_MM_Types.AuthenticationResponseParameterTV.");
break;
}
set_selection(other_value);
}

AuthenticationResponseParameterTV_template::AuthenticationResponseParameterTV_template()
{
}

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

AuthenticationResponseParameterTV_template::AuthenticationResponseParameterTV_template(const AuthenticationResponseParameterTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void AuthenticationResponseParameterTV_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_MM_Types.AuthenticationResponseParameterTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AuthenticationResponseParameterTV_template[list_length];
}

AuthenticationResponseParameterTV_template& AuthenticationResponseParameterTV_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_MM_Types.AuthenticationResponseParameterTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.AuthenticationResponseParameterTV.");
return value_list.list_value[list_index];
}

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

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

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

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

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

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

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

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

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

void AuthenticationResponseParameterTV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AuthenticationResponseParameterTV_template[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_MM_Types.AuthenticationResponseParameterTV.");
}
}

void AuthenticationResponseParameterTV_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: {
    AuthenticationResponseParameterTV_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_MM_Types.AuthenticationResponseParameterTV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.AuthenticationResponseParameterTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AuthenticationResponseParameterTV_template* precondition = new AuthenticationResponseParameterTV_template;
    precondition->set_param(*param.get_elem(0));
    AuthenticationResponseParameterTV_template* implied_template = new AuthenticationResponseParameterTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AuthenticationResponseParameterTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.AuthenticationResponseParameterTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AuthenticationResponseParameterTV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationResponseParameterTV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationResponseParameterTV");
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_MM_Types.AuthenticationResponseParameterTV");
}

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

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

AuthenticationResponseParameterUMTSTLV::AuthenticationResponseParameterUMTSTLV()
{
}

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

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

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

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

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

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

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

void AuthenticationResponseParameterUMTSTLV::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_MM_Types.AuthenticationResponseParameterUMTSTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV");
  }
}

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

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

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

int AuthenticationResponseParameterUMTSTLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AuthenticationResponseParameterUMTSTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &AuthenticationResponseParameterUMTSTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_valueField.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct AuthenticationResponseParameterUMTSTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valueField;
};

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

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

void AuthenticationResponseParameterUMTSTLV_template::copy_template(const AuthenticationResponseParameterUMTSTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AuthenticationResponseParameterUMTSTLV_template[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 AuthenticationResponseParameterUMTSTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new AuthenticationResponseParameterUMTSTLV_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_MM_Types.AuthenticationResponseParameterUMTSTLV.");
break;
}
set_selection(other_value);
}

AuthenticationResponseParameterUMTSTLV_template::AuthenticationResponseParameterUMTSTLV_template()
{
}

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

AuthenticationResponseParameterUMTSTLV_template::AuthenticationResponseParameterUMTSTLV_template(const AuthenticationResponseParameterUMTSTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

AuthenticationResponseParameterUMTSTLV AuthenticationResponseParameterUMTSTLV_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_MM_Types.AuthenticationResponseParameterUMTSTLV.");
AuthenticationResponseParameterUMTSTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void AuthenticationResponseParameterUMTSTLV_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_MM_Types.AuthenticationResponseParameterUMTSTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AuthenticationResponseParameterUMTSTLV_template[list_length];
}

AuthenticationResponseParameterUMTSTLV_template& AuthenticationResponseParameterUMTSTLV_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_MM_Types.AuthenticationResponseParameterUMTSTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV.");
return value_list.list_value[list_index];
}

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

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

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

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

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

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

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

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

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

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

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

void AuthenticationResponseParameterUMTSTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AuthenticationResponseParameterUMTSTLV_template[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_MM_Types.AuthenticationResponseParameterUMTSTLV.");
}
}

void AuthenticationResponseParameterUMTSTLV_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: {
    AuthenticationResponseParameterUMTSTLV_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_MM_Types.AuthenticationResponseParameterUMTSTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AuthenticationResponseParameterUMTSTLV_template* precondition = new AuthenticationResponseParameterUMTSTLV_template;
    precondition->set_param(*param.get_elem(0));
    AuthenticationResponseParameterUMTSTLV_template* implied_template = new AuthenticationResponseParameterUMTSTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AuthenticationResponseParameterUMTSTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AuthenticationResponseParameterUMTSTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV");
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_MM_Types.AuthenticationResponseParameterUMTSTLV");
}

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

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

AuthenticationFailureParametersTLV::AuthenticationFailureParametersTLV()
{
}

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

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

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

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

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

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

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

void AuthenticationFailureParametersTLV::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_MM_Types.AuthenticationFailureParametersTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.AuthenticationFailureParametersTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.AuthenticationFailureParametersTLV");
  }
}

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

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

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

int AuthenticationFailureParametersTLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AuthenticationFailureParametersTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AuthenticationFailureParametersTLV_valueField_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &AuthenticationFailureParametersTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_valueField.RAW_encode(AuthenticationFailureParametersTLV_valueField_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct AuthenticationFailureParametersTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valueField;
};

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

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

void AuthenticationFailureParametersTLV_template::copy_template(const AuthenticationFailureParametersTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AuthenticationFailureParametersTLV_template[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 AuthenticationFailureParametersTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new AuthenticationFailureParametersTLV_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_MM_Types.AuthenticationFailureParametersTLV.");
break;
}
set_selection(other_value);
}

AuthenticationFailureParametersTLV_template::AuthenticationFailureParametersTLV_template()
{
}

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

AuthenticationFailureParametersTLV_template::AuthenticationFailureParametersTLV_template(const AuthenticationFailureParametersTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

AuthenticationFailureParametersTLV AuthenticationFailureParametersTLV_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_MM_Types.AuthenticationFailureParametersTLV.");
AuthenticationFailureParametersTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void AuthenticationFailureParametersTLV_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_MM_Types.AuthenticationFailureParametersTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AuthenticationFailureParametersTLV_template[list_length];
}

AuthenticationFailureParametersTLV_template& AuthenticationFailureParametersTLV_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_MM_Types.AuthenticationFailureParametersTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.AuthenticationFailureParametersTLV.");
return value_list.list_value[list_index];
}

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

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

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

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

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

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

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

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

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

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

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

void AuthenticationFailureParametersTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AuthenticationFailureParametersTLV_template[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_MM_Types.AuthenticationFailureParametersTLV.");
}
}

void AuthenticationFailureParametersTLV_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: {
    AuthenticationFailureParametersTLV_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_MM_Types.AuthenticationFailureParametersTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.AuthenticationFailureParametersTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AuthenticationFailureParametersTLV_template* precondition = new AuthenticationFailureParametersTLV_template;
    precondition->set_param(*param.get_elem(0));
    AuthenticationFailureParametersTLV_template* implied_template = new AuthenticationFailureParametersTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AuthenticationFailureParametersTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.AuthenticationFailureParametersTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AuthenticationFailureParametersTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationFailureParametersTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationFailureParametersTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.AuthenticationFailureParametersTLV");
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_MM_Types.AuthenticationFailureParametersTLV");
}

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

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

LocationUpdatingType::LocationUpdatingType()
{
}

LocationUpdatingType::LocationUpdatingType(const BITSTRING& par_lut,
    const BITSTRING& par_spare1__1,
    const BITSTRING& par_fop)
  :   field_lut(par_lut),
  field_spare1__1(par_spare1__1),
  field_fop(par_fop)
{
}

LocationUpdatingType::LocationUpdatingType(const LocationUpdatingType& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.LocationUpdatingType.");
if (other_value.lut().is_bound()) field_lut = other_value.lut();
else field_lut.clean_up();
if (other_value.spare1__1().is_bound()) field_spare1__1 = other_value.spare1__1();
else field_spare1__1.clean_up();
if (other_value.fop().is_bound()) field_fop = other_value.fop();
else field_fop.clean_up();
}

void LocationUpdatingType::clean_up()
{
field_lut.clean_up();
field_spare1__1.clean_up();
field_fop.clean_up();
}

const TTCN_Typedescriptor_t* LocationUpdatingType::get_descriptor() const { return &LocationUpdatingType_descr_; }
LocationUpdatingType& LocationUpdatingType::operator=(const LocationUpdatingType& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.LocationUpdatingType.");
  if (other_value.lut().is_bound()) field_lut = other_value.lut();
  else field_lut.clean_up();
  if (other_value.spare1__1().is_bound()) field_spare1__1 = other_value.spare1__1();
  else field_spare1__1.clean_up();
  if (other_value.fop().is_bound()) field_fop = other_value.fop();
  else field_fop.clean_up();
}
return *this;
}

boolean LocationUpdatingType::operator==(const LocationUpdatingType& other_value) const
{
return field_lut==other_value.field_lut
  && field_spare1__1==other_value.field_spare1__1
  && field_fop==other_value.field_fop;
}

boolean LocationUpdatingType::is_bound() const
{
return (field_lut.is_bound())
  || (field_spare1__1.is_bound())
  || (field_fop.is_bound());
}
boolean LocationUpdatingType::is_value() const
{
return field_lut.is_value()
  && field_spare1__1.is_value()
  && field_fop.is_value();
}
void LocationUpdatingType::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lut := ");
field_lut.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
field_spare1__1.log();
TTCN_Logger::log_event_str(", fop := ");
field_fop.log();
TTCN_Logger::log_event_str(" }");
}

void LocationUpdatingType::set_implicit_omit()
{
if (lut().is_bound()) lut().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
if (fop().is_bound()) fop().set_implicit_omit();
}

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

void LocationUpdatingType::encode_text(Text_Buf& text_buf) const
{
field_lut.encode_text(text_buf);
field_spare1__1.encode_text(text_buf);
field_fop.encode_text(text_buf);
}

void LocationUpdatingType::decode_text(Text_Buf& text_buf)
{
field_lut.decode_text(text_buf);
field_spare1__1.decode_text(text_buf);
field_fop.decode_text(text_buf);
}

void LocationUpdatingType::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 LocationUpdatingType::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 LocationUpdatingType::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_lut.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_spare1__1.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_fop.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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int LocationUpdatingType::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  encoded_length += field_lut.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare1__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_fop.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct LocationUpdatingType_template::single_value_struct {
BITSTRING_template field_lut;
BITSTRING_template field_spare1__1;
BITSTRING_template field_fop;
};

void LocationUpdatingType_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_lut = ANY_VALUE;
single_value->field_spare1__1 = ANY_VALUE;
single_value->field_fop = ANY_VALUE;
}
}
}

void LocationUpdatingType_template::copy_value(const LocationUpdatingType& other_value)
{
single_value = new single_value_struct;
if (other_value.lut().is_bound()) {
  single_value->field_lut = other_value.lut();
} else {
  single_value->field_lut.clean_up();
}
if (other_value.spare1__1().is_bound()) {
  single_value->field_spare1__1 = other_value.spare1__1();
} else {
  single_value->field_spare1__1.clean_up();
}
if (other_value.fop().is_bound()) {
  single_value->field_fop = other_value.fop();
} else {
  single_value->field_fop.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LocationUpdatingType_template::copy_template(const LocationUpdatingType_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lut().get_selection()) {
single_value->field_lut = other_value.lut();
} else {
single_value->field_lut.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare1__1().get_selection()) {
single_value->field_spare1__1 = other_value.spare1__1();
} else {
single_value->field_spare1__1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fop().get_selection()) {
single_value->field_fop = other_value.fop();
} else {
single_value->field_fop.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 LocationUpdatingType_template[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 LocationUpdatingType_template(*other_value.implication_.precondition);
implication_.implied_template = new LocationUpdatingType_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_MM_Types.LocationUpdatingType.");
break;
}
set_selection(other_value);
}

LocationUpdatingType_template::LocationUpdatingType_template()
{
}

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

LocationUpdatingType_template::LocationUpdatingType_template(const LocationUpdatingType& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LocationUpdatingType_template::match(const LocationUpdatingType& 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.lut().is_bound()) return FALSE;
if(!single_value->field_lut.match(other_value.lut(), legacy))return FALSE;
if(!other_value.spare1__1().is_bound()) return FALSE;
if(!single_value->field_spare1__1.match(other_value.spare1__1(), legacy))return FALSE;
if(!other_value.fop().is_bound()) return FALSE;
if(!single_value->field_fop.match(other_value.fop(), 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_MM_Types.LocationUpdatingType.");
}
return FALSE;
}

boolean LocationUpdatingType_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lut.is_bound()
 || single_value->field_spare1__1.is_bound()
 || single_value->field_fop.is_bound();
}

boolean LocationUpdatingType_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lut.is_value()
 && single_value->field_spare1__1.is_value()
 && single_value->field_fop.is_value();
}

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

LocationUpdatingType LocationUpdatingType_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_MM_Types.LocationUpdatingType.");
LocationUpdatingType ret_val;
if (single_value->field_lut.is_bound()) {
ret_val.lut() = single_value->field_lut.valueof();
}
if (single_value->field_spare1__1.is_bound()) {
ret_val.spare1__1() = single_value->field_spare1__1.valueof();
}
if (single_value->field_fop.is_bound()) {
ret_val.fop() = single_value->field_fop.valueof();
}
return ret_val;
}

void LocationUpdatingType_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_MM_Types.LocationUpdatingType.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LocationUpdatingType_template[list_length];
}

LocationUpdatingType_template& LocationUpdatingType_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_MM_Types.LocationUpdatingType.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.LocationUpdatingType.");
return value_list.list_value[list_index];
}

BITSTRING_template& LocationUpdatingType_template::lut()
{
set_specific();
return single_value->field_lut;
}

const BITSTRING_template& LocationUpdatingType_template::lut() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lut of a non-specific template of type @MobileL3_MM_Types.LocationUpdatingType.");
return single_value->field_lut;
}

BITSTRING_template& LocationUpdatingType_template::spare1__1()
{
set_specific();
return single_value->field_spare1__1;
}

const BITSTRING_template& LocationUpdatingType_template::spare1__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare1_1 of a non-specific template of type @MobileL3_MM_Types.LocationUpdatingType.");
return single_value->field_spare1__1;
}

BITSTRING_template& LocationUpdatingType_template::fop()
{
set_specific();
return single_value->field_fop;
}

const BITSTRING_template& LocationUpdatingType_template::fop() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fop of a non-specific template of type @MobileL3_MM_Types.LocationUpdatingType.");
return single_value->field_fop;
}

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

void LocationUpdatingType_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lut := ");
single_value->field_lut.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
single_value->field_spare1__1.log();
TTCN_Logger::log_event_str(", fop := ");
single_value->field_fop.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 LocationUpdatingType_template::log_match(const LocationUpdatingType& 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_lut.match(match_value.lut(), legacy)){
TTCN_Logger::log_logmatch_info(".lut");
single_value->field_lut.log_match(match_value.lut(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare1__1.match(match_value.spare1__1(), legacy)){
TTCN_Logger::log_logmatch_info(".spare1_1");
single_value->field_spare1__1.log_match(match_value.spare1__1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fop.match(match_value.fop(), legacy)){
TTCN_Logger::log_logmatch_info(".fop");
single_value->field_fop.log_match(match_value.fop(), 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("{ lut := ");
single_value->field_lut.log_match(match_value.lut(), legacy);
TTCN_Logger::log_event_str(", spare1_1 := ");
single_value->field_spare1__1.log_match(match_value.spare1__1(), legacy);
TTCN_Logger::log_event_str(", fop := ");
single_value->field_fop.log_match(match_value.fop(), 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 LocationUpdatingType_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lut().is_bound()) lut().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
if (fop().is_bound()) fop().set_implicit_omit();
}

void LocationUpdatingType_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lut.encode_text(text_buf);
single_value->field_spare1__1.encode_text(text_buf);
single_value->field_fop.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_MM_Types.LocationUpdatingType.");
}
}

void LocationUpdatingType_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_lut.decode_text(text_buf);
single_value->field_spare1__1.decode_text(text_buf);
single_value->field_fop.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 LocationUpdatingType_template[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_MM_Types.LocationUpdatingType.");
}
}

void LocationUpdatingType_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: {
    LocationUpdatingType_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_MM_Types.LocationUpdatingType 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) lut().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare1__1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fop().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(), "lut")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lut().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1__1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.LocationUpdatingType: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LocationUpdatingType_template* precondition = new LocationUpdatingType_template;
    precondition->set_param(*param.get_elem(0));
    LocationUpdatingType_template* implied_template = new LocationUpdatingType_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LocationUpdatingType_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.LocationUpdatingType");
  }
  is_ifpresent = param.get_ifpresent();
}

void LocationUpdatingType_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_lut.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LocationUpdatingType");
single_value->field_spare1__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LocationUpdatingType");
single_value->field_fop.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LocationUpdatingType");
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_MM_Types.LocationUpdatingType");
}

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

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

NetworkNameV::NetworkNameV()
{
}

NetworkNameV::NetworkNameV(const BITSTRING& par_nSpareBits,
    const BITSTRING& par_addCI,
    const BITSTRING& par_codingScheme,
    const BITSTRING& par_ext1,
    const OCTETSTRING& par_textString)
  :   field_nSpareBits(par_nSpareBits),
  field_addCI(par_addCI),
  field_codingScheme(par_codingScheme),
  field_ext1(par_ext1),
  field_textString(par_textString)
{
}

NetworkNameV::NetworkNameV(const NetworkNameV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.NetworkNameV.");
if (other_value.nSpareBits().is_bound()) field_nSpareBits = other_value.nSpareBits();
else field_nSpareBits.clean_up();
if (other_value.addCI().is_bound()) field_addCI = other_value.addCI();
else field_addCI.clean_up();
if (other_value.codingScheme().is_bound()) field_codingScheme = other_value.codingScheme();
else field_codingScheme.clean_up();
if (other_value.ext1().is_bound()) field_ext1 = other_value.ext1();
else field_ext1.clean_up();
if (other_value.textString().is_bound()) field_textString = other_value.textString();
else field_textString.clean_up();
}

void NetworkNameV::clean_up()
{
field_nSpareBits.clean_up();
field_addCI.clean_up();
field_codingScheme.clean_up();
field_ext1.clean_up();
field_textString.clean_up();
}

const TTCN_Typedescriptor_t* NetworkNameV::get_descriptor() const { return &NetworkNameV_descr_; }
NetworkNameV& NetworkNameV::operator=(const NetworkNameV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.NetworkNameV.");
  if (other_value.nSpareBits().is_bound()) field_nSpareBits = other_value.nSpareBits();
  else field_nSpareBits.clean_up();
  if (other_value.addCI().is_bound()) field_addCI = other_value.addCI();
  else field_addCI.clean_up();
  if (other_value.codingScheme().is_bound()) field_codingScheme = other_value.codingScheme();
  else field_codingScheme.clean_up();
  if (other_value.ext1().is_bound()) field_ext1 = other_value.ext1();
  else field_ext1.clean_up();
  if (other_value.textString().is_bound()) field_textString = other_value.textString();
  else field_textString.clean_up();
}
return *this;
}

boolean NetworkNameV::operator==(const NetworkNameV& other_value) const
{
return field_nSpareBits==other_value.field_nSpareBits
  && field_addCI==other_value.field_addCI
  && field_codingScheme==other_value.field_codingScheme
  && field_ext1==other_value.field_ext1
  && field_textString==other_value.field_textString;
}

boolean NetworkNameV::is_bound() const
{
return (field_nSpareBits.is_bound())
  || (field_addCI.is_bound())
  || (field_codingScheme.is_bound())
  || (field_ext1.is_bound())
  || (field_textString.is_bound());
}
boolean NetworkNameV::is_value() const
{
return field_nSpareBits.is_value()
  && field_addCI.is_value()
  && field_codingScheme.is_value()
  && field_ext1.is_value()
  && field_textString.is_value();
}
void NetworkNameV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ nSpareBits := ");
field_nSpareBits.log();
TTCN_Logger::log_event_str(", addCI := ");
field_addCI.log();
TTCN_Logger::log_event_str(", codingScheme := ");
field_codingScheme.log();
TTCN_Logger::log_event_str(", ext1 := ");
field_ext1.log();
TTCN_Logger::log_event_str(", textString := ");
field_textString.log();
TTCN_Logger::log_event_str(" }");
}

void NetworkNameV::set_implicit_omit()
{
if (nSpareBits().is_bound()) nSpareBits().set_implicit_omit();
if (addCI().is_bound()) addCI().set_implicit_omit();
if (codingScheme().is_bound()) codingScheme().set_implicit_omit();
if (ext1().is_bound()) ext1().set_implicit_omit();
if (textString().is_bound()) textString().set_implicit_omit();
}

void NetworkNameV::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_MM_Types.NetworkNameV 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) nSpareBits().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) addCI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) codingScheme().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ext1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) textString().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(), "nSpareBits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSpareBits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "addCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          addCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "codingScheme")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          codingScheme().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "textString")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          textString().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.NetworkNameV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.NetworkNameV");
  }
}

void NetworkNameV::encode_text(Text_Buf& text_buf) const
{
field_nSpareBits.encode_text(text_buf);
field_addCI.encode_text(text_buf);
field_codingScheme.encode_text(text_buf);
field_ext1.encode_text(text_buf);
field_textString.encode_text(text_buf);
}

void NetworkNameV::decode_text(Text_Buf& text_buf)
{
field_nSpareBits.decode_text(text_buf);
field_addCI.decode_text(text_buf);
field_codingScheme.decode_text(text_buf);
field_ext1.decode_text(text_buf);
field_textString.decode_text(text_buf);
}

void NetworkNameV::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 NetworkNameV::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 NetworkNameV::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_nSpareBits.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_addCI.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_codingScheme.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_ext1.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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_textString.RAW_decode(OCTETSTRING_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkNameV::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, OCTETSTRING_descr_.raw);
  encoded_length += field_nSpareBits.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_addCI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_codingScheme.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_ext1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_textString.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct NetworkNameV_template::single_value_struct {
BITSTRING_template field_nSpareBits;
BITSTRING_template field_addCI;
BITSTRING_template field_codingScheme;
BITSTRING_template field_ext1;
OCTETSTRING_template field_textString;
};

void NetworkNameV_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_nSpareBits = ANY_VALUE;
single_value->field_addCI = ANY_VALUE;
single_value->field_codingScheme = ANY_VALUE;
single_value->field_ext1 = ANY_VALUE;
single_value->field_textString = ANY_VALUE;
}
}
}

void NetworkNameV_template::copy_value(const NetworkNameV& other_value)
{
single_value = new single_value_struct;
if (other_value.nSpareBits().is_bound()) {
  single_value->field_nSpareBits = other_value.nSpareBits();
} else {
  single_value->field_nSpareBits.clean_up();
}
if (other_value.addCI().is_bound()) {
  single_value->field_addCI = other_value.addCI();
} else {
  single_value->field_addCI.clean_up();
}
if (other_value.codingScheme().is_bound()) {
  single_value->field_codingScheme = other_value.codingScheme();
} else {
  single_value->field_codingScheme.clean_up();
}
if (other_value.ext1().is_bound()) {
  single_value->field_ext1 = other_value.ext1();
} else {
  single_value->field_ext1.clean_up();
}
if (other_value.textString().is_bound()) {
  single_value->field_textString = other_value.textString();
} else {
  single_value->field_textString.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkNameV_template::copy_template(const NetworkNameV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.nSpareBits().get_selection()) {
single_value->field_nSpareBits = other_value.nSpareBits();
} else {
single_value->field_nSpareBits.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.addCI().get_selection()) {
single_value->field_addCI = other_value.addCI();
} else {
single_value->field_addCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.codingScheme().get_selection()) {
single_value->field_codingScheme = other_value.codingScheme();
} else {
single_value->field_codingScheme.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext1().get_selection()) {
single_value->field_ext1 = other_value.ext1();
} else {
single_value->field_ext1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.textString().get_selection()) {
single_value->field_textString = other_value.textString();
} else {
single_value->field_textString.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 NetworkNameV_template[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 NetworkNameV_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkNameV_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_MM_Types.NetworkNameV.");
break;
}
set_selection(other_value);
}

NetworkNameV_template::NetworkNameV_template()
{
}

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

NetworkNameV_template::NetworkNameV_template(const NetworkNameV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NetworkNameV_template::match(const NetworkNameV& 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.nSpareBits().is_bound()) return FALSE;
if(!single_value->field_nSpareBits.match(other_value.nSpareBits(), legacy))return FALSE;
if(!other_value.addCI().is_bound()) return FALSE;
if(!single_value->field_addCI.match(other_value.addCI(), legacy))return FALSE;
if(!other_value.codingScheme().is_bound()) return FALSE;
if(!single_value->field_codingScheme.match(other_value.codingScheme(), legacy))return FALSE;
if(!other_value.ext1().is_bound()) return FALSE;
if(!single_value->field_ext1.match(other_value.ext1(), legacy))return FALSE;
if(!other_value.textString().is_bound()) return FALSE;
if(!single_value->field_textString.match(other_value.textString(), 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_MM_Types.NetworkNameV.");
}
return FALSE;
}

boolean NetworkNameV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_nSpareBits.is_bound()
 || single_value->field_addCI.is_bound()
 || single_value->field_codingScheme.is_bound()
 || single_value->field_ext1.is_bound()
 || single_value->field_textString.is_bound();
}

boolean NetworkNameV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_nSpareBits.is_value()
 && single_value->field_addCI.is_value()
 && single_value->field_codingScheme.is_value()
 && single_value->field_ext1.is_value()
 && single_value->field_textString.is_value();
}

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

NetworkNameV NetworkNameV_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_MM_Types.NetworkNameV.");
NetworkNameV ret_val;
if (single_value->field_nSpareBits.is_bound()) {
ret_val.nSpareBits() = single_value->field_nSpareBits.valueof();
}
if (single_value->field_addCI.is_bound()) {
ret_val.addCI() = single_value->field_addCI.valueof();
}
if (single_value->field_codingScheme.is_bound()) {
ret_val.codingScheme() = single_value->field_codingScheme.valueof();
}
if (single_value->field_ext1.is_bound()) {
ret_val.ext1() = single_value->field_ext1.valueof();
}
if (single_value->field_textString.is_bound()) {
ret_val.textString() = single_value->field_textString.valueof();
}
return ret_val;
}

void NetworkNameV_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_MM_Types.NetworkNameV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkNameV_template[list_length];
}

NetworkNameV_template& NetworkNameV_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_MM_Types.NetworkNameV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.NetworkNameV.");
return value_list.list_value[list_index];
}

BITSTRING_template& NetworkNameV_template::nSpareBits()
{
set_specific();
return single_value->field_nSpareBits;
}

const BITSTRING_template& NetworkNameV_template::nSpareBits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSpareBits of a non-specific template of type @MobileL3_MM_Types.NetworkNameV.");
return single_value->field_nSpareBits;
}

BITSTRING_template& NetworkNameV_template::addCI()
{
set_specific();
return single_value->field_addCI;
}

const BITSTRING_template& NetworkNameV_template::addCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addCI of a non-specific template of type @MobileL3_MM_Types.NetworkNameV.");
return single_value->field_addCI;
}

BITSTRING_template& NetworkNameV_template::codingScheme()
{
set_specific();
return single_value->field_codingScheme;
}

const BITSTRING_template& NetworkNameV_template::codingScheme() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field codingScheme of a non-specific template of type @MobileL3_MM_Types.NetworkNameV.");
return single_value->field_codingScheme;
}

BITSTRING_template& NetworkNameV_template::ext1()
{
set_specific();
return single_value->field_ext1;
}

const BITSTRING_template& NetworkNameV_template::ext1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext1 of a non-specific template of type @MobileL3_MM_Types.NetworkNameV.");
return single_value->field_ext1;
}

OCTETSTRING_template& NetworkNameV_template::textString()
{
set_specific();
return single_value->field_textString;
}

const OCTETSTRING_template& NetworkNameV_template::textString() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field textString of a non-specific template of type @MobileL3_MM_Types.NetworkNameV.");
return single_value->field_textString;
}

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

void NetworkNameV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ nSpareBits := ");
single_value->field_nSpareBits.log();
TTCN_Logger::log_event_str(", addCI := ");
single_value->field_addCI.log();
TTCN_Logger::log_event_str(", codingScheme := ");
single_value->field_codingScheme.log();
TTCN_Logger::log_event_str(", ext1 := ");
single_value->field_ext1.log();
TTCN_Logger::log_event_str(", textString := ");
single_value->field_textString.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 NetworkNameV_template::log_match(const NetworkNameV& 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_nSpareBits.match(match_value.nSpareBits(), legacy)){
TTCN_Logger::log_logmatch_info(".nSpareBits");
single_value->field_nSpareBits.log_match(match_value.nSpareBits(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_addCI.match(match_value.addCI(), legacy)){
TTCN_Logger::log_logmatch_info(".addCI");
single_value->field_addCI.log_match(match_value.addCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_codingScheme.match(match_value.codingScheme(), legacy)){
TTCN_Logger::log_logmatch_info(".codingScheme");
single_value->field_codingScheme.log_match(match_value.codingScheme(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext1.match(match_value.ext1(), legacy)){
TTCN_Logger::log_logmatch_info(".ext1");
single_value->field_ext1.log_match(match_value.ext1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_textString.match(match_value.textString(), legacy)){
TTCN_Logger::log_logmatch_info(".textString");
single_value->field_textString.log_match(match_value.textString(), 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("{ nSpareBits := ");
single_value->field_nSpareBits.log_match(match_value.nSpareBits(), legacy);
TTCN_Logger::log_event_str(", addCI := ");
single_value->field_addCI.log_match(match_value.addCI(), legacy);
TTCN_Logger::log_event_str(", codingScheme := ");
single_value->field_codingScheme.log_match(match_value.codingScheme(), legacy);
TTCN_Logger::log_event_str(", ext1 := ");
single_value->field_ext1.log_match(match_value.ext1(), legacy);
TTCN_Logger::log_event_str(", textString := ");
single_value->field_textString.log_match(match_value.textString(), 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 NetworkNameV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (nSpareBits().is_bound()) nSpareBits().set_implicit_omit();
if (addCI().is_bound()) addCI().set_implicit_omit();
if (codingScheme().is_bound()) codingScheme().set_implicit_omit();
if (ext1().is_bound()) ext1().set_implicit_omit();
if (textString().is_bound()) textString().set_implicit_omit();
}

void NetworkNameV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_nSpareBits.encode_text(text_buf);
single_value->field_addCI.encode_text(text_buf);
single_value->field_codingScheme.encode_text(text_buf);
single_value->field_ext1.encode_text(text_buf);
single_value->field_textString.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_MM_Types.NetworkNameV.");
}
}

void NetworkNameV_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_nSpareBits.decode_text(text_buf);
single_value->field_addCI.decode_text(text_buf);
single_value->field_codingScheme.decode_text(text_buf);
single_value->field_ext1.decode_text(text_buf);
single_value->field_textString.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 NetworkNameV_template[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_MM_Types.NetworkNameV.");
}
}

void NetworkNameV_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: {
    NetworkNameV_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_MM_Types.NetworkNameV 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) nSpareBits().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) addCI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) codingScheme().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ext1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) textString().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(), "nSpareBits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSpareBits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "addCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          addCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "codingScheme")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          codingScheme().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "textString")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          textString().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.NetworkNameV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkNameV_template* precondition = new NetworkNameV_template;
    precondition->set_param(*param.get_elem(0));
    NetworkNameV_template* implied_template = new NetworkNameV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkNameV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.NetworkNameV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkNameV_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_nSpareBits.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameV");
single_value->field_addCI.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameV");
single_value->field_codingScheme.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameV");
single_value->field_ext1.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameV");
single_value->field_textString.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameV");
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_MM_Types.NetworkNameV");
}

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

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

NetworkNameTLV::NetworkNameTLV()
{
}

NetworkNameTLV::NetworkNameTLV(const BITSTRING& par_elementIdentifier,
    const BITSTRING& par_spare1,
    const INTEGER& par_lengthIndicator,
    const NetworkNameV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_spare1(par_spare1),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

NetworkNameTLV::NetworkNameTLV(const NetworkNameTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.NetworkNameTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
else field_spare1.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void NetworkNameTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_spare1.clean_up();
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* NetworkNameTLV::get_descriptor() const { return &NetworkNameTLV_descr_; }
NetworkNameTLV& NetworkNameTLV::operator=(const NetworkNameTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.NetworkNameTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
  else field_spare1.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

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

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

void NetworkNameTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (spare1().is_bound()) spare1().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

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

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

void NetworkNameTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_spare1.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

void NetworkNameTLV::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 NetworkNameTLV::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 NetworkNameTLV::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, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.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_spare1.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, NetworkNameTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NetworkNameTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp2 = field_lengthIndicator.convert_to_Integer(NetworkNameTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp2;
  value_of_length_field2 += tmp2.get_long_long_val() * 8;
  RAW_Force_Omit field_3_force_omit(3, force_omit, NetworkNameV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(NetworkNameV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkNameTLV::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::BIT7_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, NetworkNameTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, NetworkNameV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->coding_descr = &NetworkNameTLV_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_valueField.RAW_encode(NetworkNameV_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct NetworkNameTLV_template::single_value_struct {
BITSTRING_template field_elementIdentifier;
BITSTRING_template field_spare1;
INTEGER_template field_lengthIndicator;
NetworkNameV_template field_valueField;
};

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

void NetworkNameTLV_template::copy_value(const NetworkNameTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.spare1().is_bound()) {
  single_value->field_spare1 = other_value.spare1();
} else {
  single_value->field_spare1.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkNameTLV_template::copy_template(const NetworkNameTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare1().get_selection()) {
single_value->field_spare1 = other_value.spare1();
} else {
single_value->field_spare1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NetworkNameTLV_template[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 NetworkNameTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkNameTLV_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_MM_Types.NetworkNameTLV.");
break;
}
set_selection(other_value);
}

NetworkNameTLV_template::NetworkNameTLV_template()
{
}

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

NetworkNameTLV_template::NetworkNameTLV_template(const NetworkNameTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

NetworkNameTLV NetworkNameTLV_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_MM_Types.NetworkNameTLV.");
NetworkNameTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_spare1.is_bound()) {
ret_val.spare1() = single_value->field_spare1.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void NetworkNameTLV_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_MM_Types.NetworkNameTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkNameTLV_template[list_length];
}

NetworkNameTLV_template& NetworkNameTLV_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_MM_Types.NetworkNameTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.NetworkNameTLV.");
return value_list.list_value[list_index];
}

BITSTRING_template& NetworkNameTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& NetworkNameTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_MM_Types.NetworkNameTLV.");
return single_value->field_elementIdentifier;
}

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

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

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

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

NetworkNameV_template& NetworkNameTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const NetworkNameV_template& NetworkNameTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_MM_Types.NetworkNameTLV.");
return single_value->field_valueField;
}

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

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

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

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

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

void NetworkNameTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_spare1.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NetworkNameTLV_template[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_MM_Types.NetworkNameTLV.");
}
}

void NetworkNameTLV_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: {
    NetworkNameTLV_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_MM_Types.NetworkNameTLV has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.NetworkNameTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkNameTLV_template* precondition = new NetworkNameTLV_template;
    precondition->set_param(*param.get_elem(0));
    NetworkNameTLV_template* implied_template = new NetworkNameTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkNameTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.NetworkNameTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkNameTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameTLV");
single_value->field_spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.NetworkNameTLV");
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_MM_Types.NetworkNameTLV");
}

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

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

TimeZoneV::TimeZoneV()
{
}

TimeZoneV::TimeZoneV(const OCTETSTRING& par_timeZone)
  :   field_timeZone(par_timeZone)
{
}

TimeZoneV::TimeZoneV(const TimeZoneV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.TimeZoneV.");
if (other_value.timeZone().is_bound()) field_timeZone = other_value.timeZone();
else field_timeZone.clean_up();
}

void TimeZoneV::clean_up()
{
field_timeZone.clean_up();
}

const TTCN_Typedescriptor_t* TimeZoneV::get_descriptor() const { return &TimeZoneV_descr_; }
TimeZoneV& TimeZoneV::operator=(const TimeZoneV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.TimeZoneV.");
  if (other_value.timeZone().is_bound()) field_timeZone = other_value.timeZone();
  else field_timeZone.clean_up();
}
return *this;
}

boolean TimeZoneV::operator==(const TimeZoneV& other_value) const
{
return field_timeZone==other_value.field_timeZone;
}

boolean TimeZoneV::is_bound() const
{
return (field_timeZone.is_bound());
}
boolean TimeZoneV::is_value() const
{
return field_timeZone.is_value();
}
void TimeZoneV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ timeZone := ");
field_timeZone.log();
TTCN_Logger::log_event_str(" }");
}

void TimeZoneV::set_implicit_omit()
{
if (timeZone().is_bound()) timeZone().set_implicit_omit();
}

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

void TimeZoneV::encode_text(Text_Buf& text_buf) const
{
field_timeZone.encode_text(text_buf);
}

void TimeZoneV::decode_text(Text_Buf& text_buf)
{
field_timeZone.decode_text(text_buf);
}

void TimeZoneV::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 TimeZoneV::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 TimeZoneV::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_timeZone.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 TimeZoneV::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_timeZone.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct TimeZoneV_template::single_value_struct {
OCTETSTRING_template field_timeZone;
};

void TimeZoneV_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_timeZone = ANY_VALUE;
}
}
}

void TimeZoneV_template::copy_value(const TimeZoneV& other_value)
{
single_value = new single_value_struct;
if (other_value.timeZone().is_bound()) {
  single_value->field_timeZone = other_value.timeZone();
} else {
  single_value->field_timeZone.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TimeZoneV_template::copy_template(const TimeZoneV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.timeZone().get_selection()) {
single_value->field_timeZone = other_value.timeZone();
} else {
single_value->field_timeZone.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 TimeZoneV_template[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 TimeZoneV_template(*other_value.implication_.precondition);
implication_.implied_template = new TimeZoneV_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_MM_Types.TimeZoneV.");
break;
}
set_selection(other_value);
}

TimeZoneV_template::TimeZoneV_template()
{
}

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

TimeZoneV_template::TimeZoneV_template(const TimeZoneV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TimeZoneV_template::match(const TimeZoneV& 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.timeZone().is_bound()) return FALSE;
if(!single_value->field_timeZone.match(other_value.timeZone(), 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_MM_Types.TimeZoneV.");
}
return FALSE;
}

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

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

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

TimeZoneV TimeZoneV_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_MM_Types.TimeZoneV.");
TimeZoneV ret_val;
if (single_value->field_timeZone.is_bound()) {
ret_val.timeZone() = single_value->field_timeZone.valueof();
}
return ret_val;
}

void TimeZoneV_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_MM_Types.TimeZoneV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TimeZoneV_template[list_length];
}

TimeZoneV_template& TimeZoneV_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_MM_Types.TimeZoneV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.TimeZoneV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& TimeZoneV_template::timeZone()
{
set_specific();
return single_value->field_timeZone;
}

const OCTETSTRING_template& TimeZoneV_template::timeZone() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timeZone of a non-specific template of type @MobileL3_MM_Types.TimeZoneV.");
return single_value->field_timeZone;
}

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

void TimeZoneV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ timeZone := ");
single_value->field_timeZone.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 TimeZoneV_template::log_match(const TimeZoneV& 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_timeZone.match(match_value.timeZone(), legacy)){
TTCN_Logger::log_logmatch_info(".timeZone");
single_value->field_timeZone.log_match(match_value.timeZone(), 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("{ timeZone := ");
single_value->field_timeZone.log_match(match_value.timeZone(), 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 TimeZoneV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (timeZone().is_bound()) timeZone().set_implicit_omit();
}

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

void TimeZoneV_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_timeZone.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 TimeZoneV_template[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_MM_Types.TimeZoneV.");
}
}

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

void TimeZoneV_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_timeZone.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneV");
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_MM_Types.TimeZoneV");
}

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

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

TimeZoneTV::TimeZoneTV()
{
}

TimeZoneTV::TimeZoneTV(const BITSTRING& par_elementIdentifier,
    const BITSTRING& par_spare,
    const TimeZoneV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_spare(par_spare),
  field_valueField(par_valueField)
{
}

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

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

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

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

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

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

void TimeZoneTV::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_MM_Types.TimeZoneTV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.TimeZoneTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.TimeZoneTV");
  }
}

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

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

void TimeZoneTV::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 TimeZoneTV::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 TimeZoneTV::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_elementIdentifier.RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, TimeZoneV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(TimeZoneV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  bs_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 TimeZoneTV::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::BIT7_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, TimeZoneV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_valueField.RAW_encode(TimeZoneV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  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::BIT7_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 TimeZoneTV_template::single_value_struct {
BITSTRING_template field_elementIdentifier;
BITSTRING_template field_spare;
TimeZoneV_template field_valueField;
};

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

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

void TimeZoneTV_template::copy_template(const TimeZoneTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TimeZoneTV_template[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 TimeZoneTV_template(*other_value.implication_.precondition);
implication_.implied_template = new TimeZoneTV_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_MM_Types.TimeZoneTV.");
break;
}
set_selection(other_value);
}

TimeZoneTV_template::TimeZoneTV_template()
{
}

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

TimeZoneTV_template::TimeZoneTV_template(const TimeZoneTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

TimeZoneTV TimeZoneTV_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_MM_Types.TimeZoneTV.");
TimeZoneTV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void TimeZoneTV_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_MM_Types.TimeZoneTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TimeZoneTV_template[list_length];
}

TimeZoneTV_template& TimeZoneTV_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_MM_Types.TimeZoneTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.TimeZoneTV.");
return value_list.list_value[list_index];
}

BITSTRING_template& TimeZoneTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& TimeZoneTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_MM_Types.TimeZoneTV.");
return single_value->field_elementIdentifier;
}

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

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

TimeZoneV_template& TimeZoneTV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const TimeZoneV_template& TimeZoneTV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_MM_Types.TimeZoneTV.");
return single_value->field_valueField;
}

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

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

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

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

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

void TimeZoneTV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TimeZoneTV_template[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_MM_Types.TimeZoneTV.");
}
}

void TimeZoneTV_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: {
    TimeZoneTV_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_MM_Types.TimeZoneTV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.TimeZoneTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TimeZoneTV_template* precondition = new TimeZoneTV_template;
    precondition->set_param(*param.get_elem(0));
    TimeZoneTV_template* implied_template = new TimeZoneTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TimeZoneTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.TimeZoneTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void TimeZoneTV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneTV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneTV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneTV");
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_MM_Types.TimeZoneTV");
}

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

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

TimeZoneAndTimeV::TimeZoneAndTimeV()
{
}

TimeZoneAndTimeV::TimeZoneAndTimeV(const OCTETSTRING& par_year,
    const OCTETSTRING& par_month,
    const OCTETSTRING& par_day,
    const OCTETSTRING& par_hour,
    const OCTETSTRING& par_minute,
    const OCTETSTRING& par_second,
    const OCTETSTRING& par_timeZone)
  :   field_year(par_year),
  field_month(par_month),
  field_day(par_day),
  field_hour(par_hour),
  field_minute(par_minute),
  field_second(par_second),
  field_timeZone(par_timeZone)
{
}

TimeZoneAndTimeV::TimeZoneAndTimeV(const TimeZoneAndTimeV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
if (other_value.year().is_bound()) field_year = other_value.year();
else field_year.clean_up();
if (other_value.month().is_bound()) field_month = other_value.month();
else field_month.clean_up();
if (other_value.day().is_bound()) field_day = other_value.day();
else field_day.clean_up();
if (other_value.hour().is_bound()) field_hour = other_value.hour();
else field_hour.clean_up();
if (other_value.minute().is_bound()) field_minute = other_value.minute();
else field_minute.clean_up();
if (other_value.second().is_bound()) field_second = other_value.second();
else field_second.clean_up();
if (other_value.timeZone().is_bound()) field_timeZone = other_value.timeZone();
else field_timeZone.clean_up();
}

void TimeZoneAndTimeV::clean_up()
{
field_year.clean_up();
field_month.clean_up();
field_day.clean_up();
field_hour.clean_up();
field_minute.clean_up();
field_second.clean_up();
field_timeZone.clean_up();
}

const TTCN_Typedescriptor_t* TimeZoneAndTimeV::get_descriptor() const { return &TimeZoneAndTimeV_descr_; }
TimeZoneAndTimeV& TimeZoneAndTimeV::operator=(const TimeZoneAndTimeV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
  if (other_value.year().is_bound()) field_year = other_value.year();
  else field_year.clean_up();
  if (other_value.month().is_bound()) field_month = other_value.month();
  else field_month.clean_up();
  if (other_value.day().is_bound()) field_day = other_value.day();
  else field_day.clean_up();
  if (other_value.hour().is_bound()) field_hour = other_value.hour();
  else field_hour.clean_up();
  if (other_value.minute().is_bound()) field_minute = other_value.minute();
  else field_minute.clean_up();
  if (other_value.second().is_bound()) field_second = other_value.second();
  else field_second.clean_up();
  if (other_value.timeZone().is_bound()) field_timeZone = other_value.timeZone();
  else field_timeZone.clean_up();
}
return *this;
}

boolean TimeZoneAndTimeV::operator==(const TimeZoneAndTimeV& other_value) const
{
return field_year==other_value.field_year
  && field_month==other_value.field_month
  && field_day==other_value.field_day
  && field_hour==other_value.field_hour
  && field_minute==other_value.field_minute
  && field_second==other_value.field_second
  && field_timeZone==other_value.field_timeZone;
}

boolean TimeZoneAndTimeV::is_bound() const
{
return (field_year.is_bound())
  || (field_month.is_bound())
  || (field_day.is_bound())
  || (field_hour.is_bound())
  || (field_minute.is_bound())
  || (field_second.is_bound())
  || (field_timeZone.is_bound());
}
boolean TimeZoneAndTimeV::is_value() const
{
return field_year.is_value()
  && field_month.is_value()
  && field_day.is_value()
  && field_hour.is_value()
  && field_minute.is_value()
  && field_second.is_value()
  && field_timeZone.is_value();
}
void TimeZoneAndTimeV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ year := ");
field_year.log();
TTCN_Logger::log_event_str(", month := ");
field_month.log();
TTCN_Logger::log_event_str(", day := ");
field_day.log();
TTCN_Logger::log_event_str(", hour := ");
field_hour.log();
TTCN_Logger::log_event_str(", minute := ");
field_minute.log();
TTCN_Logger::log_event_str(", second := ");
field_second.log();
TTCN_Logger::log_event_str(", timeZone := ");
field_timeZone.log();
TTCN_Logger::log_event_str(" }");
}

void TimeZoneAndTimeV::set_implicit_omit()
{
if (year().is_bound()) year().set_implicit_omit();
if (month().is_bound()) month().set_implicit_omit();
if (day().is_bound()) day().set_implicit_omit();
if (hour().is_bound()) hour().set_implicit_omit();
if (minute().is_bound()) minute().set_implicit_omit();
if (second().is_bound()) second().set_implicit_omit();
if (timeZone().is_bound()) timeZone().set_implicit_omit();
}

void TimeZoneAndTimeV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_MM_Types.TimeZoneAndTimeV has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) year().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) month().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) day().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) hour().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) minute().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) second().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) timeZone().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "year")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          year().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "month")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          month().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "day")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          day().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hour")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hour().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "minute")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          minute().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "second")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          second().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.TimeZoneAndTimeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.TimeZoneAndTimeV");
  }
}

void TimeZoneAndTimeV::encode_text(Text_Buf& text_buf) const
{
field_year.encode_text(text_buf);
field_month.encode_text(text_buf);
field_day.encode_text(text_buf);
field_hour.encode_text(text_buf);
field_minute.encode_text(text_buf);
field_second.encode_text(text_buf);
field_timeZone.encode_text(text_buf);
}

void TimeZoneAndTimeV::decode_text(Text_Buf& text_buf)
{
field_year.decode_text(text_buf);
field_month.decode_text(text_buf);
field_day.decode_text(text_buf);
field_hour.decode_text(text_buf);
field_minute.decode_text(text_buf);
field_second.decode_text(text_buf);
field_timeZone.decode_text(text_buf);
}

void TimeZoneAndTimeV::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 TimeZoneAndTimeV::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 TimeZoneAndTimeV::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_year.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_month.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_day.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, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_hour.RAW_decode(General__Types::OCT1_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_minute.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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_second.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_timeZone.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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TimeZoneAndTimeV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT1_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, General__Types::OCT1_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::OCT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::OCT1_descr_.raw);
  encoded_length += field_year.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_month.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_day.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_hour.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_minute.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_second.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_timeZone.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct TimeZoneAndTimeV_template::single_value_struct {
OCTETSTRING_template field_year;
OCTETSTRING_template field_month;
OCTETSTRING_template field_day;
OCTETSTRING_template field_hour;
OCTETSTRING_template field_minute;
OCTETSTRING_template field_second;
OCTETSTRING_template field_timeZone;
};

void TimeZoneAndTimeV_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_year = ANY_VALUE;
single_value->field_month = ANY_VALUE;
single_value->field_day = ANY_VALUE;
single_value->field_hour = ANY_VALUE;
single_value->field_minute = ANY_VALUE;
single_value->field_second = ANY_VALUE;
single_value->field_timeZone = ANY_VALUE;
}
}
}

void TimeZoneAndTimeV_template::copy_value(const TimeZoneAndTimeV& other_value)
{
single_value = new single_value_struct;
if (other_value.year().is_bound()) {
  single_value->field_year = other_value.year();
} else {
  single_value->field_year.clean_up();
}
if (other_value.month().is_bound()) {
  single_value->field_month = other_value.month();
} else {
  single_value->field_month.clean_up();
}
if (other_value.day().is_bound()) {
  single_value->field_day = other_value.day();
} else {
  single_value->field_day.clean_up();
}
if (other_value.hour().is_bound()) {
  single_value->field_hour = other_value.hour();
} else {
  single_value->field_hour.clean_up();
}
if (other_value.minute().is_bound()) {
  single_value->field_minute = other_value.minute();
} else {
  single_value->field_minute.clean_up();
}
if (other_value.second().is_bound()) {
  single_value->field_second = other_value.second();
} else {
  single_value->field_second.clean_up();
}
if (other_value.timeZone().is_bound()) {
  single_value->field_timeZone = other_value.timeZone();
} else {
  single_value->field_timeZone.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TimeZoneAndTimeV_template::copy_template(const TimeZoneAndTimeV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.year().get_selection()) {
single_value->field_year = other_value.year();
} else {
single_value->field_year.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.month().get_selection()) {
single_value->field_month = other_value.month();
} else {
single_value->field_month.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.day().get_selection()) {
single_value->field_day = other_value.day();
} else {
single_value->field_day.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.hour().get_selection()) {
single_value->field_hour = other_value.hour();
} else {
single_value->field_hour.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.minute().get_selection()) {
single_value->field_minute = other_value.minute();
} else {
single_value->field_minute.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.second().get_selection()) {
single_value->field_second = other_value.second();
} else {
single_value->field_second.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.timeZone().get_selection()) {
single_value->field_timeZone = other_value.timeZone();
} else {
single_value->field_timeZone.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 TimeZoneAndTimeV_template[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 TimeZoneAndTimeV_template(*other_value.implication_.precondition);
implication_.implied_template = new TimeZoneAndTimeV_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_MM_Types.TimeZoneAndTimeV.");
break;
}
set_selection(other_value);
}

TimeZoneAndTimeV_template::TimeZoneAndTimeV_template()
{
}

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

TimeZoneAndTimeV_template::TimeZoneAndTimeV_template(const TimeZoneAndTimeV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TimeZoneAndTimeV_template::match(const TimeZoneAndTimeV& 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.year().is_bound()) return FALSE;
if(!single_value->field_year.match(other_value.year(), legacy))return FALSE;
if(!other_value.month().is_bound()) return FALSE;
if(!single_value->field_month.match(other_value.month(), legacy))return FALSE;
if(!other_value.day().is_bound()) return FALSE;
if(!single_value->field_day.match(other_value.day(), legacy))return FALSE;
if(!other_value.hour().is_bound()) return FALSE;
if(!single_value->field_hour.match(other_value.hour(), legacy))return FALSE;
if(!other_value.minute().is_bound()) return FALSE;
if(!single_value->field_minute.match(other_value.minute(), legacy))return FALSE;
if(!other_value.second().is_bound()) return FALSE;
if(!single_value->field_second.match(other_value.second(), legacy))return FALSE;
if(!other_value.timeZone().is_bound()) return FALSE;
if(!single_value->field_timeZone.match(other_value.timeZone(), 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_MM_Types.TimeZoneAndTimeV.");
}
return FALSE;
}

boolean TimeZoneAndTimeV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_year.is_bound()
 || single_value->field_month.is_bound()
 || single_value->field_day.is_bound()
 || single_value->field_hour.is_bound()
 || single_value->field_minute.is_bound()
 || single_value->field_second.is_bound()
 || single_value->field_timeZone.is_bound();
}

boolean TimeZoneAndTimeV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_year.is_value()
 && single_value->field_month.is_value()
 && single_value->field_day.is_value()
 && single_value->field_hour.is_value()
 && single_value->field_minute.is_value()
 && single_value->field_second.is_value()
 && single_value->field_timeZone.is_value();
}

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

TimeZoneAndTimeV TimeZoneAndTimeV_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_MM_Types.TimeZoneAndTimeV.");
TimeZoneAndTimeV ret_val;
if (single_value->field_year.is_bound()) {
ret_val.year() = single_value->field_year.valueof();
}
if (single_value->field_month.is_bound()) {
ret_val.month() = single_value->field_month.valueof();
}
if (single_value->field_day.is_bound()) {
ret_val.day() = single_value->field_day.valueof();
}
if (single_value->field_hour.is_bound()) {
ret_val.hour() = single_value->field_hour.valueof();
}
if (single_value->field_minute.is_bound()) {
ret_val.minute() = single_value->field_minute.valueof();
}
if (single_value->field_second.is_bound()) {
ret_val.second() = single_value->field_second.valueof();
}
if (single_value->field_timeZone.is_bound()) {
ret_val.timeZone() = single_value->field_timeZone.valueof();
}
return ret_val;
}

void TimeZoneAndTimeV_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_MM_Types.TimeZoneAndTimeV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TimeZoneAndTimeV_template[list_length];
}

TimeZoneAndTimeV_template& TimeZoneAndTimeV_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_MM_Types.TimeZoneAndTimeV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& TimeZoneAndTimeV_template::year()
{
set_specific();
return single_value->field_year;
}

const OCTETSTRING_template& TimeZoneAndTimeV_template::year() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field year of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return single_value->field_year;
}

OCTETSTRING_template& TimeZoneAndTimeV_template::month()
{
set_specific();
return single_value->field_month;
}

const OCTETSTRING_template& TimeZoneAndTimeV_template::month() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field month of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return single_value->field_month;
}

OCTETSTRING_template& TimeZoneAndTimeV_template::day()
{
set_specific();
return single_value->field_day;
}

const OCTETSTRING_template& TimeZoneAndTimeV_template::day() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field day of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return single_value->field_day;
}

OCTETSTRING_template& TimeZoneAndTimeV_template::hour()
{
set_specific();
return single_value->field_hour;
}

const OCTETSTRING_template& TimeZoneAndTimeV_template::hour() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hour of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return single_value->field_hour;
}

OCTETSTRING_template& TimeZoneAndTimeV_template::minute()
{
set_specific();
return single_value->field_minute;
}

const OCTETSTRING_template& TimeZoneAndTimeV_template::minute() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field minute of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return single_value->field_minute;
}

OCTETSTRING_template& TimeZoneAndTimeV_template::second()
{
set_specific();
return single_value->field_second;
}

const OCTETSTRING_template& TimeZoneAndTimeV_template::second() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field second of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return single_value->field_second;
}

OCTETSTRING_template& TimeZoneAndTimeV_template::timeZone()
{
set_specific();
return single_value->field_timeZone;
}

const OCTETSTRING_template& TimeZoneAndTimeV_template::timeZone() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timeZone of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeV.");
return single_value->field_timeZone;
}

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

void TimeZoneAndTimeV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ year := ");
single_value->field_year.log();
TTCN_Logger::log_event_str(", month := ");
single_value->field_month.log();
TTCN_Logger::log_event_str(", day := ");
single_value->field_day.log();
TTCN_Logger::log_event_str(", hour := ");
single_value->field_hour.log();
TTCN_Logger::log_event_str(", minute := ");
single_value->field_minute.log();
TTCN_Logger::log_event_str(", second := ");
single_value->field_second.log();
TTCN_Logger::log_event_str(", timeZone := ");
single_value->field_timeZone.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 TimeZoneAndTimeV_template::log_match(const TimeZoneAndTimeV& 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_year.match(match_value.year(), legacy)){
TTCN_Logger::log_logmatch_info(".year");
single_value->field_year.log_match(match_value.year(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_month.match(match_value.month(), legacy)){
TTCN_Logger::log_logmatch_info(".month");
single_value->field_month.log_match(match_value.month(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_day.match(match_value.day(), legacy)){
TTCN_Logger::log_logmatch_info(".day");
single_value->field_day.log_match(match_value.day(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_hour.match(match_value.hour(), legacy)){
TTCN_Logger::log_logmatch_info(".hour");
single_value->field_hour.log_match(match_value.hour(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_minute.match(match_value.minute(), legacy)){
TTCN_Logger::log_logmatch_info(".minute");
single_value->field_minute.log_match(match_value.minute(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_second.match(match_value.second(), legacy)){
TTCN_Logger::log_logmatch_info(".second");
single_value->field_second.log_match(match_value.second(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_timeZone.match(match_value.timeZone(), legacy)){
TTCN_Logger::log_logmatch_info(".timeZone");
single_value->field_timeZone.log_match(match_value.timeZone(), 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("{ year := ");
single_value->field_year.log_match(match_value.year(), legacy);
TTCN_Logger::log_event_str(", month := ");
single_value->field_month.log_match(match_value.month(), legacy);
TTCN_Logger::log_event_str(", day := ");
single_value->field_day.log_match(match_value.day(), legacy);
TTCN_Logger::log_event_str(", hour := ");
single_value->field_hour.log_match(match_value.hour(), legacy);
TTCN_Logger::log_event_str(", minute := ");
single_value->field_minute.log_match(match_value.minute(), legacy);
TTCN_Logger::log_event_str(", second := ");
single_value->field_second.log_match(match_value.second(), legacy);
TTCN_Logger::log_event_str(", timeZone := ");
single_value->field_timeZone.log_match(match_value.timeZone(), 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 TimeZoneAndTimeV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (year().is_bound()) year().set_implicit_omit();
if (month().is_bound()) month().set_implicit_omit();
if (day().is_bound()) day().set_implicit_omit();
if (hour().is_bound()) hour().set_implicit_omit();
if (minute().is_bound()) minute().set_implicit_omit();
if (second().is_bound()) second().set_implicit_omit();
if (timeZone().is_bound()) timeZone().set_implicit_omit();
}

void TimeZoneAndTimeV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_year.encode_text(text_buf);
single_value->field_month.encode_text(text_buf);
single_value->field_day.encode_text(text_buf);
single_value->field_hour.encode_text(text_buf);
single_value->field_minute.encode_text(text_buf);
single_value->field_second.encode_text(text_buf);
single_value->field_timeZone.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_MM_Types.TimeZoneAndTimeV.");
}
}

void TimeZoneAndTimeV_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_year.decode_text(text_buf);
single_value->field_month.decode_text(text_buf);
single_value->field_day.decode_text(text_buf);
single_value->field_hour.decode_text(text_buf);
single_value->field_minute.decode_text(text_buf);
single_value->field_second.decode_text(text_buf);
single_value->field_timeZone.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 TimeZoneAndTimeV_template[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_MM_Types.TimeZoneAndTimeV.");
}
}

void TimeZoneAndTimeV_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: {
    TimeZoneAndTimeV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_MM_Types.TimeZoneAndTimeV has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) year().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) month().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) day().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) hour().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) minute().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) second().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) timeZone().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "year")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          year().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "month")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          month().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "day")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          day().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hour")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hour().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "minute")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          minute().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "second")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          second().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.TimeZoneAndTimeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TimeZoneAndTimeV_template* precondition = new TimeZoneAndTimeV_template;
    precondition->set_param(*param.get_elem(0));
    TimeZoneAndTimeV_template* implied_template = new TimeZoneAndTimeV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TimeZoneAndTimeV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.TimeZoneAndTimeV");
  }
  is_ifpresent = param.get_ifpresent();
}

void TimeZoneAndTimeV_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_year.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeV");
single_value->field_month.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeV");
single_value->field_day.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeV");
single_value->field_hour.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeV");
single_value->field_minute.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeV");
single_value->field_second.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeV");
single_value->field_timeZone.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeV");
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_MM_Types.TimeZoneAndTimeV");
}

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

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

TimeZoneAndTimeTV::TimeZoneAndTimeTV()
{
}

TimeZoneAndTimeTV::TimeZoneAndTimeTV(const BITSTRING& par_elementIdentifier,
    const BITSTRING& par_spare,
    const TimeZoneAndTimeV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_spare(par_spare),
  field_valueField(par_valueField)
{
}

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

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

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

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

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

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

void TimeZoneAndTimeTV::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_MM_Types.TimeZoneAndTimeTV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.TimeZoneAndTimeTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.TimeZoneAndTimeTV");
  }
}

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

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

void TimeZoneAndTimeTV::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 TimeZoneAndTimeTV::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 TimeZoneAndTimeTV::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_elementIdentifier.RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, TimeZoneAndTimeV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(TimeZoneAndTimeV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  bs_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 TimeZoneAndTimeTV::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::BIT7_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, TimeZoneAndTimeV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_valueField.RAW_encode(TimeZoneAndTimeV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  bs_1) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={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::BIT7_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 TimeZoneAndTimeTV_template::single_value_struct {
BITSTRING_template field_elementIdentifier;
BITSTRING_template field_spare;
TimeZoneAndTimeV_template field_valueField;
};

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

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

void TimeZoneAndTimeTV_template::copy_template(const TimeZoneAndTimeTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TimeZoneAndTimeTV_template[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 TimeZoneAndTimeTV_template(*other_value.implication_.precondition);
implication_.implied_template = new TimeZoneAndTimeTV_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_MM_Types.TimeZoneAndTimeTV.");
break;
}
set_selection(other_value);
}

TimeZoneAndTimeTV_template::TimeZoneAndTimeTV_template()
{
}

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

TimeZoneAndTimeTV_template::TimeZoneAndTimeTV_template(const TimeZoneAndTimeTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

TimeZoneAndTimeTV TimeZoneAndTimeTV_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_MM_Types.TimeZoneAndTimeTV.");
TimeZoneAndTimeTV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void TimeZoneAndTimeTV_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_MM_Types.TimeZoneAndTimeTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TimeZoneAndTimeTV_template[list_length];
}

TimeZoneAndTimeTV_template& TimeZoneAndTimeTV_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_MM_Types.TimeZoneAndTimeTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.TimeZoneAndTimeTV.");
return value_list.list_value[list_index];
}

BITSTRING_template& TimeZoneAndTimeTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& TimeZoneAndTimeTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeTV.");
return single_value->field_elementIdentifier;
}

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

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

TimeZoneAndTimeV_template& TimeZoneAndTimeTV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const TimeZoneAndTimeV_template& TimeZoneAndTimeTV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_MM_Types.TimeZoneAndTimeTV.");
return single_value->field_valueField;
}

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

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

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

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

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

void TimeZoneAndTimeTV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TimeZoneAndTimeTV_template[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_MM_Types.TimeZoneAndTimeTV.");
}
}

void TimeZoneAndTimeTV_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: {
    TimeZoneAndTimeTV_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_MM_Types.TimeZoneAndTimeTV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.TimeZoneAndTimeTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TimeZoneAndTimeTV_template* precondition = new TimeZoneAndTimeTV_template;
    precondition->set_param(*param.get_elem(0));
    TimeZoneAndTimeTV_template* implied_template = new TimeZoneAndTimeTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TimeZoneAndTimeTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.TimeZoneAndTimeTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void TimeZoneAndTimeTV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeTV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeTV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.TimeZoneAndTimeTV");
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_MM_Types.TimeZoneAndTimeTV");
}

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

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

LSA__IdentifierV::LSA__IdentifierV()
{
}

LSA__IdentifierV::LSA__IdentifierV(const OCTETSTRING& par_lsa__id)
  :   field_lsa__id(par_lsa__id)
{
}

LSA__IdentifierV::LSA__IdentifierV(const LSA__IdentifierV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.LSA_IdentifierV.");
if (other_value.lsa__id().is_bound()) field_lsa__id = other_value.lsa__id();
else field_lsa__id.clean_up();
}

void LSA__IdentifierV::clean_up()
{
field_lsa__id.clean_up();
}

const TTCN_Typedescriptor_t* LSA__IdentifierV::get_descriptor() const { return &LSA__IdentifierV_descr_; }
LSA__IdentifierV& LSA__IdentifierV::operator=(const LSA__IdentifierV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.LSA_IdentifierV.");
  if (other_value.lsa__id().is_bound()) field_lsa__id = other_value.lsa__id();
  else field_lsa__id.clean_up();
}
return *this;
}

boolean LSA__IdentifierV::operator==(const LSA__IdentifierV& other_value) const
{
return field_lsa__id==other_value.field_lsa__id;
}

boolean LSA__IdentifierV::is_bound() const
{
return (field_lsa__id.is_bound());
}
boolean LSA__IdentifierV::is_value() const
{
return field_lsa__id.is_value();
}
void LSA__IdentifierV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lsa_id := ");
field_lsa__id.log();
TTCN_Logger::log_event_str(" }");
}

void LSA__IdentifierV::set_implicit_omit()
{
if (lsa__id().is_bound()) lsa__id().set_implicit_omit();
}

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

void LSA__IdentifierV::encode_text(Text_Buf& text_buf) const
{
field_lsa__id.encode_text(text_buf);
}

void LSA__IdentifierV::decode_text(Text_Buf& text_buf)
{
field_lsa__id.decode_text(text_buf);
}

void LSA__IdentifierV::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 LSA__IdentifierV::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 LSA__IdentifierV::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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_lsa__id.RAW_decode(OCTETSTRING_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 LSA__IdentifierV::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, OCTETSTRING_descr_.raw);
  encoded_length += field_lsa__id.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct LSA__IdentifierV_template::single_value_struct {
OCTETSTRING_template field_lsa__id;
};

void LSA__IdentifierV_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_lsa__id = ANY_VALUE;
}
}
}

void LSA__IdentifierV_template::copy_value(const LSA__IdentifierV& other_value)
{
single_value = new single_value_struct;
if (other_value.lsa__id().is_bound()) {
  single_value->field_lsa__id = other_value.lsa__id();
} else {
  single_value->field_lsa__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LSA__IdentifierV_template::copy_template(const LSA__IdentifierV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lsa__id().get_selection()) {
single_value->field_lsa__id = other_value.lsa__id();
} else {
single_value->field_lsa__id.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 LSA__IdentifierV_template[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 LSA__IdentifierV_template(*other_value.implication_.precondition);
implication_.implied_template = new LSA__IdentifierV_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_MM_Types.LSA_IdentifierV.");
break;
}
set_selection(other_value);
}

LSA__IdentifierV_template::LSA__IdentifierV_template()
{
}

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

LSA__IdentifierV_template::LSA__IdentifierV_template(const LSA__IdentifierV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LSA__IdentifierV_template::match(const LSA__IdentifierV& 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.lsa__id().is_bound()) return FALSE;
if(!single_value->field_lsa__id.match(other_value.lsa__id(), 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_MM_Types.LSA_IdentifierV.");
}
return FALSE;
}

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

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

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

LSA__IdentifierV LSA__IdentifierV_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_MM_Types.LSA_IdentifierV.");
LSA__IdentifierV ret_val;
if (single_value->field_lsa__id.is_bound()) {
ret_val.lsa__id() = single_value->field_lsa__id.valueof();
}
return ret_val;
}

void LSA__IdentifierV_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_MM_Types.LSA_IdentifierV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LSA__IdentifierV_template[list_length];
}

LSA__IdentifierV_template& LSA__IdentifierV_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_MM_Types.LSA_IdentifierV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.LSA_IdentifierV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& LSA__IdentifierV_template::lsa__id()
{
set_specific();
return single_value->field_lsa__id;
}

const OCTETSTRING_template& LSA__IdentifierV_template::lsa__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lsa_id of a non-specific template of type @MobileL3_MM_Types.LSA_IdentifierV.");
return single_value->field_lsa__id;
}

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

void LSA__IdentifierV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lsa_id := ");
single_value->field_lsa__id.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 LSA__IdentifierV_template::log_match(const LSA__IdentifierV& 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_lsa__id.match(match_value.lsa__id(), legacy)){
TTCN_Logger::log_logmatch_info(".lsa_id");
single_value->field_lsa__id.log_match(match_value.lsa__id(), 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("{ lsa_id := ");
single_value->field_lsa__id.log_match(match_value.lsa__id(), 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 LSA__IdentifierV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lsa__id().is_bound()) lsa__id().set_implicit_omit();
}

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

void LSA__IdentifierV_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_lsa__id.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 LSA__IdentifierV_template[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_MM_Types.LSA_IdentifierV.");
}
}

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

void LSA__IdentifierV_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_lsa__id.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LSA_IdentifierV");
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_MM_Types.LSA_IdentifierV");
}

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

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

LSA__IdentifierTLV::LSA__IdentifierTLV()
{
}

LSA__IdentifierTLV::LSA__IdentifierTLV(const BITSTRING& par_elementIdentifier,
    const BITSTRING& par_spare,
    const INTEGER& par_lengthIndicator,
    const LSA__IdentifierV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_spare(par_spare),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

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

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

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

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

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

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

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

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

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

void LSA__IdentifierTLV::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 LSA__IdentifierTLV::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 LSA__IdentifierTLV::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, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, LSA__IdentifierTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(LSA__IdentifierTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp2 = field_lengthIndicator.convert_to_Integer(LSA__IdentifierTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp2;
  value_of_length_field2 += tmp2.get_long_long_val() * 8;
  RAW_Force_Omit field_3_force_omit(3, force_omit, LSA__IdentifierV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(LSA__IdentifierV_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_elementIdentifier !=  bs_2) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int LSA__IdentifierTLV::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::BIT7_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, LSA__IdentifierTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, LSA__IdentifierV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->coding_descr = &LSA__IdentifierTLV_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_valueField.RAW_encode(LSA__IdentifierV_descr_, *myleaf.body.node.nodes[3]);
  if (field_elementIdentifier !=  bs_2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT7_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 LSA__IdentifierTLV_template::single_value_struct {
BITSTRING_template field_elementIdentifier;
BITSTRING_template field_spare;
INTEGER_template field_lengthIndicator;
LSA__IdentifierV_template field_valueField;
};

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

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

void LSA__IdentifierTLV_template::copy_template(const LSA__IdentifierTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new LSA__IdentifierTLV_template[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 LSA__IdentifierTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new LSA__IdentifierTLV_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_MM_Types.LSA_IdentifierTLV.");
break;
}
set_selection(other_value);
}

LSA__IdentifierTLV_template::LSA__IdentifierTLV_template()
{
}

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

LSA__IdentifierTLV_template::LSA__IdentifierTLV_template(const LSA__IdentifierTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

LSA__IdentifierTLV LSA__IdentifierTLV_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_MM_Types.LSA_IdentifierTLV.");
LSA__IdentifierTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void LSA__IdentifierTLV_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_MM_Types.LSA_IdentifierTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LSA__IdentifierTLV_template[list_length];
}

LSA__IdentifierTLV_template& LSA__IdentifierTLV_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_MM_Types.LSA_IdentifierTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.LSA_IdentifierTLV.");
return value_list.list_value[list_index];
}

BITSTRING_template& LSA__IdentifierTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& LSA__IdentifierTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_MM_Types.LSA_IdentifierTLV.");
return single_value->field_elementIdentifier;
}

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

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

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

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

LSA__IdentifierV_template& LSA__IdentifierTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const LSA__IdentifierV_template& LSA__IdentifierTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_MM_Types.LSA_IdentifierTLV.");
return single_value->field_valueField;
}

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

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

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

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

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

void LSA__IdentifierTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new LSA__IdentifierTLV_template[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_MM_Types.LSA_IdentifierTLV.");
}
}

void LSA__IdentifierTLV_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: {
    LSA__IdentifierTLV_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_MM_Types.LSA_IdentifierTLV has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.LSA_IdentifierTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LSA__IdentifierTLV_template* precondition = new LSA__IdentifierTLV_template;
    precondition->set_param(*param.get_elem(0));
    LSA__IdentifierTLV_template* implied_template = new LSA__IdentifierTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LSA__IdentifierTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.LSA_IdentifierTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void LSA__IdentifierTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LSA_IdentifierTLV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LSA_IdentifierTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LSA_IdentifierTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.LSA_IdentifierTLV");
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_MM_Types.LSA_IdentifierTLV");
}

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

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

DaylightSavingTimeV::DaylightSavingTimeV()
{
}

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

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

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

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

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

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

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

void DaylightSavingTimeV::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_MM_Types.DaylightSavingTimeV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.DaylightSavingTimeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.DaylightSavingTimeV");
  }
}

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

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

void DaylightSavingTimeV::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 DaylightSavingTimeV::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 DaylightSavingTimeV::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_valueField.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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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 DaylightSavingTimeV::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::BIT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT6_descr_.raw);
  encoded_length += field_valueField.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct DaylightSavingTimeV_template::single_value_struct {
BITSTRING_template field_valueField;
BITSTRING_template field_spare;
};

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

void DaylightSavingTimeV_template::copy_value(const DaylightSavingTimeV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DaylightSavingTimeV_template::copy_template(const DaylightSavingTimeV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DaylightSavingTimeV_template[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 DaylightSavingTimeV_template(*other_value.implication_.precondition);
implication_.implied_template = new DaylightSavingTimeV_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_MM_Types.DaylightSavingTimeV.");
break;
}
set_selection(other_value);
}

DaylightSavingTimeV_template::DaylightSavingTimeV_template()
{
}

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

DaylightSavingTimeV_template::DaylightSavingTimeV_template(const DaylightSavingTimeV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void DaylightSavingTimeV_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_MM_Types.DaylightSavingTimeV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DaylightSavingTimeV_template[list_length];
}

DaylightSavingTimeV_template& DaylightSavingTimeV_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_MM_Types.DaylightSavingTimeV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.DaylightSavingTimeV.");
return value_list.list_value[list_index];
}

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

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

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

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

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

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

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

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

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

void DaylightSavingTimeV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_valueField.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DaylightSavingTimeV_template[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_MM_Types.DaylightSavingTimeV.");
}
}

void DaylightSavingTimeV_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: {
    DaylightSavingTimeV_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_MM_Types.DaylightSavingTimeV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.DaylightSavingTimeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DaylightSavingTimeV_template* precondition = new DaylightSavingTimeV_template;
    precondition->set_param(*param.get_elem(0));
    DaylightSavingTimeV_template* implied_template = new DaylightSavingTimeV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DaylightSavingTimeV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.DaylightSavingTimeV");
  }
  is_ifpresent = param.get_ifpresent();
}

void DaylightSavingTimeV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.DaylightSavingTimeV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.DaylightSavingTimeV");
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_MM_Types.DaylightSavingTimeV");
}

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

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

DaylightSavingTimeTLV::DaylightSavingTimeTLV()
{
}

DaylightSavingTimeTLV::DaylightSavingTimeTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const DaylightSavingTimeV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

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

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

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

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

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

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

void DaylightSavingTimeTLV::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_MM_Types.DaylightSavingTimeTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.DaylightSavingTimeTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.DaylightSavingTimeTLV");
  }
}

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

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

void DaylightSavingTimeTLV::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 DaylightSavingTimeTLV::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 DaylightSavingTimeTLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, DaylightSavingTimeTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(DaylightSavingTimeTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(DaylightSavingTimeTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, DaylightSavingTimeV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(DaylightSavingTimeV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_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 DaylightSavingTimeTLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DaylightSavingTimeTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DaylightSavingTimeV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &DaylightSavingTimeTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_valueField.RAW_encode(DaylightSavingTimeV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_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){
   os_3.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct DaylightSavingTimeTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
DaylightSavingTimeV_template field_valueField;
};

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

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

void DaylightSavingTimeTLV_template::copy_template(const DaylightSavingTimeTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DaylightSavingTimeTLV_template[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 DaylightSavingTimeTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new DaylightSavingTimeTLV_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_MM_Types.DaylightSavingTimeTLV.");
break;
}
set_selection(other_value);
}

DaylightSavingTimeTLV_template::DaylightSavingTimeTLV_template()
{
}

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

DaylightSavingTimeTLV_template::DaylightSavingTimeTLV_template(const DaylightSavingTimeTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

DaylightSavingTimeTLV DaylightSavingTimeTLV_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_MM_Types.DaylightSavingTimeTLV.");
DaylightSavingTimeTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void DaylightSavingTimeTLV_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_MM_Types.DaylightSavingTimeTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DaylightSavingTimeTLV_template[list_length];
}

DaylightSavingTimeTLV_template& DaylightSavingTimeTLV_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_MM_Types.DaylightSavingTimeTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.DaylightSavingTimeTLV.");
return value_list.list_value[list_index];
}

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

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

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

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

DaylightSavingTimeV_template& DaylightSavingTimeTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const DaylightSavingTimeV_template& DaylightSavingTimeTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_MM_Types.DaylightSavingTimeTLV.");
return single_value->field_valueField;
}

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

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

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

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

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

void DaylightSavingTimeTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DaylightSavingTimeTLV_template[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_MM_Types.DaylightSavingTimeTLV.");
}
}

void DaylightSavingTimeTLV_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: {
    DaylightSavingTimeTLV_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_MM_Types.DaylightSavingTimeTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.DaylightSavingTimeTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DaylightSavingTimeTLV_template* precondition = new DaylightSavingTimeTLV_template;
    precondition->set_param(*param.get_elem(0));
    DaylightSavingTimeTLV_template* implied_template = new DaylightSavingTimeTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DaylightSavingTimeTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.DaylightSavingTimeTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void DaylightSavingTimeTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.DaylightSavingTimeTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.DaylightSavingTimeTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.DaylightSavingTimeTLV");
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_MM_Types.DaylightSavingTimeTLV");
}

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

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


const EmergencyNumber EmergencyNumberListV::UNBOUND_ELEM;
EmergencyNumberListV::EmergencyNumberListV()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void EmergencyNumberListV_template::copy_template(const EmergencyNumberListV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (EmergencyNumber_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new EmergencyNumber_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new EmergencyNumber_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new EmergencyNumberListV_template[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 EmergencyNumberListV_template(*other_value.implication_.precondition);
implication_.implied_template = new EmergencyNumberListV_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_MM_Types.EmergencyNumberListV.");
break;
}
set_selection(other_value);
}

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

EmergencyNumberListV_template::EmergencyNumberListV_template()
{
}

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

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

EmergencyNumberListV_template::EmergencyNumberListV_template(const EmergencyNumberListV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

EmergencyNumberListV EmergencyNumberListV_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_MM_Types.EmergencyNumberListV.");
EmergencyNumberListV ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

void EmergencyNumberListV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyNumberListV");
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_MM_Types.EmergencyNumberListV");
}

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

EmergencyServiceCategory::EmergencyServiceCategory(const BITSTRING& par_valueFiled,
    const BITSTRING& par_spare)
  :   field_valueFiled(par_valueFiled),
  field_spare(par_spare)
{
}

EmergencyServiceCategory::EmergencyServiceCategory(const EmergencyServiceCategory& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.EmergencyServiceCategory.");
if (other_value.valueFiled().is_bound()) field_valueFiled = other_value.valueFiled();
else field_valueFiled.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void EmergencyServiceCategory::clean_up()
{
field_valueFiled.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* EmergencyServiceCategory::get_descriptor() const { return &EmergencyServiceCategory_descr_; }
EmergencyServiceCategory& EmergencyServiceCategory::operator=(const EmergencyServiceCategory& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.EmergencyServiceCategory.");
  if (other_value.valueFiled().is_bound()) field_valueFiled = other_value.valueFiled();
  else field_valueFiled.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean EmergencyServiceCategory::operator==(const EmergencyServiceCategory& other_value) const
{
return field_valueFiled==other_value.field_valueFiled
  && field_spare==other_value.field_spare;
}

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

void EmergencyServiceCategory::set_implicit_omit()
{
if (valueFiled().is_bound()) valueFiled().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void EmergencyServiceCategory::encode_text(Text_Buf& text_buf) const
{
field_valueFiled.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void EmergencyServiceCategory::decode_text(Text_Buf& text_buf)
{
field_valueFiled.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

int EmergencyServiceCategory::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT5_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  encoded_length += field_valueFiled.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct EmergencyServiceCategory_template::single_value_struct {
BITSTRING_template field_valueFiled;
BITSTRING_template field_spare;
};

void EmergencyServiceCategory_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_valueFiled = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void EmergencyServiceCategory_template::copy_value(const EmergencyServiceCategory& other_value)
{
single_value = new single_value_struct;
if (other_value.valueFiled().is_bound()) {
  single_value->field_valueFiled = other_value.valueFiled();
} else {
  single_value->field_valueFiled.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EmergencyServiceCategory_template::copy_template(const EmergencyServiceCategory_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueFiled().get_selection()) {
single_value->field_valueFiled = other_value.valueFiled();
} else {
single_value->field_valueFiled.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new EmergencyServiceCategory_template[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 EmergencyServiceCategory_template(*other_value.implication_.precondition);
implication_.implied_template = new EmergencyServiceCategory_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_MM_Types.EmergencyServiceCategory.");
break;
}
set_selection(other_value);
}

EmergencyServiceCategory_template::EmergencyServiceCategory_template()
{
}

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

EmergencyServiceCategory_template::EmergencyServiceCategory_template(const EmergencyServiceCategory& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

EmergencyServiceCategory EmergencyServiceCategory_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_MM_Types.EmergencyServiceCategory.");
EmergencyServiceCategory ret_val;
if (single_value->field_valueFiled.is_bound()) {
ret_val.valueFiled() = single_value->field_valueFiled.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void EmergencyServiceCategory_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_MM_Types.EmergencyServiceCategory.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new EmergencyServiceCategory_template[list_length];
}

EmergencyServiceCategory_template& EmergencyServiceCategory_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_MM_Types.EmergencyServiceCategory.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.EmergencyServiceCategory.");
return value_list.list_value[list_index];
}

BITSTRING_template& EmergencyServiceCategory_template::valueFiled()
{
set_specific();
return single_value->field_valueFiled;
}

const BITSTRING_template& EmergencyServiceCategory_template::valueFiled() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueFiled of a non-specific template of type @MobileL3_MM_Types.EmergencyServiceCategory.");
return single_value->field_valueFiled;
}

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

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

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

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

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

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

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

void EmergencyServiceCategory_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_valueFiled.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new EmergencyServiceCategory_template[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_MM_Types.EmergencyServiceCategory.");
}
}

void EmergencyServiceCategory_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: {
    EmergencyServiceCategory_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_MM_Types.EmergencyServiceCategory 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) valueFiled().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueFiled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueFiled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.EmergencyServiceCategory: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    EmergencyServiceCategory_template* precondition = new EmergencyServiceCategory_template;
    precondition->set_param(*param.get_elem(0));
    EmergencyServiceCategory_template* implied_template = new EmergencyServiceCategory_template;
    implied_template->set_param(*param.get_elem(1));
    *this = EmergencyServiceCategory_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.EmergencyServiceCategory");
  }
  is_ifpresent = param.get_ifpresent();
}

void EmergencyServiceCategory_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_valueFiled.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyServiceCategory");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyServiceCategory");
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_MM_Types.EmergencyServiceCategory");
}

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

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

EmergencyNumber::EmergencyNumber()
{
}

EmergencyNumber::EmergencyNumber(const INTEGER& par_lengthIndicator,
    const EmergencyServiceCategory& par_emergencyServiceCategory,
    const HEXSTRING& par_emergencyNumber)
  :   field_lengthIndicator(par_lengthIndicator),
  field_emergencyServiceCategory(par_emergencyServiceCategory),
  field_emergencyNumber(par_emergencyNumber)
{
}

EmergencyNumber::EmergencyNumber(const EmergencyNumber& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.EmergencyNumber.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.emergencyServiceCategory().is_bound()) field_emergencyServiceCategory = other_value.emergencyServiceCategory();
else field_emergencyServiceCategory.clean_up();
if (other_value.emergencyNumber().is_bound()) field_emergencyNumber = other_value.emergencyNumber();
else field_emergencyNumber.clean_up();
}

void EmergencyNumber::clean_up()
{
field_lengthIndicator.clean_up();
field_emergencyServiceCategory.clean_up();
field_emergencyNumber.clean_up();
}

const TTCN_Typedescriptor_t* EmergencyNumber::get_descriptor() const { return &EmergencyNumber_descr_; }
EmergencyNumber& EmergencyNumber::operator=(const EmergencyNumber& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.EmergencyNumber.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.emergencyServiceCategory().is_bound()) field_emergencyServiceCategory = other_value.emergencyServiceCategory();
  else field_emergencyServiceCategory.clean_up();
  if (other_value.emergencyNumber().is_bound()) field_emergencyNumber = other_value.emergencyNumber();
  else field_emergencyNumber.clean_up();
}
return *this;
}

boolean EmergencyNumber::operator==(const EmergencyNumber& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_emergencyServiceCategory==other_value.field_emergencyServiceCategory
  && field_emergencyNumber==other_value.field_emergencyNumber;
}

boolean EmergencyNumber::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_emergencyServiceCategory.is_bound())
  || (field_emergencyNumber.is_bound());
}
boolean EmergencyNumber::is_value() const
{
return field_lengthIndicator.is_value()
  && field_emergencyServiceCategory.is_value()
  && field_emergencyNumber.is_value();
}
void EmergencyNumber::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(", emergencyServiceCategory := ");
field_emergencyServiceCategory.log();
TTCN_Logger::log_event_str(", emergencyNumber := ");
field_emergencyNumber.log();
TTCN_Logger::log_event_str(" }");
}

void EmergencyNumber::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (emergencyServiceCategory().is_bound()) emergencyServiceCategory().set_implicit_omit();
if (emergencyNumber().is_bound()) emergencyNumber().set_implicit_omit();
}

void EmergencyNumber::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_MM_Types.EmergencyNumber has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) emergencyServiceCategory().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) emergencyNumber().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyServiceCategory")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyServiceCategory().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.EmergencyNumber: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.EmergencyNumber");
  }
}

void EmergencyNumber::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_emergencyServiceCategory.encode_text(text_buf);
field_emergencyNumber.encode_text(text_buf);
}

void EmergencyNumber::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_emergencyServiceCategory.decode_text(text_buf);
field_emergencyNumber.decode_text(text_buf);
}

void EmergencyNumber::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 EmergencyNumber::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 EmergencyNumber::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, EmergencyNumber_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(EmergencyNumber_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(EmergencyNumber_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, EmergencyServiceCategory_descr_.raw->forceomit);
  decoded_field_length = field_emergencyServiceCategory.RAW_decode(EmergencyServiceCategory_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_emergencyNumber.RAW_decode(HEXSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int EmergencyNumber::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, EmergencyNumber_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, EmergencyServiceCategory_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, HEXSTRING_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &EmergencyNumber_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;
  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;
  encoded_length += field_emergencyServiceCategory.RAW_encode(EmergencyServiceCategory_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_emergencyNumber.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct EmergencyNumber_template::single_value_struct {
INTEGER_template field_lengthIndicator;
EmergencyServiceCategory_template field_emergencyServiceCategory;
HEXSTRING_template field_emergencyNumber;
};

void EmergencyNumber_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_emergencyServiceCategory = ANY_VALUE;
single_value->field_emergencyNumber = ANY_VALUE;
}
}
}

void EmergencyNumber_template::copy_value(const EmergencyNumber& 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.emergencyServiceCategory().is_bound()) {
  single_value->field_emergencyServiceCategory = other_value.emergencyServiceCategory();
} else {
  single_value->field_emergencyServiceCategory.clean_up();
}
if (other_value.emergencyNumber().is_bound()) {
  single_value->field_emergencyNumber = other_value.emergencyNumber();
} else {
  single_value->field_emergencyNumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EmergencyNumber_template::copy_template(const EmergencyNumber_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.emergencyServiceCategory().get_selection()) {
single_value->field_emergencyServiceCategory = other_value.emergencyServiceCategory();
} else {
single_value->field_emergencyServiceCategory.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyNumber().get_selection()) {
single_value->field_emergencyNumber = other_value.emergencyNumber();
} else {
single_value->field_emergencyNumber.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 EmergencyNumber_template[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 EmergencyNumber_template(*other_value.implication_.precondition);
implication_.implied_template = new EmergencyNumber_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_MM_Types.EmergencyNumber.");
break;
}
set_selection(other_value);
}

EmergencyNumber_template::EmergencyNumber_template()
{
}

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

EmergencyNumber_template::EmergencyNumber_template(const EmergencyNumber& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean EmergencyNumber_template::match(const EmergencyNumber& 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.emergencyServiceCategory().is_bound()) return FALSE;
if(!single_value->field_emergencyServiceCategory.match(other_value.emergencyServiceCategory(), legacy))return FALSE;
if(!other_value.emergencyNumber().is_bound()) return FALSE;
if(!single_value->field_emergencyNumber.match(other_value.emergencyNumber(), 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_MM_Types.EmergencyNumber.");
}
return FALSE;
}

boolean EmergencyNumber_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_emergencyServiceCategory.is_bound()
 || single_value->field_emergencyNumber.is_bound();
}

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

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

EmergencyNumber EmergencyNumber_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_MM_Types.EmergencyNumber.");
EmergencyNumber ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_emergencyServiceCategory.is_bound()) {
ret_val.emergencyServiceCategory() = single_value->field_emergencyServiceCategory.valueof();
}
if (single_value->field_emergencyNumber.is_bound()) {
ret_val.emergencyNumber() = single_value->field_emergencyNumber.valueof();
}
return ret_val;
}

void EmergencyNumber_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_MM_Types.EmergencyNumber.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new EmergencyNumber_template[list_length];
}

EmergencyNumber_template& EmergencyNumber_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_MM_Types.EmergencyNumber.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.EmergencyNumber.");
return value_list.list_value[list_index];
}

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

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

EmergencyServiceCategory_template& EmergencyNumber_template::emergencyServiceCategory()
{
set_specific();
return single_value->field_emergencyServiceCategory;
}

const EmergencyServiceCategory_template& EmergencyNumber_template::emergencyServiceCategory() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyServiceCategory of a non-specific template of type @MobileL3_MM_Types.EmergencyNumber.");
return single_value->field_emergencyServiceCategory;
}

HEXSTRING_template& EmergencyNumber_template::emergencyNumber()
{
set_specific();
return single_value->field_emergencyNumber;
}

const HEXSTRING_template& EmergencyNumber_template::emergencyNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyNumber of a non-specific template of type @MobileL3_MM_Types.EmergencyNumber.");
return single_value->field_emergencyNumber;
}

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

void EmergencyNumber_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(", emergencyServiceCategory := ");
single_value->field_emergencyServiceCategory.log();
TTCN_Logger::log_event_str(", emergencyNumber := ");
single_value->field_emergencyNumber.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 EmergencyNumber_template::log_match(const EmergencyNumber& 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_emergencyServiceCategory.match(match_value.emergencyServiceCategory(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyServiceCategory");
single_value->field_emergencyServiceCategory.log_match(match_value.emergencyServiceCategory(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_emergencyNumber.match(match_value.emergencyNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyNumber");
single_value->field_emergencyNumber.log_match(match_value.emergencyNumber(), 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(", emergencyServiceCategory := ");
single_value->field_emergencyServiceCategory.log_match(match_value.emergencyServiceCategory(), legacy);
TTCN_Logger::log_event_str(", emergencyNumber := ");
single_value->field_emergencyNumber.log_match(match_value.emergencyNumber(), 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 EmergencyNumber_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (emergencyServiceCategory().is_bound()) emergencyServiceCategory().set_implicit_omit();
if (emergencyNumber().is_bound()) emergencyNumber().set_implicit_omit();
}

void EmergencyNumber_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_emergencyServiceCategory.encode_text(text_buf);
single_value->field_emergencyNumber.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_MM_Types.EmergencyNumber.");
}
}

void EmergencyNumber_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_emergencyServiceCategory.decode_text(text_buf);
single_value->field_emergencyNumber.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 EmergencyNumber_template[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_MM_Types.EmergencyNumber.");
}
}

void EmergencyNumber_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: {
    EmergencyNumber_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_MM_Types.EmergencyNumber has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) emergencyServiceCategory().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) emergencyNumber().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyServiceCategory")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyServiceCategory().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.EmergencyNumber: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    EmergencyNumber_template* precondition = new EmergencyNumber_template;
    precondition->set_param(*param.get_elem(0));
    EmergencyNumber_template* implied_template = new EmergencyNumber_template;
    implied_template->set_param(*param.get_elem(1));
    *this = EmergencyNumber_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.EmergencyNumber");
  }
  is_ifpresent = param.get_ifpresent();
}

void EmergencyNumber_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_MM_Types.EmergencyNumber");
single_value->field_emergencyServiceCategory.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyNumber");
single_value->field_emergencyNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyNumber");
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_MM_Types.EmergencyNumber");
}

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

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

EmergencyNumberListTLV::EmergencyNumberListTLV()
{
}

EmergencyNumberListTLV::EmergencyNumberListTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const EmergencyNumberListV& par_emergencyNumberListV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_emergencyNumberListV(par_emergencyNumberListV)
{
}

EmergencyNumberListTLV::EmergencyNumberListTLV(const EmergencyNumberListTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.EmergencyNumberListTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.emergencyNumberListV().is_bound()) field_emergencyNumberListV = other_value.emergencyNumberListV();
else field_emergencyNumberListV.clean_up();
}

void EmergencyNumberListTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_emergencyNumberListV.clean_up();
}

const TTCN_Typedescriptor_t* EmergencyNumberListTLV::get_descriptor() const { return &EmergencyNumberListTLV_descr_; }
EmergencyNumberListTLV& EmergencyNumberListTLV::operator=(const EmergencyNumberListTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.EmergencyNumberListTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.emergencyNumberListV().is_bound()) field_emergencyNumberListV = other_value.emergencyNumberListV();
  else field_emergencyNumberListV.clean_up();
}
return *this;
}

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

boolean EmergencyNumberListTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_emergencyNumberListV.is_bound());
}
boolean EmergencyNumberListTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_emergencyNumberListV.is_value();
}
void EmergencyNumberListTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", emergencyNumberListV := ");
field_emergencyNumberListV.log();
TTCN_Logger::log_event_str(" }");
}

void EmergencyNumberListTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (emergencyNumberListV().is_bound()) emergencyNumberListV().set_implicit_omit();
}

void EmergencyNumberListTLV::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_MM_Types.EmergencyNumberListTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberListV().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberListV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberListV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.EmergencyNumberListTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.EmergencyNumberListTLV");
  }
}

void EmergencyNumberListTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_emergencyNumberListV.encode_text(text_buf);
}

void EmergencyNumberListTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_emergencyNumberListV.decode_text(text_buf);
}

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

int EmergencyNumberListTLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, EmergencyNumberListTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, EmergencyNumberListV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &EmergencyNumberListTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_emergencyNumberListV.RAW_encode(EmergencyNumberListV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_4) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_4.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct EmergencyNumberListTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
EmergencyNumberListV_template field_emergencyNumberListV;
};

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

void EmergencyNumberListTLV_template::copy_value(const EmergencyNumberListTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.emergencyNumberListV().is_bound()) {
  single_value->field_emergencyNumberListV = other_value.emergencyNumberListV();
} else {
  single_value->field_emergencyNumberListV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EmergencyNumberListTLV_template::copy_template(const EmergencyNumberListTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyNumberListV().get_selection()) {
single_value->field_emergencyNumberListV = other_value.emergencyNumberListV();
} else {
single_value->field_emergencyNumberListV.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 EmergencyNumberListTLV_template[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 EmergencyNumberListTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new EmergencyNumberListTLV_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_MM_Types.EmergencyNumberListTLV.");
break;
}
set_selection(other_value);
}

EmergencyNumberListTLV_template::EmergencyNumberListTLV_template()
{
}

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

EmergencyNumberListTLV_template::EmergencyNumberListTLV_template(const EmergencyNumberListTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean EmergencyNumberListTLV_template::match(const EmergencyNumberListTLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.emergencyNumberListV().is_bound()) return FALSE;
if(!single_value->field_emergencyNumberListV.match(other_value.emergencyNumberListV(), 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_MM_Types.EmergencyNumberListTLV.");
}
return FALSE;
}

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

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

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

EmergencyNumberListTLV EmergencyNumberListTLV_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_MM_Types.EmergencyNumberListTLV.");
EmergencyNumberListTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_emergencyNumberListV.is_bound()) {
ret_val.emergencyNumberListV() = single_value->field_emergencyNumberListV.valueof();
}
return ret_val;
}

void EmergencyNumberListTLV_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_MM_Types.EmergencyNumberListTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new EmergencyNumberListTLV_template[list_length];
}

EmergencyNumberListTLV_template& EmergencyNumberListTLV_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_MM_Types.EmergencyNumberListTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.EmergencyNumberListTLV.");
return value_list.list_value[list_index];
}

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

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

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

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

EmergencyNumberListV_template& EmergencyNumberListTLV_template::emergencyNumberListV()
{
set_specific();
return single_value->field_emergencyNumberListV;
}

const EmergencyNumberListV_template& EmergencyNumberListTLV_template::emergencyNumberListV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyNumberListV of a non-specific template of type @MobileL3_MM_Types.EmergencyNumberListTLV.");
return single_value->field_emergencyNumberListV;
}

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

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

void EmergencyNumberListTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_emergencyNumberListV.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_MM_Types.EmergencyNumberListTLV.");
}
}

void EmergencyNumberListTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_emergencyNumberListV.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 EmergencyNumberListTLV_template[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_MM_Types.EmergencyNumberListTLV.");
}
}

void EmergencyNumberListTLV_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: {
    EmergencyNumberListTLV_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_MM_Types.EmergencyNumberListTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberListV().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberListV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberListV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.EmergencyNumberListTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    EmergencyNumberListTLV_template* precondition = new EmergencyNumberListTLV_template;
    precondition->set_param(*param.get_elem(0));
    EmergencyNumberListTLV_template* implied_template = new EmergencyNumberListTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = EmergencyNumberListTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.EmergencyNumberListTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void EmergencyNumberListTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyNumberListTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyNumberListTLV");
single_value->field_emergencyNumberListV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.EmergencyNumberListTLV");
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_MM_Types.EmergencyNumberListTLV");
}

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

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

MM__TimerV::MM__TimerV()
{
}

MM__TimerV::MM__TimerV(const BITSTRING& par_timerValue,
    const BITSTRING& par_unit)
  :   field_timerValue(par_timerValue),
  field_unit(par_unit)
{
}

MM__TimerV::MM__TimerV(const MM__TimerV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.MM_TimerV.");
if (other_value.timerValue().is_bound()) field_timerValue = other_value.timerValue();
else field_timerValue.clean_up();
if (other_value.unit().is_bound()) field_unit = other_value.unit();
else field_unit.clean_up();
}

void MM__TimerV::clean_up()
{
field_timerValue.clean_up();
field_unit.clean_up();
}

const TTCN_Typedescriptor_t* MM__TimerV::get_descriptor() const { return &MM__TimerV_descr_; }
MM__TimerV& MM__TimerV::operator=(const MM__TimerV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.MM_TimerV.");
  if (other_value.timerValue().is_bound()) field_timerValue = other_value.timerValue();
  else field_timerValue.clean_up();
  if (other_value.unit().is_bound()) field_unit = other_value.unit();
  else field_unit.clean_up();
}
return *this;
}

boolean MM__TimerV::operator==(const MM__TimerV& other_value) const
{
return field_timerValue==other_value.field_timerValue
  && field_unit==other_value.field_unit;
}

boolean MM__TimerV::is_bound() const
{
return (field_timerValue.is_bound())
  || (field_unit.is_bound());
}
boolean MM__TimerV::is_value() const
{
return field_timerValue.is_value()
  && field_unit.is_value();
}
void MM__TimerV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ timerValue := ");
field_timerValue.log();
TTCN_Logger::log_event_str(", unit := ");
field_unit.log();
TTCN_Logger::log_event_str(" }");
}

void MM__TimerV::set_implicit_omit()
{
if (timerValue().is_bound()) timerValue().set_implicit_omit();
if (unit().is_bound()) unit().set_implicit_omit();
}

void MM__TimerV::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_MM_Types.MM_TimerV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) timerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unit().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.MM_TimerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.MM_TimerV");
  }
}

void MM__TimerV::encode_text(Text_Buf& text_buf) const
{
field_timerValue.encode_text(text_buf);
field_unit.encode_text(text_buf);
}

void MM__TimerV::decode_text(Text_Buf& text_buf)
{
field_timerValue.decode_text(text_buf);
field_unit.decode_text(text_buf);
}

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

int MM__TimerV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT5_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  encoded_length += field_timerValue.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_unit.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct MM__TimerV_template::single_value_struct {
BITSTRING_template field_timerValue;
BITSTRING_template field_unit;
};

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

void MM__TimerV_template::copy_value(const MM__TimerV& other_value)
{
single_value = new single_value_struct;
if (other_value.timerValue().is_bound()) {
  single_value->field_timerValue = other_value.timerValue();
} else {
  single_value->field_timerValue.clean_up();
}
if (other_value.unit().is_bound()) {
  single_value->field_unit = other_value.unit();
} else {
  single_value->field_unit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MM__TimerV_template::copy_template(const MM__TimerV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.timerValue().get_selection()) {
single_value->field_timerValue = other_value.timerValue();
} else {
single_value->field_timerValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.unit().get_selection()) {
single_value->field_unit = other_value.unit();
} else {
single_value->field_unit.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MM__TimerV_template[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 MM__TimerV_template(*other_value.implication_.precondition);
implication_.implied_template = new MM__TimerV_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_MM_Types.MM_TimerV.");
break;
}
set_selection(other_value);
}

MM__TimerV_template::MM__TimerV_template()
{
}

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

MM__TimerV_template::MM__TimerV_template(const MM__TimerV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

boolean MM__TimerV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_timerValue.is_value()
 && single_value->field_unit.is_value();
}

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

MM__TimerV MM__TimerV_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_MM_Types.MM_TimerV.");
MM__TimerV ret_val;
if (single_value->field_timerValue.is_bound()) {
ret_val.timerValue() = single_value->field_timerValue.valueof();
}
if (single_value->field_unit.is_bound()) {
ret_val.unit() = single_value->field_unit.valueof();
}
return ret_val;
}

void MM__TimerV_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_MM_Types.MM_TimerV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MM__TimerV_template[list_length];
}

MM__TimerV_template& MM__TimerV_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_MM_Types.MM_TimerV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.MM_TimerV.");
return value_list.list_value[list_index];
}

BITSTRING_template& MM__TimerV_template::timerValue()
{
set_specific();
return single_value->field_timerValue;
}

const BITSTRING_template& MM__TimerV_template::timerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timerValue of a non-specific template of type @MobileL3_MM_Types.MM_TimerV.");
return single_value->field_timerValue;
}

BITSTRING_template& MM__TimerV_template::unit()
{
set_specific();
return single_value->field_unit;
}

const BITSTRING_template& MM__TimerV_template::unit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field unit of a non-specific template of type @MobileL3_MM_Types.MM_TimerV.");
return single_value->field_unit;
}

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

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

void MM__TimerV_template::log_match(const MM__TimerV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_timerValue.match(match_value.timerValue(), legacy)){
TTCN_Logger::log_logmatch_info(".timerValue");
single_value->field_timerValue.log_match(match_value.timerValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_unit.match(match_value.unit(), legacy)){
TTCN_Logger::log_logmatch_info(".unit");
single_value->field_unit.log_match(match_value.unit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ timerValue := ");
single_value->field_timerValue.log_match(match_value.timerValue(), legacy);
TTCN_Logger::log_event_str(", unit := ");
single_value->field_unit.log_match(match_value.unit(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void MM__TimerV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (timerValue().is_bound()) timerValue().set_implicit_omit();
if (unit().is_bound()) unit().set_implicit_omit();
}

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

void MM__TimerV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_timerValue.decode_text(text_buf);
single_value->field_unit.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MM__TimerV_template[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_MM_Types.MM_TimerV.");
}
}

void MM__TimerV_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: {
    MM__TimerV_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_MM_Types.MM_TimerV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) timerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unit().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.MM_TimerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MM__TimerV_template* precondition = new MM__TimerV_template;
    precondition->set_param(*param.get_elem(0));
    MM__TimerV_template* implied_template = new MM__TimerV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MM__TimerV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.MM_TimerV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MM__TimerV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_timerValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.MM_TimerV");
single_value->field_unit.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.MM_TimerV");
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_MM_Types.MM_TimerV");
}

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

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

MM__TimerTLV::MM__TimerTLV()
{
}

MM__TimerTLV::MM__TimerTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const MM__TimerV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

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

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

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

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

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

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

void MM__TimerTLV::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_MM_Types.MM_TimerTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.MM_TimerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.MM_TimerTLV");
  }
}

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

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

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

int MM__TimerTLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MM__TimerTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MM__TimerV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &MM__TimerTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_valueField.RAW_encode(MM__TimerV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_5) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MM__TimerTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
MM__TimerV_template field_valueField;
};

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

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

void MM__TimerTLV_template::copy_template(const MM__TimerTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MM__TimerTLV_template[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 MM__TimerTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MM__TimerTLV_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_MM_Types.MM_TimerTLV.");
break;
}
set_selection(other_value);
}

MM__TimerTLV_template::MM__TimerTLV_template()
{
}

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

MM__TimerTLV_template::MM__TimerTLV_template(const MM__TimerTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

MM__TimerTLV MM__TimerTLV_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_MM_Types.MM_TimerTLV.");
MM__TimerTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void MM__TimerTLV_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_MM_Types.MM_TimerTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MM__TimerTLV_template[list_length];
}

MM__TimerTLV_template& MM__TimerTLV_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_MM_Types.MM_TimerTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.MM_TimerTLV.");
return value_list.list_value[list_index];
}

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

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

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

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

MM__TimerV_template& MM__TimerTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const MM__TimerV_template& MM__TimerTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_MM_Types.MM_TimerTLV.");
return single_value->field_valueField;
}

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

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

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

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

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

void MM__TimerTLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MM__TimerTLV_template[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_MM_Types.MM_TimerTLV.");
}
}

void MM__TimerTLV_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: {
    MM__TimerTLV_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_MM_Types.MM_TimerTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_MM_Types.MM_TimerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MM__TimerTLV_template* precondition = new MM__TimerTLV_template;
    precondition->set_param(*param.get_elem(0));
    MM__TimerTLV_template* implied_template = new MM__TimerTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MM__TimerTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.MM_TimerTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MM__TimerTLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.MM_TimerTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.MM_TimerTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.MM_TimerTLV");
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_MM_Types.MM_TimerTLV");
}

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

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

PDU__ML3__AuthenticationReject::PDU__ML3__AuthenticationReject()
{
}

PDU__ML3__AuthenticationReject::PDU__ML3__AuthenticationReject(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd)
{
}

PDU__ML3__AuthenticationReject::PDU__ML3__AuthenticationReject(const PDU__ML3__AuthenticationReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
}

void PDU__ML3__AuthenticationReject::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__AuthenticationReject::get_descriptor() const { return &PDU__ML3__AuthenticationReject_descr_; }
PDU__ML3__AuthenticationReject& PDU__ML3__AuthenticationReject::operator=(const PDU__ML3__AuthenticationReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
}
return *this;
}

boolean PDU__ML3__AuthenticationReject::operator==(const PDU__ML3__AuthenticationReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__AuthenticationReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__AuthenticationReject::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__AuthenticationReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__AuthenticationReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

void PDU__ML3__AuthenticationReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
}

void PDU__ML3__AuthenticationReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
}

void PDU__ML3__AuthenticationReject::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 PDU__ML3__AuthenticationReject::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 PDU__ML3__AuthenticationReject::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct PDU__ML3__AuthenticationReject_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__AuthenticationReject_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
}
}
}

void PDU__ML3__AuthenticationReject_template::copy_value(const PDU__ML3__AuthenticationReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__AuthenticationReject_template::copy_template(const PDU__ML3__AuthenticationReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__AuthenticationReject_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__AuthenticationReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__AuthenticationReject_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_MM_Types.PDU_ML3_AuthenticationReject.");
break;
}
set_selection(other_value);
}

PDU__ML3__AuthenticationReject_template::PDU__ML3__AuthenticationReject_template()
{
}

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

PDU__ML3__AuthenticationReject_template::PDU__ML3__AuthenticationReject_template(const PDU__ML3__AuthenticationReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__AuthenticationReject_template::match(const PDU__ML3__AuthenticationReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), 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_MM_Types.PDU_ML3_AuthenticationReject.");
}
return FALSE;
}

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

boolean PDU__ML3__AuthenticationReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value();
}

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

PDU__ML3__AuthenticationReject PDU__ML3__AuthenticationReject_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_MM_Types.PDU_ML3_AuthenticationReject.");
PDU__ML3__AuthenticationReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
return ret_val;
}

void PDU__ML3__AuthenticationReject_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_MM_Types.PDU_ML3_AuthenticationReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__AuthenticationReject_template[list_length];
}

PDU__ML3__AuthenticationReject_template& PDU__ML3__AuthenticationReject_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_MM_Types.PDU_ML3_AuthenticationReject.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationReject.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__AuthenticationReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__AuthenticationReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationReject.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__AuthenticationReject_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__AuthenticationReject_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationReject.");
return single_value->field_nsd;
}

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

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

void PDU__ML3__AuthenticationReject_template::log_match(const PDU__ML3__AuthenticationReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__AuthenticationReject_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

void PDU__ML3__AuthenticationReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.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_MM_Types.PDU_ML3_AuthenticationReject.");
}
}

void PDU__ML3__AuthenticationReject_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__AuthenticationReject_template[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_MM_Types.PDU_ML3_AuthenticationReject.");
}
}

void PDU__ML3__AuthenticationReject_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__AuthenticationReject_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_MM_Types.PDU_ML3_AuthenticationReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_AuthenticationReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__AuthenticationReject_template* precondition = new PDU__ML3__AuthenticationReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__AuthenticationReject_template* implied_template = new PDU__ML3__AuthenticationReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__AuthenticationReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_AuthenticationReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__AuthenticationReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationReject");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationReject");
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_MM_Types.PDU_ML3_AuthenticationReject");
}

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

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

PDU__ML3__AuthenticationRequest::PDU__ML3__AuthenticationRequest()
{
}

PDU__ML3__AuthenticationRequest::PDU__ML3__AuthenticationRequest(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_cipheringKeySequenceNumber,
    const BITSTRING& par_spare2__4,
    const OCTETSTRING& par_authenticationParRAND,
    const OPTIONAL< AuthenticationParameterAUTNTLV >& par_authenticationParAUTN)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber),
  field_spare2__4(par_spare2__4),
  field_authenticationParRAND(par_authenticationParRAND),
  field_authenticationParAUTN(par_authenticationParAUTN)
{
}

PDU__ML3__AuthenticationRequest::PDU__ML3__AuthenticationRequest(const PDU__ML3__AuthenticationRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
if (other_value.spare2__4().is_bound()) field_spare2__4 = other_value.spare2__4();
else field_spare2__4.clean_up();
if (other_value.authenticationParRAND().is_bound()) field_authenticationParRAND = other_value.authenticationParRAND();
else field_authenticationParRAND.clean_up();
if (other_value.authenticationParAUTN().is_bound()) field_authenticationParAUTN = other_value.authenticationParAUTN();
else field_authenticationParAUTN.clean_up();
}

void PDU__ML3__AuthenticationRequest::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cipheringKeySequenceNumber.clean_up();
field_spare2__4.clean_up();
field_authenticationParRAND.clean_up();
field_authenticationParAUTN.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__AuthenticationRequest::get_descriptor() const { return &PDU__ML3__AuthenticationRequest_descr_; }
PDU__ML3__AuthenticationRequest& PDU__ML3__AuthenticationRequest::operator=(const PDU__ML3__AuthenticationRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
  if (other_value.spare2__4().is_bound()) field_spare2__4 = other_value.spare2__4();
  else field_spare2__4.clean_up();
  if (other_value.authenticationParRAND().is_bound()) field_authenticationParRAND = other_value.authenticationParRAND();
  else field_authenticationParRAND.clean_up();
  if (other_value.authenticationParAUTN().is_bound()) field_authenticationParAUTN = other_value.authenticationParAUTN();
  else field_authenticationParAUTN.clean_up();
}
return *this;
}

boolean PDU__ML3__AuthenticationRequest::operator==(const PDU__ML3__AuthenticationRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber
  && field_spare2__4==other_value.field_spare2__4
  && field_authenticationParRAND==other_value.field_authenticationParRAND
  && field_authenticationParAUTN==other_value.field_authenticationParAUTN;
}

boolean PDU__ML3__AuthenticationRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_cipheringKeySequenceNumber.is_bound())
  || (field_spare2__4.is_bound())
  || (field_authenticationParRAND.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParAUTN.get_selection() || field_authenticationParAUTN.is_bound());
}
boolean PDU__ML3__AuthenticationRequest::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_cipheringKeySequenceNumber.is_value()
  && field_spare2__4.is_value()
  && field_authenticationParRAND.is_value()
  && (OPTIONAL_OMIT == field_authenticationParAUTN.get_selection() || field_authenticationParAUTN.is_value());
}
int PDU__ML3__AuthenticationRequest::size_of() const
{
  int ret_val = 5;
  if (field_authenticationParAUTN.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__AuthenticationRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", spare2_4 := ");
field_spare2__4.log();
TTCN_Logger::log_event_str(", authenticationParRAND := ");
field_authenticationParRAND.log();
TTCN_Logger::log_event_str(", authenticationParAUTN := ");
field_authenticationParAUTN.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__AuthenticationRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (spare2__4().is_bound()) spare2__4().set_implicit_omit();
if (authenticationParRAND().is_bound()) authenticationParRAND().set_implicit_omit();
if (!authenticationParAUTN().is_bound()) authenticationParAUTN() = OMIT_VALUE;
else authenticationParAUTN().set_implicit_omit();
}

void PDU__ML3__AuthenticationRequest::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_MM_Types.PDU_ML3_AuthenticationRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare2__4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) authenticationParRAND().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationParAUTN().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2_4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2__4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParRAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParRAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParAUTN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParAUTN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_AuthenticationRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
  }
}

void PDU__ML3__AuthenticationRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cipheringKeySequenceNumber.encode_text(text_buf);
field_spare2__4.encode_text(text_buf);
field_authenticationParRAND.encode_text(text_buf);
field_authenticationParAUTN.encode_text(text_buf);
}

void PDU__ML3__AuthenticationRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cipheringKeySequenceNumber.decode_text(text_buf);
field_spare2__4.decode_text(text_buf);
field_authenticationParRAND.decode_text(text_buf);
field_authenticationParAUTN.decode_text(text_buf);
}

void PDU__ML3__AuthenticationRequest::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 PDU__ML3__AuthenticationRequest::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 PDU__ML3__AuthenticationRequest::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySequenceNumber.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare2__4.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::OCT16_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParRAND.RAW_decode(General__Types::OCT16_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_authenticationParAUTN = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, AuthenticationParameterAUTNTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParAUTN().RAW_decode(AuthenticationParameterAUTNTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParAUTN = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationParAUTN.ispresent() || field_authenticationParAUTN().elementIdentifier() !=  os_6){
  field_authenticationParAUTN=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_authenticationParAUTN=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__AuthenticationRequest::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::OCT16_descr_.raw);
  if (field_authenticationParAUTN.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AuthenticationParameterAUTNTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cipheringKeySequenceNumber.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare2__4.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_authenticationParRAND.RAW_encode(General__Types::OCT16_descr_, *myleaf.body.node.nodes[4]);
  if (field_authenticationParAUTN.ispresent()) {
  encoded_length += field_authenticationParAUTN().RAW_encode(AuthenticationParameterAUTNTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_authenticationParAUTN.ispresent() && (!field_authenticationParAUTN.ispresent() || field_authenticationParAUTN().elementIdentifier() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,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){
   os_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__AuthenticationRequest_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_cipheringKeySequenceNumber;
BITSTRING_template field_spare2__4;
OCTETSTRING_template field_authenticationParRAND;
AuthenticationParameterAUTNTLV_template field_authenticationParAUTN;
};

void PDU__ML3__AuthenticationRequest_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_cipheringKeySequenceNumber = ANY_VALUE;
single_value->field_spare2__4 = ANY_VALUE;
single_value->field_authenticationParRAND = ANY_VALUE;
single_value->field_authenticationParAUTN = ANY_OR_OMIT;
}
}
}

void PDU__ML3__AuthenticationRequest_template::copy_value(const PDU__ML3__AuthenticationRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.cipheringKeySequenceNumber().is_bound()) {
  single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (other_value.spare2__4().is_bound()) {
  single_value->field_spare2__4 = other_value.spare2__4();
} else {
  single_value->field_spare2__4.clean_up();
}
if (other_value.authenticationParRAND().is_bound()) {
  single_value->field_authenticationParRAND = other_value.authenticationParRAND();
} else {
  single_value->field_authenticationParRAND.clean_up();
}
if (other_value.authenticationParAUTN().is_bound()) {
  if (other_value.authenticationParAUTN().ispresent()) single_value->field_authenticationParAUTN = other_value.authenticationParAUTN()();
  else single_value->field_authenticationParAUTN = OMIT_VALUE;
} else {
  single_value->field_authenticationParAUTN.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__AuthenticationRequest_template::copy_template(const PDU__ML3__AuthenticationRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringKeySequenceNumber().get_selection()) {
single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2__4().get_selection()) {
single_value->field_spare2__4 = other_value.spare2__4();
} else {
single_value->field_spare2__4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParRAND().get_selection()) {
single_value->field_authenticationParRAND = other_value.authenticationParRAND();
} else {
single_value->field_authenticationParRAND.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParAUTN().get_selection()) {
single_value->field_authenticationParAUTN = other_value.authenticationParAUTN();
} else {
single_value->field_authenticationParAUTN.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__AuthenticationRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__AuthenticationRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__AuthenticationRequest_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_MM_Types.PDU_ML3_AuthenticationRequest.");
break;
}
set_selection(other_value);
}

PDU__ML3__AuthenticationRequest_template::PDU__ML3__AuthenticationRequest_template()
{
}

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

PDU__ML3__AuthenticationRequest_template::PDU__ML3__AuthenticationRequest_template(const PDU__ML3__AuthenticationRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__AuthenticationRequest_template::match(const PDU__ML3__AuthenticationRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.cipheringKeySequenceNumber().is_bound()) return FALSE;
if(!single_value->field_cipheringKeySequenceNumber.match(other_value.cipheringKeySequenceNumber(), legacy))return FALSE;
if(!other_value.spare2__4().is_bound()) return FALSE;
if(!single_value->field_spare2__4.match(other_value.spare2__4(), legacy))return FALSE;
if(!other_value.authenticationParRAND().is_bound()) return FALSE;
if(!single_value->field_authenticationParRAND.match(other_value.authenticationParRAND(), legacy))return FALSE;
if(!other_value.authenticationParAUTN().is_bound()) return FALSE;
if((other_value.authenticationParAUTN().ispresent() ? !single_value->field_authenticationParAUTN.match((const AuthenticationParameterAUTNTLV&)other_value.authenticationParAUTN(), legacy) : !single_value->field_authenticationParAUTN.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_MM_Types.PDU_ML3_AuthenticationRequest.");
}
return FALSE;
}

boolean PDU__ML3__AuthenticationRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_cipheringKeySequenceNumber.is_bound()
 || single_value->field_spare2__4.is_bound()
 || single_value->field_authenticationParRAND.is_bound()
 || (single_value->field_authenticationParAUTN.is_omit() || single_value->field_authenticationParAUTN.is_bound());
}

boolean PDU__ML3__AuthenticationRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_cipheringKeySequenceNumber.is_value()
 && single_value->field_spare2__4.is_value()
 && single_value->field_authenticationParRAND.is_value()
 && (single_value->field_authenticationParAUTN.is_omit() || single_value->field_authenticationParAUTN.is_value());
}

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

PDU__ML3__AuthenticationRequest PDU__ML3__AuthenticationRequest_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_MM_Types.PDU_ML3_AuthenticationRequest.");
PDU__ML3__AuthenticationRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
if (single_value->field_spare2__4.is_bound()) {
ret_val.spare2__4() = single_value->field_spare2__4.valueof();
}
if (single_value->field_authenticationParRAND.is_bound()) {
ret_val.authenticationParRAND() = single_value->field_authenticationParRAND.valueof();
}
if (single_value->field_authenticationParAUTN.is_omit()) ret_val.authenticationParAUTN() = OMIT_VALUE;
else if (single_value->field_authenticationParAUTN.is_bound()) {
ret_val.authenticationParAUTN() = single_value->field_authenticationParAUTN.valueof();
}
return ret_val;
}

void PDU__ML3__AuthenticationRequest_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_MM_Types.PDU_ML3_AuthenticationRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__AuthenticationRequest_template[list_length];
}

PDU__ML3__AuthenticationRequest_template& PDU__ML3__AuthenticationRequest_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_MM_Types.PDU_ML3_AuthenticationRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__AuthenticationRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__AuthenticationRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__AuthenticationRequest_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__AuthenticationRequest_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
return single_value->field_nsd;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__AuthenticationRequest_template::cipheringKeySequenceNumber()
{
set_specific();
return single_value->field_cipheringKeySequenceNumber;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__AuthenticationRequest_template::cipheringKeySequenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringKeySequenceNumber of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
return single_value->field_cipheringKeySequenceNumber;
}

BITSTRING_template& PDU__ML3__AuthenticationRequest_template::spare2__4()
{
set_specific();
return single_value->field_spare2__4;
}

const BITSTRING_template& PDU__ML3__AuthenticationRequest_template::spare2__4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare2_4 of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
return single_value->field_spare2__4;
}

OCTETSTRING_template& PDU__ML3__AuthenticationRequest_template::authenticationParRAND()
{
set_specific();
return single_value->field_authenticationParRAND;
}

const OCTETSTRING_template& PDU__ML3__AuthenticationRequest_template::authenticationParRAND() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParRAND of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
return single_value->field_authenticationParRAND;
}

AuthenticationParameterAUTNTLV_template& PDU__ML3__AuthenticationRequest_template::authenticationParAUTN()
{
set_specific();
return single_value->field_authenticationParAUTN;
}

const AuthenticationParameterAUTNTLV_template& PDU__ML3__AuthenticationRequest_template::authenticationParAUTN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParAUTN of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationRequest.");
return single_value->field_authenticationParAUTN;
}

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

void PDU__ML3__AuthenticationRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", spare2_4 := ");
single_value->field_spare2__4.log();
TTCN_Logger::log_event_str(", authenticationParRAND := ");
single_value->field_authenticationParRAND.log();
TTCN_Logger::log_event_str(", authenticationParAUTN := ");
single_value->field_authenticationParAUTN.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__AuthenticationRequest_template::log_match(const PDU__ML3__AuthenticationRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cipheringKeySequenceNumber.match(match_value.cipheringKeySequenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare2__4.match(match_value.spare2__4(), legacy)){
TTCN_Logger::log_logmatch_info(".spare2_4");
single_value->field_spare2__4.log_match(match_value.spare2__4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_authenticationParRAND.match(match_value.authenticationParRAND(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParRAND");
single_value->field_authenticationParRAND.log_match(match_value.authenticationParRAND(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.authenticationParAUTN().ispresent()){
if(!single_value->field_authenticationParAUTN.match(match_value.authenticationParAUTN(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParAUTN");
single_value->field_authenticationParAUTN.log_match(match_value.authenticationParAUTN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParAUTN.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParAUTN := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParAUTN.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::log_event_str(", spare2_4 := ");
single_value->field_spare2__4.log_match(match_value.spare2__4(), legacy);
TTCN_Logger::log_event_str(", authenticationParRAND := ");
single_value->field_authenticationParRAND.log_match(match_value.authenticationParRAND(), legacy);
TTCN_Logger::log_event_str(", authenticationParAUTN := ");
if (match_value.authenticationParAUTN().ispresent()) {
single_value->field_authenticationParAUTN.log_match(match_value.authenticationParAUTN(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParAUTN.log();
if (single_value->field_authenticationParAUTN.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__AuthenticationRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (spare2__4().is_bound()) spare2__4().set_implicit_omit();
if (authenticationParRAND().is_bound()) authenticationParRAND().set_implicit_omit();
if (!authenticationParAUTN().is_bound()) authenticationParAUTN() = OMIT_VALUE;
else authenticationParAUTN().set_implicit_omit();
}

void PDU__ML3__AuthenticationRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.encode_text(text_buf);
single_value->field_spare2__4.encode_text(text_buf);
single_value->field_authenticationParRAND.encode_text(text_buf);
single_value->field_authenticationParAUTN.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_MM_Types.PDU_ML3_AuthenticationRequest.");
}
}

void PDU__ML3__AuthenticationRequest_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.decode_text(text_buf);
single_value->field_spare2__4.decode_text(text_buf);
single_value->field_authenticationParRAND.decode_text(text_buf);
single_value->field_authenticationParAUTN.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__AuthenticationRequest_template[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_MM_Types.PDU_ML3_AuthenticationRequest.");
}
}

void PDU__ML3__AuthenticationRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__AuthenticationRequest_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_MM_Types.PDU_ML3_AuthenticationRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare2__4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) authenticationParRAND().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationParAUTN().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2_4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2__4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParRAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParRAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParAUTN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParAUTN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_AuthenticationRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__AuthenticationRequest_template* precondition = new PDU__ML3__AuthenticationRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__AuthenticationRequest_template* implied_template = new PDU__ML3__AuthenticationRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__AuthenticationRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__AuthenticationRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
single_value->field_spare2__4.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
single_value->field_authenticationParRAND.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
single_value->field_authenticationParAUTN.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest");
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_MM_Types.PDU_ML3_AuthenticationRequest");
}

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

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

PDU__ML3__AuthenticationResponse::PDU__ML3__AuthenticationResponse()
{
}

PDU__ML3__AuthenticationResponse::PDU__ML3__AuthenticationResponse(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OCTETSTRING& par_authenticationParSRES,
    const OPTIONAL< AuthenticationResponseParameterUMTSTLV >& par_authenticationParSRESext)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_authenticationParSRES(par_authenticationParSRES),
  field_authenticationParSRESext(par_authenticationParSRESext)
{
}

PDU__ML3__AuthenticationResponse::PDU__ML3__AuthenticationResponse(const PDU__ML3__AuthenticationResponse& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.authenticationParSRES().is_bound()) field_authenticationParSRES = other_value.authenticationParSRES();
else field_authenticationParSRES.clean_up();
if (other_value.authenticationParSRESext().is_bound()) field_authenticationParSRESext = other_value.authenticationParSRESext();
else field_authenticationParSRESext.clean_up();
}

void PDU__ML3__AuthenticationResponse::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_authenticationParSRES.clean_up();
field_authenticationParSRESext.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__AuthenticationResponse::get_descriptor() const { return &PDU__ML3__AuthenticationResponse_descr_; }
PDU__ML3__AuthenticationResponse& PDU__ML3__AuthenticationResponse::operator=(const PDU__ML3__AuthenticationResponse& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.authenticationParSRES().is_bound()) field_authenticationParSRES = other_value.authenticationParSRES();
  else field_authenticationParSRES.clean_up();
  if (other_value.authenticationParSRESext().is_bound()) field_authenticationParSRESext = other_value.authenticationParSRESext();
  else field_authenticationParSRESext.clean_up();
}
return *this;
}

boolean PDU__ML3__AuthenticationResponse::operator==(const PDU__ML3__AuthenticationResponse& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_authenticationParSRES==other_value.field_authenticationParSRES
  && field_authenticationParSRESext==other_value.field_authenticationParSRESext;
}

boolean PDU__ML3__AuthenticationResponse::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_authenticationParSRES.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParSRESext.get_selection() || field_authenticationParSRESext.is_bound());
}
boolean PDU__ML3__AuthenticationResponse::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_authenticationParSRES.is_value()
  && (OPTIONAL_OMIT == field_authenticationParSRESext.get_selection() || field_authenticationParSRESext.is_value());
}
int PDU__ML3__AuthenticationResponse::size_of() const
{
  int ret_val = 3;
  if (field_authenticationParSRESext.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__AuthenticationResponse::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", authenticationParSRES := ");
field_authenticationParSRES.log();
TTCN_Logger::log_event_str(", authenticationParSRESext := ");
field_authenticationParSRESext.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__AuthenticationResponse::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (authenticationParSRES().is_bound()) authenticationParSRES().set_implicit_omit();
if (!authenticationParSRESext().is_bound()) authenticationParSRESext() = OMIT_VALUE;
else authenticationParSRESext().set_implicit_omit();
}

void PDU__ML3__AuthenticationResponse::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_MM_Types.PDU_ML3_AuthenticationResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) authenticationParSRES().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParSRESext().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParSRES")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParSRES().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParSRESext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParSRESext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_AuthenticationResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse");
  }
}

void PDU__ML3__AuthenticationResponse::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_authenticationParSRES.encode_text(text_buf);
field_authenticationParSRESext.encode_text(text_buf);
}

void PDU__ML3__AuthenticationResponse::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_authenticationParSRES.decode_text(text_buf);
field_authenticationParSRESext.decode_text(text_buf);
}

void PDU__ML3__AuthenticationResponse::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 PDU__ML3__AuthenticationResponse::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 PDU__ML3__AuthenticationResponse::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParSRES.RAW_decode(General__Types::OCT4_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_authenticationParSRESext = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, AuthenticationResponseParameterUMTSTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParSRESext().RAW_decode(AuthenticationResponseParameterUMTSTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParSRESext = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationParSRESext.ispresent() || field_authenticationParSRESext().elementIdentifier() !=  os_0){
  field_authenticationParSRESext=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_authenticationParSRESext=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__AuthenticationResponse::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT4_descr_.raw);
  if (field_authenticationParSRESext.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AuthenticationResponseParameterUMTSTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_authenticationParSRES.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_authenticationParSRESext.ispresent()) {
  encoded_length += field_authenticationParSRESext().RAW_encode(AuthenticationResponseParameterUMTSTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_authenticationParSRESext.ispresent() && (!field_authenticationParSRESext.ispresent() || field_authenticationParSRESext().elementIdentifier() !=  os_0)) {
  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){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__AuthenticationResponse_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
OCTETSTRING_template field_authenticationParSRES;
AuthenticationResponseParameterUMTSTLV_template field_authenticationParSRESext;
};

void PDU__ML3__AuthenticationResponse_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_authenticationParSRES = ANY_VALUE;
single_value->field_authenticationParSRESext = ANY_OR_OMIT;
}
}
}

void PDU__ML3__AuthenticationResponse_template::copy_value(const PDU__ML3__AuthenticationResponse& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.authenticationParSRES().is_bound()) {
  single_value->field_authenticationParSRES = other_value.authenticationParSRES();
} else {
  single_value->field_authenticationParSRES.clean_up();
}
if (other_value.authenticationParSRESext().is_bound()) {
  if (other_value.authenticationParSRESext().ispresent()) single_value->field_authenticationParSRESext = other_value.authenticationParSRESext()();
  else single_value->field_authenticationParSRESext = OMIT_VALUE;
} else {
  single_value->field_authenticationParSRESext.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__AuthenticationResponse_template::copy_template(const PDU__ML3__AuthenticationResponse_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParSRES().get_selection()) {
single_value->field_authenticationParSRES = other_value.authenticationParSRES();
} else {
single_value->field_authenticationParSRES.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParSRESext().get_selection()) {
single_value->field_authenticationParSRESext = other_value.authenticationParSRESext();
} else {
single_value->field_authenticationParSRESext.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__AuthenticationResponse_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__AuthenticationResponse_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__AuthenticationResponse_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_MM_Types.PDU_ML3_AuthenticationResponse.");
break;
}
set_selection(other_value);
}

PDU__ML3__AuthenticationResponse_template::PDU__ML3__AuthenticationResponse_template()
{
}

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

PDU__ML3__AuthenticationResponse_template::PDU__ML3__AuthenticationResponse_template(const PDU__ML3__AuthenticationResponse& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__AuthenticationResponse_template::match(const PDU__ML3__AuthenticationResponse& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.authenticationParSRES().is_bound()) return FALSE;
if(!single_value->field_authenticationParSRES.match(other_value.authenticationParSRES(), legacy))return FALSE;
if(!other_value.authenticationParSRESext().is_bound()) return FALSE;
if((other_value.authenticationParSRESext().ispresent() ? !single_value->field_authenticationParSRESext.match((const AuthenticationResponseParameterUMTSTLV&)other_value.authenticationParSRESext(), legacy) : !single_value->field_authenticationParSRESext.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_MM_Types.PDU_ML3_AuthenticationResponse.");
}
return FALSE;
}

boolean PDU__ML3__AuthenticationResponse_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_authenticationParSRES.is_bound()
 || (single_value->field_authenticationParSRESext.is_omit() || single_value->field_authenticationParSRESext.is_bound());
}

boolean PDU__ML3__AuthenticationResponse_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_authenticationParSRES.is_value()
 && (single_value->field_authenticationParSRESext.is_omit() || single_value->field_authenticationParSRESext.is_value());
}

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

PDU__ML3__AuthenticationResponse PDU__ML3__AuthenticationResponse_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_MM_Types.PDU_ML3_AuthenticationResponse.");
PDU__ML3__AuthenticationResponse ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_authenticationParSRES.is_bound()) {
ret_val.authenticationParSRES() = single_value->field_authenticationParSRES.valueof();
}
if (single_value->field_authenticationParSRESext.is_omit()) ret_val.authenticationParSRESext() = OMIT_VALUE;
else if (single_value->field_authenticationParSRESext.is_bound()) {
ret_val.authenticationParSRESext() = single_value->field_authenticationParSRESext.valueof();
}
return ret_val;
}

void PDU__ML3__AuthenticationResponse_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_MM_Types.PDU_ML3_AuthenticationResponse.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__AuthenticationResponse_template[list_length];
}

PDU__ML3__AuthenticationResponse_template& PDU__ML3__AuthenticationResponse_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_MM_Types.PDU_ML3_AuthenticationResponse.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__AuthenticationResponse_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__AuthenticationResponse_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__AuthenticationResponse_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__AuthenticationResponse_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.");
return single_value->field_nsd;
}

OCTETSTRING_template& PDU__ML3__AuthenticationResponse_template::authenticationParSRES()
{
set_specific();
return single_value->field_authenticationParSRES;
}

const OCTETSTRING_template& PDU__ML3__AuthenticationResponse_template::authenticationParSRES() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParSRES of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.");
return single_value->field_authenticationParSRES;
}

AuthenticationResponseParameterUMTSTLV_template& PDU__ML3__AuthenticationResponse_template::authenticationParSRESext()
{
set_specific();
return single_value->field_authenticationParSRESext;
}

const AuthenticationResponseParameterUMTSTLV_template& PDU__ML3__AuthenticationResponse_template::authenticationParSRESext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParSRESext of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationResponse.");
return single_value->field_authenticationParSRESext;
}

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

void PDU__ML3__AuthenticationResponse_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", authenticationParSRES := ");
single_value->field_authenticationParSRES.log();
TTCN_Logger::log_event_str(", authenticationParSRESext := ");
single_value->field_authenticationParSRESext.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__AuthenticationResponse_template::log_match(const PDU__ML3__AuthenticationResponse& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_authenticationParSRES.match(match_value.authenticationParSRES(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParSRES");
single_value->field_authenticationParSRES.log_match(match_value.authenticationParSRES(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.authenticationParSRESext().ispresent()){
if(!single_value->field_authenticationParSRESext.match(match_value.authenticationParSRESext(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParSRESext");
single_value->field_authenticationParSRESext.log_match(match_value.authenticationParSRESext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParSRESext.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParSRESext := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParSRESext.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", authenticationParSRES := ");
single_value->field_authenticationParSRES.log_match(match_value.authenticationParSRES(), legacy);
TTCN_Logger::log_event_str(", authenticationParSRESext := ");
if (match_value.authenticationParSRESext().ispresent()) {
single_value->field_authenticationParSRESext.log_match(match_value.authenticationParSRESext(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParSRESext.log();
if (single_value->field_authenticationParSRESext.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__AuthenticationResponse_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (authenticationParSRES().is_bound()) authenticationParSRES().set_implicit_omit();
if (!authenticationParSRESext().is_bound()) authenticationParSRESext() = OMIT_VALUE;
else authenticationParSRESext().set_implicit_omit();
}

void PDU__ML3__AuthenticationResponse_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_authenticationParSRES.encode_text(text_buf);
single_value->field_authenticationParSRESext.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_MM_Types.PDU_ML3_AuthenticationResponse.");
}
}

void PDU__ML3__AuthenticationResponse_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_authenticationParSRES.decode_text(text_buf);
single_value->field_authenticationParSRESext.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__AuthenticationResponse_template[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_MM_Types.PDU_ML3_AuthenticationResponse.");
}
}

void PDU__ML3__AuthenticationResponse_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__AuthenticationResponse_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_MM_Types.PDU_ML3_AuthenticationResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) authenticationParSRES().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParSRESext().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParSRES")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParSRES().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParSRESext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParSRESext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_AuthenticationResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__AuthenticationResponse_template* precondition = new PDU__ML3__AuthenticationResponse_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__AuthenticationResponse_template* implied_template = new PDU__ML3__AuthenticationResponse_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__AuthenticationResponse_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__AuthenticationResponse_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse");
single_value->field_authenticationParSRES.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse");
single_value->field_authenticationParSRESext.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse");
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_MM_Types.PDU_ML3_AuthenticationResponse");
}

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

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

PDU__ML3__AuthenticationFailure::PDU__ML3__AuthenticationFailure()
{
}

PDU__ML3__AuthenticationFailure::PDU__ML3__AuthenticationFailure(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OCTETSTRING& par_rejectCause,
    const OPTIONAL< AuthenticationFailureParametersTLV >& par_authenticationParFailure)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_rejectCause(par_rejectCause),
  field_authenticationParFailure(par_authenticationParFailure)
{
}

PDU__ML3__AuthenticationFailure::PDU__ML3__AuthenticationFailure(const PDU__ML3__AuthenticationFailure& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
else field_rejectCause.clean_up();
if (other_value.authenticationParFailure().is_bound()) field_authenticationParFailure = other_value.authenticationParFailure();
else field_authenticationParFailure.clean_up();
}

void PDU__ML3__AuthenticationFailure::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_rejectCause.clean_up();
field_authenticationParFailure.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__AuthenticationFailure::get_descriptor() const { return &PDU__ML3__AuthenticationFailure_descr_; }
PDU__ML3__AuthenticationFailure& PDU__ML3__AuthenticationFailure::operator=(const PDU__ML3__AuthenticationFailure& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
  else field_rejectCause.clean_up();
  if (other_value.authenticationParFailure().is_bound()) field_authenticationParFailure = other_value.authenticationParFailure();
  else field_authenticationParFailure.clean_up();
}
return *this;
}

boolean PDU__ML3__AuthenticationFailure::operator==(const PDU__ML3__AuthenticationFailure& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_rejectCause==other_value.field_rejectCause
  && field_authenticationParFailure==other_value.field_authenticationParFailure;
}

boolean PDU__ML3__AuthenticationFailure::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_rejectCause.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParFailure.get_selection() || field_authenticationParFailure.is_bound());
}
boolean PDU__ML3__AuthenticationFailure::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_rejectCause.is_value()
  && (OPTIONAL_OMIT == field_authenticationParFailure.get_selection() || field_authenticationParFailure.is_value());
}
int PDU__ML3__AuthenticationFailure::size_of() const
{
  int ret_val = 3;
  if (field_authenticationParFailure.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__AuthenticationFailure::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
field_rejectCause.log();
TTCN_Logger::log_event_str(", authenticationParFailure := ");
field_authenticationParFailure.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__AuthenticationFailure::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
if (!authenticationParFailure().is_bound()) authenticationParFailure() = OMIT_VALUE;
else authenticationParFailure().set_implicit_omit();
}

void PDU__ML3__AuthenticationFailure::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_MM_Types.PDU_ML3_AuthenticationFailure 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rejectCause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParFailure().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rejectCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rejectCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParFailure")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParFailure().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_AuthenticationFailure: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure");
  }
}

void PDU__ML3__AuthenticationFailure::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_rejectCause.encode_text(text_buf);
field_authenticationParFailure.encode_text(text_buf);
}

void PDU__ML3__AuthenticationFailure::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_rejectCause.decode_text(text_buf);
field_authenticationParFailure.decode_text(text_buf);
}

void PDU__ML3__AuthenticationFailure::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 PDU__ML3__AuthenticationFailure::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 PDU__ML3__AuthenticationFailure::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rejectCause.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_authenticationParFailure = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, AuthenticationFailureParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParFailure().RAW_decode(AuthenticationFailureParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParFailure = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationParFailure.ispresent() || field_authenticationParFailure().elementIdentifier() !=  os_1){
  field_authenticationParFailure=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_authenticationParFailure=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__AuthenticationFailure::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  if (field_authenticationParFailure.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AuthenticationFailureParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rejectCause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  if (field_authenticationParFailure.ispresent()) {
  encoded_length += field_authenticationParFailure().RAW_encode(AuthenticationFailureParametersTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_authenticationParFailure.ispresent() && (!field_authenticationParFailure.ispresent() || field_authenticationParFailure().elementIdentifier() !=  os_1)) {
  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){
   os_1.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__AuthenticationFailure_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
OCTETSTRING_template field_rejectCause;
AuthenticationFailureParametersTLV_template field_authenticationParFailure;
};

void PDU__ML3__AuthenticationFailure_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_rejectCause = ANY_VALUE;
single_value->field_authenticationParFailure = ANY_OR_OMIT;
}
}
}

void PDU__ML3__AuthenticationFailure_template::copy_value(const PDU__ML3__AuthenticationFailure& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.rejectCause().is_bound()) {
  single_value->field_rejectCause = other_value.rejectCause();
} else {
  single_value->field_rejectCause.clean_up();
}
if (other_value.authenticationParFailure().is_bound()) {
  if (other_value.authenticationParFailure().ispresent()) single_value->field_authenticationParFailure = other_value.authenticationParFailure()();
  else single_value->field_authenticationParFailure = OMIT_VALUE;
} else {
  single_value->field_authenticationParFailure.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__AuthenticationFailure_template::copy_template(const PDU__ML3__AuthenticationFailure_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rejectCause().get_selection()) {
single_value->field_rejectCause = other_value.rejectCause();
} else {
single_value->field_rejectCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParFailure().get_selection()) {
single_value->field_authenticationParFailure = other_value.authenticationParFailure();
} else {
single_value->field_authenticationParFailure.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__AuthenticationFailure_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__AuthenticationFailure_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__AuthenticationFailure_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_MM_Types.PDU_ML3_AuthenticationFailure.");
break;
}
set_selection(other_value);
}

PDU__ML3__AuthenticationFailure_template::PDU__ML3__AuthenticationFailure_template()
{
}

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

PDU__ML3__AuthenticationFailure_template::PDU__ML3__AuthenticationFailure_template(const PDU__ML3__AuthenticationFailure& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__AuthenticationFailure_template::match(const PDU__ML3__AuthenticationFailure& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.rejectCause().is_bound()) return FALSE;
if(!single_value->field_rejectCause.match(other_value.rejectCause(), legacy))return FALSE;
if(!other_value.authenticationParFailure().is_bound()) return FALSE;
if((other_value.authenticationParFailure().ispresent() ? !single_value->field_authenticationParFailure.match((const AuthenticationFailureParametersTLV&)other_value.authenticationParFailure(), legacy) : !single_value->field_authenticationParFailure.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_MM_Types.PDU_ML3_AuthenticationFailure.");
}
return FALSE;
}

boolean PDU__ML3__AuthenticationFailure_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_rejectCause.is_bound()
 || (single_value->field_authenticationParFailure.is_omit() || single_value->field_authenticationParFailure.is_bound());
}

boolean PDU__ML3__AuthenticationFailure_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_rejectCause.is_value()
 && (single_value->field_authenticationParFailure.is_omit() || single_value->field_authenticationParFailure.is_value());
}

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

PDU__ML3__AuthenticationFailure PDU__ML3__AuthenticationFailure_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_MM_Types.PDU_ML3_AuthenticationFailure.");
PDU__ML3__AuthenticationFailure ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_rejectCause.is_bound()) {
ret_val.rejectCause() = single_value->field_rejectCause.valueof();
}
if (single_value->field_authenticationParFailure.is_omit()) ret_val.authenticationParFailure() = OMIT_VALUE;
else if (single_value->field_authenticationParFailure.is_bound()) {
ret_val.authenticationParFailure() = single_value->field_authenticationParFailure.valueof();
}
return ret_val;
}

void PDU__ML3__AuthenticationFailure_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_MM_Types.PDU_ML3_AuthenticationFailure.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__AuthenticationFailure_template[list_length];
}

PDU__ML3__AuthenticationFailure_template& PDU__ML3__AuthenticationFailure_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_MM_Types.PDU_ML3_AuthenticationFailure.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__AuthenticationFailure_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__AuthenticationFailure_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__AuthenticationFailure_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__AuthenticationFailure_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.");
return single_value->field_nsd;
}

OCTETSTRING_template& PDU__ML3__AuthenticationFailure_template::rejectCause()
{
set_specific();
return single_value->field_rejectCause;
}

const OCTETSTRING_template& PDU__ML3__AuthenticationFailure_template::rejectCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rejectCause of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.");
return single_value->field_rejectCause;
}

AuthenticationFailureParametersTLV_template& PDU__ML3__AuthenticationFailure_template::authenticationParFailure()
{
set_specific();
return single_value->field_authenticationParFailure;
}

const AuthenticationFailureParametersTLV_template& PDU__ML3__AuthenticationFailure_template::authenticationParFailure() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParFailure of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_AuthenticationFailure.");
return single_value->field_authenticationParFailure;
}

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

void PDU__ML3__AuthenticationFailure_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log();
TTCN_Logger::log_event_str(", authenticationParFailure := ");
single_value->field_authenticationParFailure.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__AuthenticationFailure_template::log_match(const PDU__ML3__AuthenticationFailure& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rejectCause.match(match_value.rejectCause(), legacy)){
TTCN_Logger::log_logmatch_info(".rejectCause");
single_value->field_rejectCause.log_match(match_value.rejectCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.authenticationParFailure().ispresent()){
if(!single_value->field_authenticationParFailure.match(match_value.authenticationParFailure(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParFailure");
single_value->field_authenticationParFailure.log_match(match_value.authenticationParFailure(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParFailure.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParFailure := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParFailure.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log_match(match_value.rejectCause(), legacy);
TTCN_Logger::log_event_str(", authenticationParFailure := ");
if (match_value.authenticationParFailure().ispresent()) {
single_value->field_authenticationParFailure.log_match(match_value.authenticationParFailure(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParFailure.log();
if (single_value->field_authenticationParFailure.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__AuthenticationFailure_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
if (!authenticationParFailure().is_bound()) authenticationParFailure() = OMIT_VALUE;
else authenticationParFailure().set_implicit_omit();
}

void PDU__ML3__AuthenticationFailure_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_rejectCause.encode_text(text_buf);
single_value->field_authenticationParFailure.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_MM_Types.PDU_ML3_AuthenticationFailure.");
}
}

void PDU__ML3__AuthenticationFailure_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_rejectCause.decode_text(text_buf);
single_value->field_authenticationParFailure.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__AuthenticationFailure_template[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_MM_Types.PDU_ML3_AuthenticationFailure.");
}
}

void PDU__ML3__AuthenticationFailure_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__AuthenticationFailure_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_MM_Types.PDU_ML3_AuthenticationFailure 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rejectCause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParFailure().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rejectCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rejectCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParFailure")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParFailure().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_AuthenticationFailure: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__AuthenticationFailure_template* precondition = new PDU__ML3__AuthenticationFailure_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__AuthenticationFailure_template* implied_template = new PDU__ML3__AuthenticationFailure_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__AuthenticationFailure_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__AuthenticationFailure_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure");
single_value->field_rejectCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure");
single_value->field_authenticationParFailure.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure");
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_MM_Types.PDU_ML3_AuthenticationFailure");
}

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

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

PDU__ML3__CMReestablishmentRequest::PDU__ML3__CMReestablishmentRequest()
{
}

PDU__ML3__CMReestablishmentRequest::PDU__ML3__CMReestablishmentRequest(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_cipheringKeySequenceNumber,
    const BITSTRING& par_spare,
    const MobileL3__CommonIE__Types::MobileStationClassmark2__LV& par_mobileStationClassmark2,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentityLV,
    const OPTIONAL< MobileL3__CommonIE__Types::LocationAreaIdentification__TV >& par_locationAreaIdentification,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber),
  field_spare(par_spare),
  field_mobileStationClassmark2(par_mobileStationClassmark2),
  field_mobileIdentityLV(par_mobileIdentityLV),
  field_locationAreaIdentification(par_locationAreaIdentification),
  field_deviceProperties(par_deviceProperties)
{
}

PDU__ML3__CMReestablishmentRequest::PDU__ML3__CMReestablishmentRequest(const PDU__ML3__CMReestablishmentRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
else field_mobileStationClassmark2.clean_up();
if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
else field_mobileIdentityLV.clean_up();
if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
else field_locationAreaIdentification.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
}

void PDU__ML3__CMReestablishmentRequest::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cipheringKeySequenceNumber.clean_up();
field_spare.clean_up();
field_mobileStationClassmark2.clean_up();
field_mobileIdentityLV.clean_up();
field_locationAreaIdentification.clean_up();
field_deviceProperties.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CMReestablishmentRequest::get_descriptor() const { return &PDU__ML3__CMReestablishmentRequest_descr_; }
PDU__ML3__CMReestablishmentRequest& PDU__ML3__CMReestablishmentRequest::operator=(const PDU__ML3__CMReestablishmentRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
  else field_mobileStationClassmark2.clean_up();
  if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
  else field_mobileIdentityLV.clean_up();
  if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
  else field_locationAreaIdentification.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
}
return *this;
}

boolean PDU__ML3__CMReestablishmentRequest::operator==(const PDU__ML3__CMReestablishmentRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber
  && field_spare==other_value.field_spare
  && field_mobileStationClassmark2==other_value.field_mobileStationClassmark2
  && field_mobileIdentityLV==other_value.field_mobileIdentityLV
  && field_locationAreaIdentification==other_value.field_locationAreaIdentification
  && field_deviceProperties==other_value.field_deviceProperties;
}

boolean PDU__ML3__CMReestablishmentRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_cipheringKeySequenceNumber.is_bound())
  || (field_spare.is_bound())
  || (field_mobileStationClassmark2.is_bound())
  || (field_mobileIdentityLV.is_bound())
  || (OPTIONAL_OMIT == field_locationAreaIdentification.get_selection() || field_locationAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound());
}
boolean PDU__ML3__CMReestablishmentRequest::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_cipheringKeySequenceNumber.is_value()
  && field_spare.is_value()
  && field_mobileStationClassmark2.is_value()
  && field_mobileIdentityLV.is_value()
  && (OPTIONAL_OMIT == field_locationAreaIdentification.get_selection() || field_locationAreaIdentification.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value());
}
int PDU__ML3__CMReestablishmentRequest::size_of() const
{
  int ret_val = 6;
  if (field_locationAreaIdentification.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__CMReestablishmentRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
field_mobileIdentityLV.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CMReestablishmentRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (mobileStationClassmark2().is_bound()) mobileStationClassmark2().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
if (!locationAreaIdentification().is_bound()) locationAreaIdentification() = OMIT_VALUE;
else locationAreaIdentification().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
}

void PDU__ML3__CMReestablishmentRequest::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityLV().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMReestablishmentRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
  }
}

void PDU__ML3__CMReestablishmentRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cipheringKeySequenceNumber.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_mobileStationClassmark2.encode_text(text_buf);
field_mobileIdentityLV.encode_text(text_buf);
field_locationAreaIdentification.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
}

void PDU__ML3__CMReestablishmentRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cipheringKeySequenceNumber.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_mobileStationClassmark2.decode_text(text_buf);
field_mobileIdentityLV.decode_text(text_buf);
field_locationAreaIdentification.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
}

void PDU__ML3__CMReestablishmentRequest::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 PDU__ML3__CMReestablishmentRequest::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 PDU__ML3__CMReestablishmentRequest::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySequenceNumber.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2.RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentityLV.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_locationAreaIdentification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::LocationAreaIdentification__TV_descr_.raw->forceomit);
  decoded_field_length = field_locationAreaIdentification().RAW_decode(MobileL3__CommonIE__Types::LocationAreaIdentification__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_locationAreaIdentification = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_locationAreaIdentification.ispresent() || field_locationAreaIdentification().elementIdentifier() !=  os_7){
  field_locationAreaIdentification=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_locationAreaIdentification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_3){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__CMReestablishmentRequest::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  if (field_locationAreaIdentification.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::LocationAreaIdentification__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cipheringKeySequenceNumber.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mobileStationClassmark2.RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mobileIdentityLV.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[5]);
  if (field_locationAreaIdentification.ispresent()) {
  encoded_length += field_locationAreaIdentification().RAW_encode(MobileL3__CommonIE__Types::LocationAreaIdentification__TV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_locationAreaIdentification.ispresent() && (!field_locationAreaIdentification.ispresent() || field_locationAreaIdentification().elementIdentifier() !=  os_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,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){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,2};
  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::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CMReestablishmentRequest_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_cipheringKeySequenceNumber;
BITSTRING_template field_spare;
MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template field_mobileStationClassmark2;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentityLV;
MobileL3__CommonIE__Types::LocationAreaIdentification__TV_template field_locationAreaIdentification;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
};

void PDU__ML3__CMReestablishmentRequest_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_cipheringKeySequenceNumber = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_mobileStationClassmark2 = ANY_VALUE;
single_value->field_mobileIdentityLV = ANY_VALUE;
single_value->field_locationAreaIdentification = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
}
}
}

void PDU__ML3__CMReestablishmentRequest_template::copy_value(const PDU__ML3__CMReestablishmentRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.cipheringKeySequenceNumber().is_bound()) {
  single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.mobileStationClassmark2().is_bound()) {
  single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
  single_value->field_mobileStationClassmark2.clean_up();
}
if (other_value.mobileIdentityLV().is_bound()) {
  single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
  single_value->field_mobileIdentityLV.clean_up();
}
if (other_value.locationAreaIdentification().is_bound()) {
  if (other_value.locationAreaIdentification().ispresent()) single_value->field_locationAreaIdentification = other_value.locationAreaIdentification()();
  else single_value->field_locationAreaIdentification = OMIT_VALUE;
} else {
  single_value->field_locationAreaIdentification.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CMReestablishmentRequest_template::copy_template(const PDU__ML3__CMReestablishmentRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringKeySequenceNumber().get_selection()) {
single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark2().get_selection()) {
single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
single_value->field_mobileStationClassmark2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentityLV().get_selection()) {
single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
single_value->field_mobileIdentityLV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.locationAreaIdentification().get_selection()) {
single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
single_value->field_locationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__CMReestablishmentRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__CMReestablishmentRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CMReestablishmentRequest_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_MM_Types.PDU_ML3_CMReestablishmentRequest.");
break;
}
set_selection(other_value);
}

PDU__ML3__CMReestablishmentRequest_template::PDU__ML3__CMReestablishmentRequest_template()
{
}

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

PDU__ML3__CMReestablishmentRequest_template::PDU__ML3__CMReestablishmentRequest_template(const PDU__ML3__CMReestablishmentRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CMReestablishmentRequest_template::match(const PDU__ML3__CMReestablishmentRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.cipheringKeySequenceNumber().is_bound()) return FALSE;
if(!single_value->field_cipheringKeySequenceNumber.match(other_value.cipheringKeySequenceNumber(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.mobileStationClassmark2().is_bound()) return FALSE;
if(!single_value->field_mobileStationClassmark2.match(other_value.mobileStationClassmark2(), legacy))return FALSE;
if(!other_value.mobileIdentityLV().is_bound()) return FALSE;
if(!single_value->field_mobileIdentityLV.match(other_value.mobileIdentityLV(), legacy))return FALSE;
if(!other_value.locationAreaIdentification().is_bound()) return FALSE;
if((other_value.locationAreaIdentification().ispresent() ? !single_value->field_locationAreaIdentification.match((const MobileL3__CommonIE__Types::LocationAreaIdentification__TV&)other_value.locationAreaIdentification(), legacy) : !single_value->field_locationAreaIdentification.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.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_MM_Types.PDU_ML3_CMReestablishmentRequest.");
}
return FALSE;
}

boolean PDU__ML3__CMReestablishmentRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_cipheringKeySequenceNumber.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_mobileStationClassmark2.is_bound()
 || single_value->field_mobileIdentityLV.is_bound()
 || (single_value->field_locationAreaIdentification.is_omit() || single_value->field_locationAreaIdentification.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound());
}

boolean PDU__ML3__CMReestablishmentRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_cipheringKeySequenceNumber.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_mobileStationClassmark2.is_value()
 && single_value->field_mobileIdentityLV.is_value()
 && (single_value->field_locationAreaIdentification.is_omit() || single_value->field_locationAreaIdentification.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value());
}

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

PDU__ML3__CMReestablishmentRequest PDU__ML3__CMReestablishmentRequest_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_MM_Types.PDU_ML3_CMReestablishmentRequest.");
PDU__ML3__CMReestablishmentRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_mobileStationClassmark2.is_bound()) {
ret_val.mobileStationClassmark2() = single_value->field_mobileStationClassmark2.valueof();
}
if (single_value->field_mobileIdentityLV.is_bound()) {
ret_val.mobileIdentityLV() = single_value->field_mobileIdentityLV.valueof();
}
if (single_value->field_locationAreaIdentification.is_omit()) ret_val.locationAreaIdentification() = OMIT_VALUE;
else if (single_value->field_locationAreaIdentification.is_bound()) {
ret_val.locationAreaIdentification() = single_value->field_locationAreaIdentification.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
return ret_val;
}

void PDU__ML3__CMReestablishmentRequest_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_MM_Types.PDU_ML3_CMReestablishmentRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CMReestablishmentRequest_template[list_length];
}

PDU__ML3__CMReestablishmentRequest_template& PDU__ML3__CMReestablishmentRequest_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_MM_Types.PDU_ML3_CMReestablishmentRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__CMReestablishmentRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__CMReestablishmentRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__CMReestablishmentRequest_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__CMReestablishmentRequest_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return single_value->field_nsd;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__CMReestablishmentRequest_template::cipheringKeySequenceNumber()
{
set_specific();
return single_value->field_cipheringKeySequenceNumber;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__CMReestablishmentRequest_template::cipheringKeySequenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringKeySequenceNumber of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return single_value->field_cipheringKeySequenceNumber;
}

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

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

MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__ML3__CMReestablishmentRequest_template::mobileStationClassmark2()
{
set_specific();
return single_value->field_mobileStationClassmark2;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__ML3__CMReestablishmentRequest_template::mobileStationClassmark2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2 of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return single_value->field_mobileStationClassmark2;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__CMReestablishmentRequest_template::mobileIdentityLV()
{
set_specific();
return single_value->field_mobileIdentityLV;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__CMReestablishmentRequest_template::mobileIdentityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentityLV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return single_value->field_mobileIdentityLV;
}

MobileL3__CommonIE__Types::LocationAreaIdentification__TV_template& PDU__ML3__CMReestablishmentRequest_template::locationAreaIdentification()
{
set_specific();
return single_value->field_locationAreaIdentification;
}

const MobileL3__CommonIE__Types::LocationAreaIdentification__TV_template& PDU__ML3__CMReestablishmentRequest_template::locationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field locationAreaIdentification of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return single_value->field_locationAreaIdentification;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__ML3__CMReestablishmentRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__ML3__CMReestablishmentRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
return single_value->field_deviceProperties;
}

int PDU__ML3__CMReestablishmentRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_locationAreaIdentification.is_present()) ret_val++;
      if (single_value->field_deviceProperties.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_MM_Types.PDU_ML3_CMReestablishmentRequest 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_MM_Types.PDU_ML3_CMReestablishmentRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest.");
  }
  return 0;
}

void PDU__ML3__CMReestablishmentRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__CMReestablishmentRequest_template::log_match(const PDU__ML3__CMReestablishmentRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cipheringKeySequenceNumber.match(match_value.cipheringKeySequenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileStationClassmark2.match(match_value.mobileStationClassmark2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentityLV.match(match_value.mobileIdentityLV(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentityLV");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.locationAreaIdentification().ispresent()){
if(!single_value->field_locationAreaIdentification.match(match_value.locationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".locationAreaIdentification");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_locationAreaIdentification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".locationAreaIdentification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), legacy);
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
if (match_value.locationAreaIdentification().ispresent()) {
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_locationAreaIdentification.log();
if (single_value->field_locationAreaIdentification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__CMReestablishmentRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (mobileStationClassmark2().is_bound()) mobileStationClassmark2().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
if (!locationAreaIdentification().is_bound()) locationAreaIdentification() = OMIT_VALUE;
else locationAreaIdentification().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
}

void PDU__ML3__CMReestablishmentRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_mobileStationClassmark2.encode_text(text_buf);
single_value->field_mobileIdentityLV.encode_text(text_buf);
single_value->field_locationAreaIdentification.encode_text(text_buf);
single_value->field_deviceProperties.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_MM_Types.PDU_ML3_CMReestablishmentRequest.");
}
}

void PDU__ML3__CMReestablishmentRequest_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_mobileStationClassmark2.decode_text(text_buf);
single_value->field_mobileIdentityLV.decode_text(text_buf);
single_value->field_locationAreaIdentification.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__CMReestablishmentRequest_template[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_MM_Types.PDU_ML3_CMReestablishmentRequest.");
}
}

void PDU__ML3__CMReestablishmentRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__CMReestablishmentRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityLV().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMReestablishmentRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CMReestablishmentRequest_template* precondition = new PDU__ML3__CMReestablishmentRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CMReestablishmentRequest_template* implied_template = new PDU__ML3__CMReestablishmentRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CMReestablishmentRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CMReestablishmentRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
single_value->field_mobileStationClassmark2.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
single_value->field_mobileIdentityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
single_value->field_locationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest");
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_MM_Types.PDU_ML3_CMReestablishmentRequest");
}

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

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

PDU__ML3__CMServiceAccept::PDU__ML3__CMServiceAccept()
{
}

PDU__ML3__CMServiceAccept::PDU__ML3__CMServiceAccept(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd)
{
}

PDU__ML3__CMServiceAccept::PDU__ML3__CMServiceAccept(const PDU__ML3__CMServiceAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
}

void PDU__ML3__CMServiceAccept::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CMServiceAccept::get_descriptor() const { return &PDU__ML3__CMServiceAccept_descr_; }
PDU__ML3__CMServiceAccept& PDU__ML3__CMServiceAccept::operator=(const PDU__ML3__CMServiceAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
}
return *this;
}

boolean PDU__ML3__CMServiceAccept::operator==(const PDU__ML3__CMServiceAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__CMServiceAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__CMServiceAccept::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__CMServiceAccept::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CMServiceAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

void PDU__ML3__CMServiceAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
}

void PDU__ML3__CMServiceAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
}

void PDU__ML3__CMServiceAccept::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 PDU__ML3__CMServiceAccept::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 PDU__ML3__CMServiceAccept::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct PDU__ML3__CMServiceAccept_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__CMServiceAccept_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
}
}
}

void PDU__ML3__CMServiceAccept_template::copy_value(const PDU__ML3__CMServiceAccept& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CMServiceAccept_template::copy_template(const PDU__ML3__CMServiceAccept_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__CMServiceAccept_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__CMServiceAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CMServiceAccept_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_MM_Types.PDU_ML3_CMServiceAccept.");
break;
}
set_selection(other_value);
}

PDU__ML3__CMServiceAccept_template::PDU__ML3__CMServiceAccept_template()
{
}

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

PDU__ML3__CMServiceAccept_template::PDU__ML3__CMServiceAccept_template(const PDU__ML3__CMServiceAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CMServiceAccept_template::match(const PDU__ML3__CMServiceAccept& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), 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_MM_Types.PDU_ML3_CMServiceAccept.");
}
return FALSE;
}

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

boolean PDU__ML3__CMServiceAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value();
}

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

PDU__ML3__CMServiceAccept PDU__ML3__CMServiceAccept_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_MM_Types.PDU_ML3_CMServiceAccept.");
PDU__ML3__CMServiceAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
return ret_val;
}

void PDU__ML3__CMServiceAccept_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_MM_Types.PDU_ML3_CMServiceAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CMServiceAccept_template[list_length];
}

PDU__ML3__CMServiceAccept_template& PDU__ML3__CMServiceAccept_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_MM_Types.PDU_ML3_CMServiceAccept.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_CMServiceAccept.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__CMServiceAccept_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__CMServiceAccept_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceAccept.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__CMServiceAccept_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__CMServiceAccept_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceAccept.");
return single_value->field_nsd;
}

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

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

void PDU__ML3__CMServiceAccept_template::log_match(const PDU__ML3__CMServiceAccept& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__CMServiceAccept_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

void PDU__ML3__CMServiceAccept_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.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_MM_Types.PDU_ML3_CMServiceAccept.");
}
}

void PDU__ML3__CMServiceAccept_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__CMServiceAccept_template[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_MM_Types.PDU_ML3_CMServiceAccept.");
}
}

void PDU__ML3__CMServiceAccept_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__CMServiceAccept_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_MM_Types.PDU_ML3_CMServiceAccept 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServiceAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CMServiceAccept_template* precondition = new PDU__ML3__CMServiceAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CMServiceAccept_template* implied_template = new PDU__ML3__CMServiceAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CMServiceAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_CMServiceAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CMServiceAccept_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceAccept");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceAccept");
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_MM_Types.PDU_ML3_CMServiceAccept");
}

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

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

PDU__ML3__CMServicePrompt::PDU__ML3__CMServicePrompt()
{
}

PDU__ML3__CMServicePrompt::PDU__ML3__CMServicePrompt(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::PdAndSapi& par_pd__sapi)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_pd__sapi(par_pd__sapi)
{
}

PDU__ML3__CMServicePrompt::PDU__ML3__CMServicePrompt(const PDU__ML3__CMServicePrompt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServicePrompt.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.pd__sapi().is_bound()) field_pd__sapi = other_value.pd__sapi();
else field_pd__sapi.clean_up();
}

void PDU__ML3__CMServicePrompt::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_pd__sapi.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CMServicePrompt::get_descriptor() const { return &PDU__ML3__CMServicePrompt_descr_; }
PDU__ML3__CMServicePrompt& PDU__ML3__CMServicePrompt::operator=(const PDU__ML3__CMServicePrompt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServicePrompt.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.pd__sapi().is_bound()) field_pd__sapi = other_value.pd__sapi();
  else field_pd__sapi.clean_up();
}
return *this;
}

boolean PDU__ML3__CMServicePrompt::operator==(const PDU__ML3__CMServicePrompt& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_pd__sapi==other_value.field_pd__sapi;
}

boolean PDU__ML3__CMServicePrompt::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_pd__sapi.is_bound());
}
boolean PDU__ML3__CMServicePrompt::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_pd__sapi.is_value();
}
void PDU__ML3__CMServicePrompt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", pd_sapi := ");
field_pd__sapi.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CMServicePrompt::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (pd__sapi().is_bound()) pd__sapi().set_implicit_omit();
}

void PDU__ML3__CMServicePrompt::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_MM_Types.PDU_ML3_CMServicePrompt 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pd__sapi().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pd_sapi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pd__sapi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServicePrompt: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt");
  }
}

void PDU__ML3__CMServicePrompt::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_pd__sapi.encode_text(text_buf);
}

void PDU__ML3__CMServicePrompt::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_pd__sapi.decode_text(text_buf);
}

void PDU__ML3__CMServicePrompt::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 PDU__ML3__CMServicePrompt::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 PDU__ML3__CMServicePrompt::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::PdAndSapi_descr_.raw->forceomit);
  decoded_field_length = field_pd__sapi.RAW_decode(MobileL3__CommonIE__Types::PdAndSapi_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__CMServicePrompt::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::PdAndSapi_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_pd__sapi.RAW_encode(MobileL3__CommonIE__Types::PdAndSapi_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CMServicePrompt_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::PdAndSapi_template field_pd__sapi;
};

void PDU__ML3__CMServicePrompt_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_pd__sapi = ANY_VALUE;
}
}
}

void PDU__ML3__CMServicePrompt_template::copy_value(const PDU__ML3__CMServicePrompt& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.pd__sapi().is_bound()) {
  single_value->field_pd__sapi = other_value.pd__sapi();
} else {
  single_value->field_pd__sapi.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CMServicePrompt_template::copy_template(const PDU__ML3__CMServicePrompt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pd__sapi().get_selection()) {
single_value->field_pd__sapi = other_value.pd__sapi();
} else {
single_value->field_pd__sapi.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__CMServicePrompt_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__CMServicePrompt_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CMServicePrompt_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_MM_Types.PDU_ML3_CMServicePrompt.");
break;
}
set_selection(other_value);
}

PDU__ML3__CMServicePrompt_template::PDU__ML3__CMServicePrompt_template()
{
}

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

PDU__ML3__CMServicePrompt_template::PDU__ML3__CMServicePrompt_template(const PDU__ML3__CMServicePrompt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CMServicePrompt_template::match(const PDU__ML3__CMServicePrompt& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.pd__sapi().is_bound()) return FALSE;
if(!single_value->field_pd__sapi.match(other_value.pd__sapi(), 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_MM_Types.PDU_ML3_CMServicePrompt.");
}
return FALSE;
}

boolean PDU__ML3__CMServicePrompt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_pd__sapi.is_bound();
}

boolean PDU__ML3__CMServicePrompt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_pd__sapi.is_value();
}

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

PDU__ML3__CMServicePrompt PDU__ML3__CMServicePrompt_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_MM_Types.PDU_ML3_CMServicePrompt.");
PDU__ML3__CMServicePrompt ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_pd__sapi.is_bound()) {
ret_val.pd__sapi() = single_value->field_pd__sapi.valueof();
}
return ret_val;
}

void PDU__ML3__CMServicePrompt_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_MM_Types.PDU_ML3_CMServicePrompt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CMServicePrompt_template[list_length];
}

PDU__ML3__CMServicePrompt_template& PDU__ML3__CMServicePrompt_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_MM_Types.PDU_ML3_CMServicePrompt.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_CMServicePrompt.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__CMServicePrompt_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__CMServicePrompt_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServicePrompt.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__CMServicePrompt_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__CMServicePrompt_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServicePrompt.");
return single_value->field_nsd;
}

MobileL3__CommonIE__Types::PdAndSapi_template& PDU__ML3__CMServicePrompt_template::pd__sapi()
{
set_specific();
return single_value->field_pd__sapi;
}

const MobileL3__CommonIE__Types::PdAndSapi_template& PDU__ML3__CMServicePrompt_template::pd__sapi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pd_sapi of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServicePrompt.");
return single_value->field_pd__sapi;
}

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

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

void PDU__ML3__CMServicePrompt_template::log_match(const PDU__ML3__CMServicePrompt& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pd__sapi.match(match_value.pd__sapi(), legacy)){
TTCN_Logger::log_logmatch_info(".pd_sapi");
single_value->field_pd__sapi.log_match(match_value.pd__sapi(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", pd_sapi := ");
single_value->field_pd__sapi.log_match(match_value.pd__sapi(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__CMServicePrompt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (pd__sapi().is_bound()) pd__sapi().set_implicit_omit();
}

void PDU__ML3__CMServicePrompt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_pd__sapi.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_MM_Types.PDU_ML3_CMServicePrompt.");
}
}

void PDU__ML3__CMServicePrompt_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_pd__sapi.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__CMServicePrompt_template[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_MM_Types.PDU_ML3_CMServicePrompt.");
}
}

void PDU__ML3__CMServicePrompt_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__CMServicePrompt_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_MM_Types.PDU_ML3_CMServicePrompt 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pd__sapi().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pd_sapi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pd__sapi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServicePrompt: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CMServicePrompt_template* precondition = new PDU__ML3__CMServicePrompt_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CMServicePrompt_template* implied_template = new PDU__ML3__CMServicePrompt_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CMServicePrompt_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CMServicePrompt_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt");
single_value->field_pd__sapi.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServicePrompt");
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_MM_Types.PDU_ML3_CMServicePrompt");
}

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

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

PDU__ML3__CMServiceReject::PDU__ML3__CMServiceReject()
{
}

PDU__ML3__CMServiceReject::PDU__ML3__CMServiceReject(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OCTETSTRING& par_rejectCause,
    const OPTIONAL< MM__TimerTLV >& par_t3246__Value)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_rejectCause(par_rejectCause),
  field_t3246__Value(par_t3246__Value)
{
}

PDU__ML3__CMServiceReject::PDU__ML3__CMServiceReject(const PDU__ML3__CMServiceReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
else field_rejectCause.clean_up();
if (other_value.t3246__Value().is_bound()) field_t3246__Value = other_value.t3246__Value();
else field_t3246__Value.clean_up();
}

void PDU__ML3__CMServiceReject::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_rejectCause.clean_up();
field_t3246__Value.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CMServiceReject::get_descriptor() const { return &PDU__ML3__CMServiceReject_descr_; }
PDU__ML3__CMServiceReject& PDU__ML3__CMServiceReject::operator=(const PDU__ML3__CMServiceReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
  else field_rejectCause.clean_up();
  if (other_value.t3246__Value().is_bound()) field_t3246__Value = other_value.t3246__Value();
  else field_t3246__Value.clean_up();
}
return *this;
}

boolean PDU__ML3__CMServiceReject::operator==(const PDU__ML3__CMServiceReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_rejectCause==other_value.field_rejectCause
  && field_t3246__Value==other_value.field_t3246__Value;
}

boolean PDU__ML3__CMServiceReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_rejectCause.is_bound())
  || (OPTIONAL_OMIT == field_t3246__Value.get_selection() || field_t3246__Value.is_bound());
}
boolean PDU__ML3__CMServiceReject::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_rejectCause.is_value()
  && (OPTIONAL_OMIT == field_t3246__Value.get_selection() || field_t3246__Value.is_value());
}
int PDU__ML3__CMServiceReject::size_of() const
{
  int ret_val = 3;
  if (field_t3246__Value.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__CMServiceReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
field_rejectCause.log();
TTCN_Logger::log_event_str(", t3246_Value := ");
field_t3246__Value.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CMServiceReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
if (!t3246__Value().is_bound()) t3246__Value() = OMIT_VALUE;
else t3246__Value().set_implicit_omit();
}

void PDU__ML3__CMServiceReject::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_MM_Types.PDU_ML3_CMServiceReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rejectCause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3246__Value().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rejectCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rejectCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3246_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3246__Value().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServiceReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_CMServiceReject");
  }
}

void PDU__ML3__CMServiceReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_rejectCause.encode_text(text_buf);
field_t3246__Value.encode_text(text_buf);
}

void PDU__ML3__CMServiceReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_rejectCause.decode_text(text_buf);
field_t3246__Value.decode_text(text_buf);
}

void PDU__ML3__CMServiceReject::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 PDU__ML3__CMServiceReject::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 PDU__ML3__CMServiceReject::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rejectCause.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_t3246__Value = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MM__TimerTLV_descr_.raw->forceomit);
  decoded_field_length = field_t3246__Value().RAW_decode(MM__TimerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_t3246__Value = 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_t3246__Value=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__CMServiceReject::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  if (field_t3246__Value.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MM__TimerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rejectCause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  if (field_t3246__Value.ispresent()) {
  encoded_length += field_t3246__Value().RAW_encode(MM__TimerTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CMServiceReject_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
OCTETSTRING_template field_rejectCause;
MM__TimerTLV_template field_t3246__Value;
};

void PDU__ML3__CMServiceReject_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_rejectCause = ANY_VALUE;
single_value->field_t3246__Value = ANY_OR_OMIT;
}
}
}

void PDU__ML3__CMServiceReject_template::copy_value(const PDU__ML3__CMServiceReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.rejectCause().is_bound()) {
  single_value->field_rejectCause = other_value.rejectCause();
} else {
  single_value->field_rejectCause.clean_up();
}
if (other_value.t3246__Value().is_bound()) {
  if (other_value.t3246__Value().ispresent()) single_value->field_t3246__Value = other_value.t3246__Value()();
  else single_value->field_t3246__Value = OMIT_VALUE;
} else {
  single_value->field_t3246__Value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CMServiceReject_template::copy_template(const PDU__ML3__CMServiceReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rejectCause().get_selection()) {
single_value->field_rejectCause = other_value.rejectCause();
} else {
single_value->field_rejectCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3246__Value().get_selection()) {
single_value->field_t3246__Value = other_value.t3246__Value();
} else {
single_value->field_t3246__Value.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__CMServiceReject_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__CMServiceReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CMServiceReject_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_MM_Types.PDU_ML3_CMServiceReject.");
break;
}
set_selection(other_value);
}

PDU__ML3__CMServiceReject_template::PDU__ML3__CMServiceReject_template()
{
}

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

PDU__ML3__CMServiceReject_template::PDU__ML3__CMServiceReject_template(const PDU__ML3__CMServiceReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CMServiceReject_template::match(const PDU__ML3__CMServiceReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.rejectCause().is_bound()) return FALSE;
if(!single_value->field_rejectCause.match(other_value.rejectCause(), legacy))return FALSE;
if(!other_value.t3246__Value().is_bound()) return FALSE;
if((other_value.t3246__Value().ispresent() ? !single_value->field_t3246__Value.match((const MM__TimerTLV&)other_value.t3246__Value(), legacy) : !single_value->field_t3246__Value.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_MM_Types.PDU_ML3_CMServiceReject.");
}
return FALSE;
}

boolean PDU__ML3__CMServiceReject_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_rejectCause.is_bound()
 || (single_value->field_t3246__Value.is_omit() || single_value->field_t3246__Value.is_bound());
}

boolean PDU__ML3__CMServiceReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_rejectCause.is_value()
 && (single_value->field_t3246__Value.is_omit() || single_value->field_t3246__Value.is_value());
}

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

PDU__ML3__CMServiceReject PDU__ML3__CMServiceReject_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_MM_Types.PDU_ML3_CMServiceReject.");
PDU__ML3__CMServiceReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_rejectCause.is_bound()) {
ret_val.rejectCause() = single_value->field_rejectCause.valueof();
}
if (single_value->field_t3246__Value.is_omit()) ret_val.t3246__Value() = OMIT_VALUE;
else if (single_value->field_t3246__Value.is_bound()) {
ret_val.t3246__Value() = single_value->field_t3246__Value.valueof();
}
return ret_val;
}

void PDU__ML3__CMServiceReject_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_MM_Types.PDU_ML3_CMServiceReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CMServiceReject_template[list_length];
}

PDU__ML3__CMServiceReject_template& PDU__ML3__CMServiceReject_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_MM_Types.PDU_ML3_CMServiceReject.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_CMServiceReject.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__CMServiceReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__CMServiceReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceReject.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__CMServiceReject_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__CMServiceReject_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceReject.");
return single_value->field_nsd;
}

OCTETSTRING_template& PDU__ML3__CMServiceReject_template::rejectCause()
{
set_specific();
return single_value->field_rejectCause;
}

const OCTETSTRING_template& PDU__ML3__CMServiceReject_template::rejectCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rejectCause of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceReject.");
return single_value->field_rejectCause;
}

MM__TimerTLV_template& PDU__ML3__CMServiceReject_template::t3246__Value()
{
set_specific();
return single_value->field_t3246__Value;
}

const MM__TimerTLV_template& PDU__ML3__CMServiceReject_template::t3246__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3246_Value of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceReject.");
return single_value->field_t3246__Value;
}

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

void PDU__ML3__CMServiceReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log();
TTCN_Logger::log_event_str(", t3246_Value := ");
single_value->field_t3246__Value.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__CMServiceReject_template::log_match(const PDU__ML3__CMServiceReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rejectCause.match(match_value.rejectCause(), legacy)){
TTCN_Logger::log_logmatch_info(".rejectCause");
single_value->field_rejectCause.log_match(match_value.rejectCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.t3246__Value().ispresent()){
if(!single_value->field_t3246__Value.match(match_value.t3246__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".t3246_Value");
single_value->field_t3246__Value.log_match(match_value.t3246__Value(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3246__Value.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3246_Value := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3246__Value.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log_match(match_value.rejectCause(), legacy);
TTCN_Logger::log_event_str(", t3246_Value := ");
if (match_value.t3246__Value().ispresent()) {
single_value->field_t3246__Value.log_match(match_value.t3246__Value(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3246__Value.log();
if (single_value->field_t3246__Value.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__CMServiceReject_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
if (!t3246__Value().is_bound()) t3246__Value() = OMIT_VALUE;
else t3246__Value().set_implicit_omit();
}

void PDU__ML3__CMServiceReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_rejectCause.encode_text(text_buf);
single_value->field_t3246__Value.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_MM_Types.PDU_ML3_CMServiceReject.");
}
}

void PDU__ML3__CMServiceReject_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_rejectCause.decode_text(text_buf);
single_value->field_t3246__Value.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__CMServiceReject_template[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_MM_Types.PDU_ML3_CMServiceReject.");
}
}

void PDU__ML3__CMServiceReject_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__CMServiceReject_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_MM_Types.PDU_ML3_CMServiceReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rejectCause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3246__Value().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rejectCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rejectCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3246_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3246__Value().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServiceReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CMServiceReject_template* precondition = new PDU__ML3__CMServiceReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CMServiceReject_template* implied_template = new PDU__ML3__CMServiceReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CMServiceReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_CMServiceReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CMServiceReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceReject");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceReject");
single_value->field_rejectCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceReject");
single_value->field_t3246__Value.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceReject");
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_MM_Types.PDU_ML3_CMServiceReject");
}

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

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

PDU__ML3__CMServiceAbort::PDU__ML3__CMServiceAbort()
{
}

PDU__ML3__CMServiceAbort::PDU__ML3__CMServiceAbort(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd)
{
}

PDU__ML3__CMServiceAbort::PDU__ML3__CMServiceAbort(const PDU__ML3__CMServiceAbort& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceAbort.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
}

void PDU__ML3__CMServiceAbort::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CMServiceAbort::get_descriptor() const { return &PDU__ML3__CMServiceAbort_descr_; }
PDU__ML3__CMServiceAbort& PDU__ML3__CMServiceAbort::operator=(const PDU__ML3__CMServiceAbort& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceAbort.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
}
return *this;
}

boolean PDU__ML3__CMServiceAbort::operator==(const PDU__ML3__CMServiceAbort& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__CMServiceAbort::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__CMServiceAbort::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__CMServiceAbort::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CMServiceAbort::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

void PDU__ML3__CMServiceAbort::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
}

void PDU__ML3__CMServiceAbort::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
}

void PDU__ML3__CMServiceAbort::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 PDU__ML3__CMServiceAbort::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 PDU__ML3__CMServiceAbort::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct PDU__ML3__CMServiceAbort_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__CMServiceAbort_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
}
}
}

void PDU__ML3__CMServiceAbort_template::copy_value(const PDU__ML3__CMServiceAbort& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CMServiceAbort_template::copy_template(const PDU__ML3__CMServiceAbort_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__CMServiceAbort_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__CMServiceAbort_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CMServiceAbort_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_MM_Types.PDU_ML3_CMServiceAbort.");
break;
}
set_selection(other_value);
}

PDU__ML3__CMServiceAbort_template::PDU__ML3__CMServiceAbort_template()
{
}

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

PDU__ML3__CMServiceAbort_template::PDU__ML3__CMServiceAbort_template(const PDU__ML3__CMServiceAbort& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CMServiceAbort_template::match(const PDU__ML3__CMServiceAbort& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), 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_MM_Types.PDU_ML3_CMServiceAbort.");
}
return FALSE;
}

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

boolean PDU__ML3__CMServiceAbort_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value();
}

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

PDU__ML3__CMServiceAbort PDU__ML3__CMServiceAbort_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_MM_Types.PDU_ML3_CMServiceAbort.");
PDU__ML3__CMServiceAbort ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
return ret_val;
}

void PDU__ML3__CMServiceAbort_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_MM_Types.PDU_ML3_CMServiceAbort.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CMServiceAbort_template[list_length];
}

PDU__ML3__CMServiceAbort_template& PDU__ML3__CMServiceAbort_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_MM_Types.PDU_ML3_CMServiceAbort.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_CMServiceAbort.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__CMServiceAbort_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__CMServiceAbort_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceAbort.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__CMServiceAbort_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__CMServiceAbort_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceAbort.");
return single_value->field_nsd;
}

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

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

void PDU__ML3__CMServiceAbort_template::log_match(const PDU__ML3__CMServiceAbort& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__CMServiceAbort_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

void PDU__ML3__CMServiceAbort_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.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_MM_Types.PDU_ML3_CMServiceAbort.");
}
}

void PDU__ML3__CMServiceAbort_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__CMServiceAbort_template[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_MM_Types.PDU_ML3_CMServiceAbort.");
}
}

void PDU__ML3__CMServiceAbort_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__CMServiceAbort_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_MM_Types.PDU_ML3_CMServiceAbort 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServiceAbort: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CMServiceAbort_template* precondition = new PDU__ML3__CMServiceAbort_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CMServiceAbort_template* implied_template = new PDU__ML3__CMServiceAbort_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CMServiceAbort_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_CMServiceAbort");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CMServiceAbort_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceAbort");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceAbort");
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_MM_Types.PDU_ML3_CMServiceAbort");
}

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

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

PDU__ML3__Abort::PDU__ML3__Abort()
{
}

PDU__ML3__Abort::PDU__ML3__Abort(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OCTETSTRING& par_rejectCause)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_rejectCause(par_rejectCause)
{
}

PDU__ML3__Abort::PDU__ML3__Abort(const PDU__ML3__Abort& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_Abort.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
else field_rejectCause.clean_up();
}

void PDU__ML3__Abort::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_rejectCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Abort::get_descriptor() const { return &PDU__ML3__Abort_descr_; }
PDU__ML3__Abort& PDU__ML3__Abort::operator=(const PDU__ML3__Abort& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_Abort.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
  else field_rejectCause.clean_up();
}
return *this;
}

boolean PDU__ML3__Abort::operator==(const PDU__ML3__Abort& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_rejectCause==other_value.field_rejectCause;
}

boolean PDU__ML3__Abort::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_rejectCause.is_bound());
}
boolean PDU__ML3__Abort::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_rejectCause.is_value();
}
void PDU__ML3__Abort::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
field_rejectCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Abort::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
}

void PDU__ML3__Abort::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_MM_Types.PDU_ML3_Abort 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rejectCause().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rejectCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rejectCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_Abort: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_Abort");
  }
}

void PDU__ML3__Abort::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_rejectCause.encode_text(text_buf);
}

void PDU__ML3__Abort::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_rejectCause.decode_text(text_buf);
}

void PDU__ML3__Abort::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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 PDU__ML3__Abort::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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 PDU__ML3__Abort::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rejectCause.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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__Abort::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rejectCause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__Abort_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
OCTETSTRING_template field_rejectCause;
};

void PDU__ML3__Abort_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_rejectCause = ANY_VALUE;
}
}
}

void PDU__ML3__Abort_template::copy_value(const PDU__ML3__Abort& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.rejectCause().is_bound()) {
  single_value->field_rejectCause = other_value.rejectCause();
} else {
  single_value->field_rejectCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

PDU__ML3__Abort_template::PDU__ML3__Abort_template()
{
}

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

PDU__ML3__Abort_template::PDU__ML3__Abort_template(const PDU__ML3__Abort& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Abort_template::match(const PDU__ML3__Abort& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.rejectCause().is_bound()) return FALSE;
if(!single_value->field_rejectCause.match(other_value.rejectCause(), 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_MM_Types.PDU_ML3_Abort.");
}
return FALSE;
}

boolean PDU__ML3__Abort_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_rejectCause.is_bound();
}

boolean PDU__ML3__Abort_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_rejectCause.is_value();
}

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

PDU__ML3__Abort PDU__ML3__Abort_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_MM_Types.PDU_ML3_Abort.");
PDU__ML3__Abort ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_rejectCause.is_bound()) {
ret_val.rejectCause() = single_value->field_rejectCause.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& PDU__ML3__Abort_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__Abort_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_Abort.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__Abort_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__Abort_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_Abort.");
return single_value->field_nsd;
}

OCTETSTRING_template& PDU__ML3__Abort_template::rejectCause()
{
set_specific();
return single_value->field_rejectCause;
}

const OCTETSTRING_template& PDU__ML3__Abort_template::rejectCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rejectCause of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_Abort.");
return single_value->field_rejectCause;
}

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

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

void PDU__ML3__Abort_template::log_match(const PDU__ML3__Abort& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rejectCause.match(match_value.rejectCause(), legacy)){
TTCN_Logger::log_logmatch_info(".rejectCause");
single_value->field_rejectCause.log_match(match_value.rejectCause(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log_match(match_value.rejectCause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__Abort_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
}

void PDU__ML3__Abort_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_rejectCause.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_MM_Types.PDU_ML3_Abort.");
}
}

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

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

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

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

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

PDU__ML3__CMServiceRequest::PDU__ML3__CMServiceRequest()
{
}

PDU__ML3__CMServiceRequest::PDU__ML3__CMServiceRequest(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const BITSTRING& par_cm__ServiceType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_cipheringKeySequenceNumber,
    const MobileL3__CommonIE__Types::MobileStationClassmark2__LV& par_mobileStationClassmark2,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity,
    const OPTIONAL< MobileL3__CommonIE__Types::PriorityLevel__ML3 >& par_priorityLevel,
    const OPTIONAL< MobileL3__CommonIE__Types::AdditionalUpdateParameterTV >& par_additionalUpdateParameterTV,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cm__ServiceType(par_cm__ServiceType),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber),
  field_mobileStationClassmark2(par_mobileStationClassmark2),
  field_mobileIdentity(par_mobileIdentity),
  field_priorityLevel(par_priorityLevel),
  field_additionalUpdateParameterTV(par_additionalUpdateParameterTV),
  field_deviceProperties(par_deviceProperties)
{
}

PDU__ML3__CMServiceRequest::PDU__ML3__CMServiceRequest(const PDU__ML3__CMServiceRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.cm__ServiceType().is_bound()) field_cm__ServiceType = other_value.cm__ServiceType();
else field_cm__ServiceType.clean_up();
if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
else field_mobileStationClassmark2.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
if (other_value.priorityLevel().is_bound()) field_priorityLevel = other_value.priorityLevel();
else field_priorityLevel.clean_up();
if (other_value.additionalUpdateParameterTV().is_bound()) field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV();
else field_additionalUpdateParameterTV.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
}

void PDU__ML3__CMServiceRequest::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cm__ServiceType.clean_up();
field_cipheringKeySequenceNumber.clean_up();
field_mobileStationClassmark2.clean_up();
field_mobileIdentity.clean_up();
field_priorityLevel.clean_up();
field_additionalUpdateParameterTV.clean_up();
field_deviceProperties.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CMServiceRequest::get_descriptor() const { return &PDU__ML3__CMServiceRequest_descr_; }
PDU__ML3__CMServiceRequest& PDU__ML3__CMServiceRequest::operator=(const PDU__ML3__CMServiceRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.cm__ServiceType().is_bound()) field_cm__ServiceType = other_value.cm__ServiceType();
  else field_cm__ServiceType.clean_up();
  if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
  if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
  else field_mobileStationClassmark2.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
  if (other_value.priorityLevel().is_bound()) field_priorityLevel = other_value.priorityLevel();
  else field_priorityLevel.clean_up();
  if (other_value.additionalUpdateParameterTV().is_bound()) field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV();
  else field_additionalUpdateParameterTV.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
}
return *this;
}

boolean PDU__ML3__CMServiceRequest::operator==(const PDU__ML3__CMServiceRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cm__ServiceType==other_value.field_cm__ServiceType
  && field_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber
  && field_mobileStationClassmark2==other_value.field_mobileStationClassmark2
  && field_mobileIdentity==other_value.field_mobileIdentity
  && field_priorityLevel==other_value.field_priorityLevel
  && field_additionalUpdateParameterTV==other_value.field_additionalUpdateParameterTV
  && field_deviceProperties==other_value.field_deviceProperties;
}

boolean PDU__ML3__CMServiceRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_cm__ServiceType.is_bound())
  || (field_cipheringKeySequenceNumber.is_bound())
  || (field_mobileStationClassmark2.is_bound())
  || (field_mobileIdentity.is_bound())
  || (OPTIONAL_OMIT == field_priorityLevel.get_selection() || field_priorityLevel.is_bound())
  || (OPTIONAL_OMIT == field_additionalUpdateParameterTV.get_selection() || field_additionalUpdateParameterTV.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound());
}
boolean PDU__ML3__CMServiceRequest::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_cm__ServiceType.is_value()
  && field_cipheringKeySequenceNumber.is_value()
  && field_mobileStationClassmark2.is_value()
  && field_mobileIdentity.is_value()
  && (OPTIONAL_OMIT == field_priorityLevel.get_selection() || field_priorityLevel.is_value())
  && (OPTIONAL_OMIT == field_additionalUpdateParameterTV.get_selection() || field_additionalUpdateParameterTV.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value());
}
int PDU__ML3__CMServiceRequest::size_of() const
{
  int ret_val = 6;
  if (field_priorityLevel.ispresent()) ret_val++;
  if (field_additionalUpdateParameterTV.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__CMServiceRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", cm_ServiceType := ");
field_cm__ServiceType.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(", priorityLevel := ");
field_priorityLevel.log();
TTCN_Logger::log_event_str(", additionalUpdateParameterTV := ");
field_additionalUpdateParameterTV.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CMServiceRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cm__ServiceType().is_bound()) cm__ServiceType().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (mobileStationClassmark2().is_bound()) mobileStationClassmark2().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (!priorityLevel().is_bound()) priorityLevel() = OMIT_VALUE;
else priorityLevel().set_implicit_omit();
if (!additionalUpdateParameterTV().is_bound()) additionalUpdateParameterTV() = OMIT_VALUE;
else additionalUpdateParameterTV().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
}

void PDU__ML3__CMServiceRequest::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cm__ServiceType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) priorityLevel().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateParameterTV().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cm_ServiceType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cm__ServiceType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateParameterTV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateParameterTV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServiceRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
  }
}

void PDU__ML3__CMServiceRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cm__ServiceType.encode_text(text_buf);
field_cipheringKeySequenceNumber.encode_text(text_buf);
field_mobileStationClassmark2.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
field_priorityLevel.encode_text(text_buf);
field_additionalUpdateParameterTV.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
}

void PDU__ML3__CMServiceRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cm__ServiceType.decode_text(text_buf);
field_cipheringKeySequenceNumber.decode_text(text_buf);
field_mobileStationClassmark2.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
field_priorityLevel.decode_text(text_buf);
field_additionalUpdateParameterTV.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
}

void PDU__ML3__CMServiceRequest::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 PDU__ML3__CMServiceRequest::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 PDU__ML3__CMServiceRequest::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_cm__ServiceType.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySequenceNumber.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_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, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2.RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_priorityLevel = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_.raw->forceomit);
  decoded_field_length = field_priorityLevel().RAW_decode(MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_priorityLevel = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_priorityLevel.ispresent() || field_priorityLevel().elementIdentifier() !=  bs_4){
  field_priorityLevel=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_priorityLevel=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_additionalUpdateParameterTV = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_.raw->forceomit);
  decoded_field_length = field_additionalUpdateParameterTV().RAW_decode(MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_additionalUpdateParameterTV = 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_additionalUpdateParameterTV=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_3){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__CMServiceRequest::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  if (field_priorityLevel.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_additionalUpdateParameterTV.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cm__ServiceType.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cipheringKeySequenceNumber.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mobileStationClassmark2.RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[5]);
  if (field_priorityLevel.ispresent()) {
  encoded_length += field_priorityLevel().RAW_encode(MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_additionalUpdateParameterTV.ispresent()) {
  encoded_length += field_additionalUpdateParameterTV().RAW_encode(MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_priorityLevel.ispresent() && (!field_priorityLevel.ispresent() || field_priorityLevel().elementIdentifier() !=  bs_4)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,2};
  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_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,2};
  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::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CMServiceRequest_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
BITSTRING_template field_cm__ServiceType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_cipheringKeySequenceNumber;
MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template field_mobileStationClassmark2;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
MobileL3__CommonIE__Types::PriorityLevel__ML3_template field_priorityLevel;
MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template field_additionalUpdateParameterTV;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
};

void PDU__ML3__CMServiceRequest_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_cm__ServiceType = ANY_VALUE;
single_value->field_cipheringKeySequenceNumber = ANY_VALUE;
single_value->field_mobileStationClassmark2 = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
single_value->field_priorityLevel = ANY_OR_OMIT;
single_value->field_additionalUpdateParameterTV = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
}
}
}

void PDU__ML3__CMServiceRequest_template::copy_value(const PDU__ML3__CMServiceRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.cm__ServiceType().is_bound()) {
  single_value->field_cm__ServiceType = other_value.cm__ServiceType();
} else {
  single_value->field_cm__ServiceType.clean_up();
}
if (other_value.cipheringKeySequenceNumber().is_bound()) {
  single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (other_value.mobileStationClassmark2().is_bound()) {
  single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
  single_value->field_mobileStationClassmark2.clean_up();
}
if (other_value.mobileIdentity().is_bound()) {
  single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
  single_value->field_mobileIdentity.clean_up();
}
if (other_value.priorityLevel().is_bound()) {
  if (other_value.priorityLevel().ispresent()) single_value->field_priorityLevel = other_value.priorityLevel()();
  else single_value->field_priorityLevel = OMIT_VALUE;
} else {
  single_value->field_priorityLevel.clean_up();
}
if (other_value.additionalUpdateParameterTV().is_bound()) {
  if (other_value.additionalUpdateParameterTV().ispresent()) single_value->field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV()();
  else single_value->field_additionalUpdateParameterTV = OMIT_VALUE;
} else {
  single_value->field_additionalUpdateParameterTV.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CMServiceRequest_template::copy_template(const PDU__ML3__CMServiceRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cm__ServiceType().get_selection()) {
single_value->field_cm__ServiceType = other_value.cm__ServiceType();
} else {
single_value->field_cm__ServiceType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringKeySequenceNumber().get_selection()) {
single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark2().get_selection()) {
single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
single_value->field_mobileStationClassmark2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity().get_selection()) {
single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
single_value->field_mobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priorityLevel().get_selection()) {
single_value->field_priorityLevel = other_value.priorityLevel();
} else {
single_value->field_priorityLevel.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalUpdateParameterTV().get_selection()) {
single_value->field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV();
} else {
single_value->field_additionalUpdateParameterTV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__CMServiceRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__CMServiceRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CMServiceRequest_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_MM_Types.PDU_ML3_CMServiceRequest.");
break;
}
set_selection(other_value);
}

PDU__ML3__CMServiceRequest_template::PDU__ML3__CMServiceRequest_template()
{
}

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

PDU__ML3__CMServiceRequest_template::PDU__ML3__CMServiceRequest_template(const PDU__ML3__CMServiceRequest& other_value)
{
copy_value(other_value);
}

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

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

PDU__ML3__CMServiceRequest_template::PDU__ML3__CMServiceRequest_template(Dynamic_Match_Interface<PDU__ML3__CMServiceRequest>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__ML3__CMServiceRequest>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__ML3__CMServiceRequest_template::PDU__ML3__CMServiceRequest_template(const PDU__ML3__CMServiceRequest_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__ML3__CMServiceRequest_template::~PDU__ML3__CMServiceRequest_template()
{
clean_up();
}

PDU__ML3__CMServiceRequest_template& PDU__ML3__CMServiceRequest_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__ML3__CMServiceRequest_template& PDU__ML3__CMServiceRequest_template::operator=(const PDU__ML3__CMServiceRequest& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__ML3__CMServiceRequest_template& PDU__ML3__CMServiceRequest_template::operator=(const OPTIONAL<PDU__ML3__CMServiceRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__CMServiceRequest&)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_MM_Types.PDU_ML3_CMServiceRequest.");
}
return *this;
}

PDU__ML3__CMServiceRequest_template& PDU__ML3__CMServiceRequest_template::operator=(const PDU__ML3__CMServiceRequest_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__CMServiceRequest_template::match(const PDU__ML3__CMServiceRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.cm__ServiceType().is_bound()) return FALSE;
if(!single_value->field_cm__ServiceType.match(other_value.cm__ServiceType(), legacy))return FALSE;
if(!other_value.cipheringKeySequenceNumber().is_bound()) return FALSE;
if(!single_value->field_cipheringKeySequenceNumber.match(other_value.cipheringKeySequenceNumber(), legacy))return FALSE;
if(!other_value.mobileStationClassmark2().is_bound()) return FALSE;
if(!single_value->field_mobileStationClassmark2.match(other_value.mobileStationClassmark2(), legacy))return FALSE;
if(!other_value.mobileIdentity().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity.match(other_value.mobileIdentity(), legacy))return FALSE;
if(!other_value.priorityLevel().is_bound()) return FALSE;
if((other_value.priorityLevel().ispresent() ? !single_value->field_priorityLevel.match((const MobileL3__CommonIE__Types::PriorityLevel__ML3&)other_value.priorityLevel(), legacy) : !single_value->field_priorityLevel.match_omit(legacy)))return FALSE;
if(!other_value.additionalUpdateParameterTV().is_bound()) return FALSE;
if((other_value.additionalUpdateParameterTV().ispresent() ? !single_value->field_additionalUpdateParameterTV.match((const MobileL3__CommonIE__Types::AdditionalUpdateParameterTV&)other_value.additionalUpdateParameterTV(), legacy) : !single_value->field_additionalUpdateParameterTV.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.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_MM_Types.PDU_ML3_CMServiceRequest.");
}
return FALSE;
}

boolean PDU__ML3__CMServiceRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_cm__ServiceType.is_bound()
 || single_value->field_cipheringKeySequenceNumber.is_bound()
 || single_value->field_mobileStationClassmark2.is_bound()
 || single_value->field_mobileIdentity.is_bound()
 || (single_value->field_priorityLevel.is_omit() || single_value->field_priorityLevel.is_bound())
 || (single_value->field_additionalUpdateParameterTV.is_omit() || single_value->field_additionalUpdateParameterTV.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound());
}

boolean PDU__ML3__CMServiceRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_cm__ServiceType.is_value()
 && single_value->field_cipheringKeySequenceNumber.is_value()
 && single_value->field_mobileStationClassmark2.is_value()
 && single_value->field_mobileIdentity.is_value()
 && (single_value->field_priorityLevel.is_omit() || single_value->field_priorityLevel.is_value())
 && (single_value->field_additionalUpdateParameterTV.is_omit() || single_value->field_additionalUpdateParameterTV.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value());
}

void PDU__ML3__CMServiceRequest_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__ML3__CMServiceRequest PDU__ML3__CMServiceRequest_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_MM_Types.PDU_ML3_CMServiceRequest.");
PDU__ML3__CMServiceRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_cm__ServiceType.is_bound()) {
ret_val.cm__ServiceType() = single_value->field_cm__ServiceType.valueof();
}
if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
if (single_value->field_mobileStationClassmark2.is_bound()) {
ret_val.mobileStationClassmark2() = single_value->field_mobileStationClassmark2.valueof();
}
if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
if (single_value->field_priorityLevel.is_omit()) ret_val.priorityLevel() = OMIT_VALUE;
else if (single_value->field_priorityLevel.is_bound()) {
ret_val.priorityLevel() = single_value->field_priorityLevel.valueof();
}
if (single_value->field_additionalUpdateParameterTV.is_omit()) ret_val.additionalUpdateParameterTV() = OMIT_VALUE;
else if (single_value->field_additionalUpdateParameterTV.is_bound()) {
ret_val.additionalUpdateParameterTV() = single_value->field_additionalUpdateParameterTV.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
return ret_val;
}

void PDU__ML3__CMServiceRequest_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_MM_Types.PDU_ML3_CMServiceRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CMServiceRequest_template[list_length];
}

PDU__ML3__CMServiceRequest_template& PDU__ML3__CMServiceRequest_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_MM_Types.PDU_ML3_CMServiceRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__CMServiceRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__CMServiceRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__CMServiceRequest_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__CMServiceRequest_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_nsd;
}

BITSTRING_template& PDU__ML3__CMServiceRequest_template::cm__ServiceType()
{
set_specific();
return single_value->field_cm__ServiceType;
}

const BITSTRING_template& PDU__ML3__CMServiceRequest_template::cm__ServiceType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cm_ServiceType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_cm__ServiceType;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__CMServiceRequest_template::cipheringKeySequenceNumber()
{
set_specific();
return single_value->field_cipheringKeySequenceNumber;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__CMServiceRequest_template::cipheringKeySequenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringKeySequenceNumber of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_cipheringKeySequenceNumber;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__ML3__CMServiceRequest_template::mobileStationClassmark2()
{
set_specific();
return single_value->field_mobileStationClassmark2;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__ML3__CMServiceRequest_template::mobileStationClassmark2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2 of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_mobileStationClassmark2;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__CMServiceRequest_template::mobileIdentity()
{
set_specific();
return single_value->field_mobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__CMServiceRequest_template::mobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_mobileIdentity;
}

MobileL3__CommonIE__Types::PriorityLevel__ML3_template& PDU__ML3__CMServiceRequest_template::priorityLevel()
{
set_specific();
return single_value->field_priorityLevel;
}

const MobileL3__CommonIE__Types::PriorityLevel__ML3_template& PDU__ML3__CMServiceRequest_template::priorityLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityLevel of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_priorityLevel;
}

MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template& PDU__ML3__CMServiceRequest_template::additionalUpdateParameterTV()
{
set_specific();
return single_value->field_additionalUpdateParameterTV;
}

const MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template& PDU__ML3__CMServiceRequest_template::additionalUpdateParameterTV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalUpdateParameterTV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_additionalUpdateParameterTV;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__ML3__CMServiceRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__ML3__CMServiceRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
return single_value->field_deviceProperties;
}

int PDU__ML3__CMServiceRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_priorityLevel.is_present()) ret_val++;
      if (single_value->field_additionalUpdateParameterTV.is_present()) ret_val++;
      if (single_value->field_deviceProperties.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_MM_Types.PDU_ML3_CMServiceRequest 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_MM_Types.PDU_ML3_CMServiceRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest.");
  }
  return 0;
}

void PDU__ML3__CMServiceRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", cm_ServiceType := ");
single_value->field_cm__ServiceType.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log();
TTCN_Logger::log_event_str(", priorityLevel := ");
single_value->field_priorityLevel.log();
TTCN_Logger::log_event_str(", additionalUpdateParameterTV := ");
single_value->field_additionalUpdateParameterTV.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__CMServiceRequest_template::log_match(const PDU__ML3__CMServiceRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cm__ServiceType.match(match_value.cm__ServiceType(), legacy)){
TTCN_Logger::log_logmatch_info(".cm_ServiceType");
single_value->field_cm__ServiceType.log_match(match_value.cm__ServiceType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cipheringKeySequenceNumber.match(match_value.cipheringKeySequenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileStationClassmark2.match(match_value.mobileStationClassmark2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity.match(match_value.mobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.priorityLevel().ispresent()){
if(!single_value->field_priorityLevel.match(match_value.priorityLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityLevel");
single_value->field_priorityLevel.log_match(match_value.priorityLevel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_priorityLevel.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".priorityLevel := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_priorityLevel.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalUpdateParameterTV().ispresent()){
if(!single_value->field_additionalUpdateParameterTV.match(match_value.additionalUpdateParameterTV(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalUpdateParameterTV");
single_value->field_additionalUpdateParameterTV.log_match(match_value.additionalUpdateParameterTV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalUpdateParameterTV.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalUpdateParameterTV := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalUpdateParameterTV.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", cm_ServiceType := ");
single_value->field_cm__ServiceType.log_match(match_value.cm__ServiceType(), legacy);
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::log_event_str(", priorityLevel := ");
if (match_value.priorityLevel().ispresent()) {
single_value->field_priorityLevel.log_match(match_value.priorityLevel(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_priorityLevel.log();
if (single_value->field_priorityLevel.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalUpdateParameterTV := ");
if (match_value.additionalUpdateParameterTV().ispresent()) {
single_value->field_additionalUpdateParameterTV.log_match(match_value.additionalUpdateParameterTV(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalUpdateParameterTV.log();
if (single_value->field_additionalUpdateParameterTV.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__CMServiceRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cm__ServiceType().is_bound()) cm__ServiceType().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (mobileStationClassmark2().is_bound()) mobileStationClassmark2().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (!priorityLevel().is_bound()) priorityLevel() = OMIT_VALUE;
else priorityLevel().set_implicit_omit();
if (!additionalUpdateParameterTV().is_bound()) additionalUpdateParameterTV() = OMIT_VALUE;
else additionalUpdateParameterTV().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
}

void PDU__ML3__CMServiceRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_cm__ServiceType.encode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.encode_text(text_buf);
single_value->field_mobileStationClassmark2.encode_text(text_buf);
single_value->field_mobileIdentity.encode_text(text_buf);
single_value->field_priorityLevel.encode_text(text_buf);
single_value->field_additionalUpdateParameterTV.encode_text(text_buf);
single_value->field_deviceProperties.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_MM_Types.PDU_ML3_CMServiceRequest.");
}
}

void PDU__ML3__CMServiceRequest_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_cm__ServiceType.decode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.decode_text(text_buf);
single_value->field_mobileStationClassmark2.decode_text(text_buf);
single_value->field_mobileIdentity.decode_text(text_buf);
single_value->field_priorityLevel.decode_text(text_buf);
single_value->field_additionalUpdateParameterTV.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__CMServiceRequest_template[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_MM_Types.PDU_ML3_CMServiceRequest.");
}
}

void PDU__ML3__CMServiceRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__CMServiceRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @MobileL3_MM_Types.PDU_ML3_CMServiceRequest has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cm__ServiceType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) priorityLevel().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateParameterTV().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cm_ServiceType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cm__ServiceType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateParameterTV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateParameterTV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_CMServiceRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CMServiceRequest_template* precondition = new PDU__ML3__CMServiceRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CMServiceRequest_template* implied_template = new PDU__ML3__CMServiceRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CMServiceRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CMServiceRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_cm__ServiceType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_mobileStationClassmark2.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_priorityLevel.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_additionalUpdateParameterTV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_CMServiceRequest");
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_MM_Types.PDU_ML3_CMServiceRequest");
}

boolean PDU__ML3__CMServiceRequest_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__CMServiceRequest_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__ML3__IdentityRequest::PDU__ML3__IdentityRequest()
{
}

PDU__ML3__IdentityRequest::PDU__ML3__IdentityRequest(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const BITSTRING& par_identityType,
    const BITSTRING& par_spare1__5)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_identityType(par_identityType),
  field_spare1__5(par_spare1__5)
{
}

PDU__ML3__IdentityRequest::PDU__ML3__IdentityRequest(const PDU__ML3__IdentityRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.identityType().is_bound()) field_identityType = other_value.identityType();
else field_identityType.clean_up();
if (other_value.spare1__5().is_bound()) field_spare1__5 = other_value.spare1__5();
else field_spare1__5.clean_up();
}

void PDU__ML3__IdentityRequest::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_identityType.clean_up();
field_spare1__5.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__IdentityRequest::get_descriptor() const { return &PDU__ML3__IdentityRequest_descr_; }
PDU__ML3__IdentityRequest& PDU__ML3__IdentityRequest::operator=(const PDU__ML3__IdentityRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.identityType().is_bound()) field_identityType = other_value.identityType();
  else field_identityType.clean_up();
  if (other_value.spare1__5().is_bound()) field_spare1__5 = other_value.spare1__5();
  else field_spare1__5.clean_up();
}
return *this;
}

boolean PDU__ML3__IdentityRequest::operator==(const PDU__ML3__IdentityRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_identityType==other_value.field_identityType
  && field_spare1__5==other_value.field_spare1__5;
}

boolean PDU__ML3__IdentityRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_identityType.is_bound())
  || (field_spare1__5.is_bound());
}
boolean PDU__ML3__IdentityRequest::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_identityType.is_value()
  && field_spare1__5.is_value();
}
void PDU__ML3__IdentityRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", identityType := ");
field_identityType.log();
TTCN_Logger::log_event_str(", spare1_5 := ");
field_spare1__5.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__IdentityRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (identityType().is_bound()) identityType().set_implicit_omit();
if (spare1__5().is_bound()) spare1__5().set_implicit_omit();
}

void PDU__ML3__IdentityRequest::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_MM_Types.PDU_ML3_IdentityRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) identityType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare1__5().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "identityType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          identityType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1_5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1__5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_IdentityRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_IdentityRequest");
  }
}

void PDU__ML3__IdentityRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_identityType.encode_text(text_buf);
field_spare1__5.encode_text(text_buf);
}

void PDU__ML3__IdentityRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_identityType.decode_text(text_buf);
field_spare1__5.decode_text(text_buf);
}

void PDU__ML3__IdentityRequest::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 PDU__ML3__IdentityRequest::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 PDU__ML3__IdentityRequest::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_identityType.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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_spare1__5.RAW_decode(General__Types::BIT5_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 PDU__ML3__IdentityRequest::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT5_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_identityType.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare1__5.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__IdentityRequest_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
BITSTRING_template field_identityType;
BITSTRING_template field_spare1__5;
};

void PDU__ML3__IdentityRequest_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_identityType = ANY_VALUE;
single_value->field_spare1__5 = ANY_VALUE;
}
}
}

void PDU__ML3__IdentityRequest_template::copy_value(const PDU__ML3__IdentityRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.identityType().is_bound()) {
  single_value->field_identityType = other_value.identityType();
} else {
  single_value->field_identityType.clean_up();
}
if (other_value.spare1__5().is_bound()) {
  single_value->field_spare1__5 = other_value.spare1__5();
} else {
  single_value->field_spare1__5.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__IdentityRequest_template::copy_template(const PDU__ML3__IdentityRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.identityType().get_selection()) {
single_value->field_identityType = other_value.identityType();
} else {
single_value->field_identityType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare1__5().get_selection()) {
single_value->field_spare1__5 = other_value.spare1__5();
} else {
single_value->field_spare1__5.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__IdentityRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__IdentityRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__IdentityRequest_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_MM_Types.PDU_ML3_IdentityRequest.");
break;
}
set_selection(other_value);
}

PDU__ML3__IdentityRequest_template::PDU__ML3__IdentityRequest_template()
{
}

PDU__ML3__IdentityRequest_template::PDU__ML3__IdentityRequest_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__ML3__IdentityRequest_template::PDU__ML3__IdentityRequest_template(const PDU__ML3__IdentityRequest& other_value)
{
copy_value(other_value);
}

PDU__ML3__IdentityRequest_template::PDU__ML3__IdentityRequest_template(const OPTIONAL<PDU__ML3__IdentityRequest>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__IdentityRequest&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest from an unbound optional field.");
}
}

PDU__ML3__IdentityRequest_template::PDU__ML3__IdentityRequest_template(PDU__ML3__IdentityRequest_template* p_precondition, PDU__ML3__IdentityRequest_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__ML3__IdentityRequest_template::PDU__ML3__IdentityRequest_template(Dynamic_Match_Interface<PDU__ML3__IdentityRequest>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__ML3__IdentityRequest>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__ML3__IdentityRequest_template::PDU__ML3__IdentityRequest_template(const PDU__ML3__IdentityRequest_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__ML3__IdentityRequest_template::~PDU__ML3__IdentityRequest_template()
{
clean_up();
}

PDU__ML3__IdentityRequest_template& PDU__ML3__IdentityRequest_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__ML3__IdentityRequest_template& PDU__ML3__IdentityRequest_template::operator=(const PDU__ML3__IdentityRequest& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__ML3__IdentityRequest_template& PDU__ML3__IdentityRequest_template::operator=(const OPTIONAL<PDU__ML3__IdentityRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__IdentityRequest&)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_MM_Types.PDU_ML3_IdentityRequest.");
}
return *this;
}

PDU__ML3__IdentityRequest_template& PDU__ML3__IdentityRequest_template::operator=(const PDU__ML3__IdentityRequest_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__IdentityRequest_template::match(const PDU__ML3__IdentityRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.identityType().is_bound()) return FALSE;
if(!single_value->field_identityType.match(other_value.identityType(), legacy))return FALSE;
if(!other_value.spare1__5().is_bound()) return FALSE;
if(!single_value->field_spare1__5.match(other_value.spare1__5(), 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_MM_Types.PDU_ML3_IdentityRequest.");
}
return FALSE;
}

boolean PDU__ML3__IdentityRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_identityType.is_bound()
 || single_value->field_spare1__5.is_bound();
}

boolean PDU__ML3__IdentityRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_identityType.is_value()
 && single_value->field_spare1__5.is_value();
}

void PDU__ML3__IdentityRequest_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__ML3__IdentityRequest PDU__ML3__IdentityRequest_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_MM_Types.PDU_ML3_IdentityRequest.");
PDU__ML3__IdentityRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_identityType.is_bound()) {
ret_val.identityType() = single_value->field_identityType.valueof();
}
if (single_value->field_spare1__5.is_bound()) {
ret_val.spare1__5() = single_value->field_spare1__5.valueof();
}
return ret_val;
}

void PDU__ML3__IdentityRequest_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_MM_Types.PDU_ML3_IdentityRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__IdentityRequest_template[list_length];
}

PDU__ML3__IdentityRequest_template& PDU__ML3__IdentityRequest_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_MM_Types.PDU_ML3_IdentityRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__IdentityRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__IdentityRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__IdentityRequest_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__IdentityRequest_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
return single_value->field_nsd;
}

BITSTRING_template& PDU__ML3__IdentityRequest_template::identityType()
{
set_specific();
return single_value->field_identityType;
}

const BITSTRING_template& PDU__ML3__IdentityRequest_template::identityType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field identityType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
return single_value->field_identityType;
}

BITSTRING_template& PDU__ML3__IdentityRequest_template::spare1__5()
{
set_specific();
return single_value->field_spare1__5;
}

const BITSTRING_template& PDU__ML3__IdentityRequest_template::spare1__5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare1_5 of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
return single_value->field_spare1__5;
}

int PDU__ML3__IdentityRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest 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_MM_Types.PDU_ML3_IdentityRequest 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_MM_Types.PDU_ML3_IdentityRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_MM_Types.PDU_ML3_IdentityRequest.");
  }
  return 0;
}

void PDU__ML3__IdentityRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", identityType := ");
single_value->field_identityType.log();
TTCN_Logger::log_event_str(", spare1_5 := ");
single_value->field_spare1__5.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__IdentityRequest_template::log_match(const PDU__ML3__IdentityRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_identityType.match(match_value.identityType(), legacy)){
TTCN_Logger::log_logmatch_info(".identityType");
single_value->field_identityType.log_match(match_value.identityType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare1__5.match(match_value.spare1__5(), legacy)){
TTCN_Logger::log_logmatch_info(".spare1_5");
single_value->field_spare1__5.log_match(match_value.spare1__5(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", identityType := ");
single_value->field_identityType.log_match(match_value.identityType(), legacy);
TTCN_Logger::log_event_str(", spare1_5 := ");
single_value->field_spare1__5.log_match(match_value.spare1__5(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__IdentityRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (identityType().is_bound()) identityType().set_implicit_omit();
if (spare1__5().is_bound()) spare1__5().set_implicit_omit();
}

void PDU__ML3__IdentityRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_identityType.encode_text(text_buf);
single_value->field_spare1__5.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_MM_Types.PDU_ML3_IdentityRequest.");
}
}

void PDU__ML3__IdentityRequest_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_identityType.decode_text(text_buf);
single_value->field_spare1__5.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__IdentityRequest_template[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_MM_Types.PDU_ML3_IdentityRequest.");
}
}

void PDU__ML3__IdentityRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__IdentityRequest_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_MM_Types.PDU_ML3_IdentityRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) identityType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare1__5().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "identityType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          identityType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1_5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1__5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_IdentityRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__IdentityRequest_template* precondition = new PDU__ML3__IdentityRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__IdentityRequest_template* implied_template = new PDU__ML3__IdentityRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__IdentityRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_IdentityRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__IdentityRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityRequest");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityRequest");
single_value->field_identityType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityRequest");
single_value->field_spare1__5.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityRequest");
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_MM_Types.PDU_ML3_IdentityRequest");
}

boolean PDU__ML3__IdentityRequest_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__IdentityRequest_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__ML3__IdentityResponse::PDU__ML3__IdentityResponse()
{
}

PDU__ML3__IdentityResponse::PDU__ML3__IdentityResponse(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentityLV,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSI__TypeTV >& par_p__TMSI__TypeTV,
    const OPTIONAL< MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV >& par_routingAreaIdentification2TLV,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSISignature2TLV >& par_p__TMSISignature2TLV)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_mobileIdentityLV(par_mobileIdentityLV),
  field_p__TMSI__TypeTV(par_p__TMSI__TypeTV),
  field_routingAreaIdentification2TLV(par_routingAreaIdentification2TLV),
  field_p__TMSISignature2TLV(par_p__TMSISignature2TLV)
{
}

PDU__ML3__IdentityResponse::PDU__ML3__IdentityResponse(const PDU__ML3__IdentityResponse& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
else field_mobileIdentityLV.clean_up();
if (other_value.p__TMSI__TypeTV().is_bound()) field_p__TMSI__TypeTV = other_value.p__TMSI__TypeTV();
else field_p__TMSI__TypeTV.clean_up();
if (other_value.routingAreaIdentification2TLV().is_bound()) field_routingAreaIdentification2TLV = other_value.routingAreaIdentification2TLV();
else field_routingAreaIdentification2TLV.clean_up();
if (other_value.p__TMSISignature2TLV().is_bound()) field_p__TMSISignature2TLV = other_value.p__TMSISignature2TLV();
else field_p__TMSISignature2TLV.clean_up();
}

void PDU__ML3__IdentityResponse::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_mobileIdentityLV.clean_up();
field_p__TMSI__TypeTV.clean_up();
field_routingAreaIdentification2TLV.clean_up();
field_p__TMSISignature2TLV.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__IdentityResponse::get_descriptor() const { return &PDU__ML3__IdentityResponse_descr_; }
PDU__ML3__IdentityResponse& PDU__ML3__IdentityResponse::operator=(const PDU__ML3__IdentityResponse& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
  else field_mobileIdentityLV.clean_up();
  if (other_value.p__TMSI__TypeTV().is_bound()) field_p__TMSI__TypeTV = other_value.p__TMSI__TypeTV();
  else field_p__TMSI__TypeTV.clean_up();
  if (other_value.routingAreaIdentification2TLV().is_bound()) field_routingAreaIdentification2TLV = other_value.routingAreaIdentification2TLV();
  else field_routingAreaIdentification2TLV.clean_up();
  if (other_value.p__TMSISignature2TLV().is_bound()) field_p__TMSISignature2TLV = other_value.p__TMSISignature2TLV();
  else field_p__TMSISignature2TLV.clean_up();
}
return *this;
}

boolean PDU__ML3__IdentityResponse::operator==(const PDU__ML3__IdentityResponse& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_mobileIdentityLV==other_value.field_mobileIdentityLV
  && field_p__TMSI__TypeTV==other_value.field_p__TMSI__TypeTV
  && field_routingAreaIdentification2TLV==other_value.field_routingAreaIdentification2TLV
  && field_p__TMSISignature2TLV==other_value.field_p__TMSISignature2TLV;
}

boolean PDU__ML3__IdentityResponse::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_mobileIdentityLV.is_bound())
  || (OPTIONAL_OMIT == field_p__TMSI__TypeTV.get_selection() || field_p__TMSI__TypeTV.is_bound())
  || (OPTIONAL_OMIT == field_routingAreaIdentification2TLV.get_selection() || field_routingAreaIdentification2TLV.is_bound())
  || (OPTIONAL_OMIT == field_p__TMSISignature2TLV.get_selection() || field_p__TMSISignature2TLV.is_bound());
}
boolean PDU__ML3__IdentityResponse::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_mobileIdentityLV.is_value()
  && (OPTIONAL_OMIT == field_p__TMSI__TypeTV.get_selection() || field_p__TMSI__TypeTV.is_value())
  && (OPTIONAL_OMIT == field_routingAreaIdentification2TLV.get_selection() || field_routingAreaIdentification2TLV.is_value())
  && (OPTIONAL_OMIT == field_p__TMSISignature2TLV.get_selection() || field_p__TMSISignature2TLV.is_value());
}
int PDU__ML3__IdentityResponse::size_of() const
{
  int ret_val = 3;
  if (field_p__TMSI__TypeTV.ispresent()) ret_val++;
  if (field_routingAreaIdentification2TLV.ispresent()) ret_val++;
  if (field_p__TMSISignature2TLV.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__IdentityResponse::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
field_mobileIdentityLV.log();
TTCN_Logger::log_event_str(", p_TMSI_TypeTV := ");
field_p__TMSI__TypeTV.log();
TTCN_Logger::log_event_str(", routingAreaIdentification2TLV := ");
field_routingAreaIdentification2TLV.log();
TTCN_Logger::log_event_str(", p_TMSISignature2TLV := ");
field_p__TMSISignature2TLV.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__IdentityResponse::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
if (!p__TMSI__TypeTV().is_bound()) p__TMSI__TypeTV() = OMIT_VALUE;
else p__TMSI__TypeTV().set_implicit_omit();
if (!routingAreaIdentification2TLV().is_bound()) routingAreaIdentification2TLV() = OMIT_VALUE;
else routingAreaIdentification2TLV().set_implicit_omit();
if (!p__TMSISignature2TLV().is_bound()) p__TMSISignature2TLV() = OMIT_VALUE;
else p__TMSISignature2TLV().set_implicit_omit();
}

void PDU__ML3__IdentityResponse::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_MM_Types.PDU_ML3_IdentityResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityLV().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__TypeTV().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification2TLV().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) p__TMSISignature2TLV().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_TypeTV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__TypeTV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification2TLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification2TLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSISignature2TLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSISignature2TLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_IdentityResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
  }
}

void PDU__ML3__IdentityResponse::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_mobileIdentityLV.encode_text(text_buf);
field_p__TMSI__TypeTV.encode_text(text_buf);
field_routingAreaIdentification2TLV.encode_text(text_buf);
field_p__TMSISignature2TLV.encode_text(text_buf);
}

void PDU__ML3__IdentityResponse::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_mobileIdentityLV.decode_text(text_buf);
field_p__TMSI__TypeTV.decode_text(text_buf);
field_routingAreaIdentification2TLV.decode_text(text_buf);
field_p__TMSISignature2TLV.decode_text(text_buf);
}

void PDU__ML3__IdentityResponse::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 PDU__ML3__IdentityResponse::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 PDU__ML3__IdentityResponse::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentityLV.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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_p__TMSI__TypeTV = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw->forceomit);
  decoded_field_length = field_p__TMSI__TypeTV().RAW_decode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_p__TMSI__TypeTV = 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_p__TMSI__TypeTV=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_routingAreaIdentification2TLV = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification2TLV().RAW_decode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_routingAreaIdentification2TLV = 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_routingAreaIdentification2TLV=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_p__TMSISignature2TLV = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_.raw->forceomit);
  decoded_field_length = field_p__TMSISignature2TLV().RAW_decode(MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_p__TMSISignature2TLV = 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_p__TMSISignature2TLV=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__IdentityResponse::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  if (field_p__TMSI__TypeTV.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_routingAreaIdentification2TLV.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_p__TMSISignature2TLV.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mobileIdentityLV.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[2]);
  if (field_p__TMSI__TypeTV.ispresent()) {
  encoded_length += field_p__TMSI__TypeTV().RAW_encode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_routingAreaIdentification2TLV.ispresent()) {
  encoded_length += field_routingAreaIdentification2TLV().RAW_encode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_p__TMSISignature2TLV.ispresent()) {
  encoded_length += field_p__TMSISignature2TLV().RAW_encode(MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__IdentityResponse_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentityLV;
MobileL3__CommonIE__Types::P__TMSI__TypeTV_template field_p__TMSI__TypeTV;
MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template field_routingAreaIdentification2TLV;
MobileL3__CommonIE__Types::P__TMSISignature2TLV_template field_p__TMSISignature2TLV;
};

void PDU__ML3__IdentityResponse_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_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_mobileIdentityLV = ANY_VALUE;
single_value->field_p__TMSI__TypeTV = ANY_OR_OMIT;
single_value->field_routingAreaIdentification2TLV = ANY_OR_OMIT;
single_value->field_p__TMSISignature2TLV = ANY_OR_OMIT;
}
}
}

void PDU__ML3__IdentityResponse_template::copy_value(const PDU__ML3__IdentityResponse& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.mobileIdentityLV().is_bound()) {
  single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
  single_value->field_mobileIdentityLV.clean_up();
}
if (other_value.p__TMSI__TypeTV().is_bound()) {
  if (other_value.p__TMSI__TypeTV().ispresent()) single_value->field_p__TMSI__TypeTV = other_value.p__TMSI__TypeTV()();
  else single_value->field_p__TMSI__TypeTV = OMIT_VALUE;
} else {
  single_value->field_p__TMSI__TypeTV.clean_up();
}
if (other_value.routingAreaIdentification2TLV().is_bound()) {
  if (other_value.routingAreaIdentification2TLV().ispresent()) single_value->field_routingAreaIdentification2TLV = other_value.routingAreaIdentification2TLV()();
  else single_value->field_routingAreaIdentification2TLV = OMIT_VALUE;
} else {
  single_value->field_routingAreaIdentification2TLV.clean_up();
}
if (other_value.p__TMSISignature2TLV().is_bound()) {
  if (other_value.p__TMSISignature2TLV().ispresent()) single_value->field_p__TMSISignature2TLV = other_value.p__TMSISignature2TLV()();
  else single_value->field_p__TMSISignature2TLV = OMIT_VALUE;
} else {
  single_value->field_p__TMSISignature2TLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__IdentityResponse_template::copy_template(const PDU__ML3__IdentityResponse_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentityLV().get_selection()) {
single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
single_value->field_mobileIdentityLV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p__TMSI__TypeTV().get_selection()) {
single_value->field_p__TMSI__TypeTV = other_value.p__TMSI__TypeTV();
} else {
single_value->field_p__TMSI__TypeTV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification2TLV().get_selection()) {
single_value->field_routingAreaIdentification2TLV = other_value.routingAreaIdentification2TLV();
} else {
single_value->field_routingAreaIdentification2TLV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p__TMSISignature2TLV().get_selection()) {
single_value->field_p__TMSISignature2TLV = other_value.p__TMSISignature2TLV();
} else {
single_value->field_p__TMSISignature2TLV.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__IdentityResponse_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__IdentityResponse_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__IdentityResponse_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_MM_Types.PDU_ML3_IdentityResponse.");
break;
}
set_selection(other_value);
}

PDU__ML3__IdentityResponse_template::PDU__ML3__IdentityResponse_template()
{
}

PDU__ML3__IdentityResponse_template::PDU__ML3__IdentityResponse_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__ML3__IdentityResponse_template::PDU__ML3__IdentityResponse_template(const PDU__ML3__IdentityResponse& other_value)
{
copy_value(other_value);
}

PDU__ML3__IdentityResponse_template::PDU__ML3__IdentityResponse_template(const OPTIONAL<PDU__ML3__IdentityResponse>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__IdentityResponse&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse from an unbound optional field.");
}
}

PDU__ML3__IdentityResponse_template::PDU__ML3__IdentityResponse_template(PDU__ML3__IdentityResponse_template* p_precondition, PDU__ML3__IdentityResponse_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__ML3__IdentityResponse_template::PDU__ML3__IdentityResponse_template(Dynamic_Match_Interface<PDU__ML3__IdentityResponse>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__ML3__IdentityResponse>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__ML3__IdentityResponse_template::PDU__ML3__IdentityResponse_template(const PDU__ML3__IdentityResponse_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__ML3__IdentityResponse_template::~PDU__ML3__IdentityResponse_template()
{
clean_up();
}

PDU__ML3__IdentityResponse_template& PDU__ML3__IdentityResponse_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__ML3__IdentityResponse_template& PDU__ML3__IdentityResponse_template::operator=(const PDU__ML3__IdentityResponse& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__ML3__IdentityResponse_template& PDU__ML3__IdentityResponse_template::operator=(const OPTIONAL<PDU__ML3__IdentityResponse>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__IdentityResponse&)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_MM_Types.PDU_ML3_IdentityResponse.");
}
return *this;
}

PDU__ML3__IdentityResponse_template& PDU__ML3__IdentityResponse_template::operator=(const PDU__ML3__IdentityResponse_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__IdentityResponse_template::match(const PDU__ML3__IdentityResponse& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.mobileIdentityLV().is_bound()) return FALSE;
if(!single_value->field_mobileIdentityLV.match(other_value.mobileIdentityLV(), legacy))return FALSE;
if(!other_value.p__TMSI__TypeTV().is_bound()) return FALSE;
if((other_value.p__TMSI__TypeTV().ispresent() ? !single_value->field_p__TMSI__TypeTV.match((const MobileL3__CommonIE__Types::P__TMSI__TypeTV&)other_value.p__TMSI__TypeTV(), legacy) : !single_value->field_p__TMSI__TypeTV.match_omit(legacy)))return FALSE;
if(!other_value.routingAreaIdentification2TLV().is_bound()) return FALSE;
if((other_value.routingAreaIdentification2TLV().ispresent() ? !single_value->field_routingAreaIdentification2TLV.match((const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV&)other_value.routingAreaIdentification2TLV(), legacy) : !single_value->field_routingAreaIdentification2TLV.match_omit(legacy)))return FALSE;
if(!other_value.p__TMSISignature2TLV().is_bound()) return FALSE;
if((other_value.p__TMSISignature2TLV().ispresent() ? !single_value->field_p__TMSISignature2TLV.match((const MobileL3__CommonIE__Types::P__TMSISignature2TLV&)other_value.p__TMSISignature2TLV(), legacy) : !single_value->field_p__TMSISignature2TLV.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_MM_Types.PDU_ML3_IdentityResponse.");
}
return FALSE;
}

boolean PDU__ML3__IdentityResponse_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_mobileIdentityLV.is_bound()
 || (single_value->field_p__TMSI__TypeTV.is_omit() || single_value->field_p__TMSI__TypeTV.is_bound())
 || (single_value->field_routingAreaIdentification2TLV.is_omit() || single_value->field_routingAreaIdentification2TLV.is_bound())
 || (single_value->field_p__TMSISignature2TLV.is_omit() || single_value->field_p__TMSISignature2TLV.is_bound());
}

boolean PDU__ML3__IdentityResponse_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_mobileIdentityLV.is_value()
 && (single_value->field_p__TMSI__TypeTV.is_omit() || single_value->field_p__TMSI__TypeTV.is_value())
 && (single_value->field_routingAreaIdentification2TLV.is_omit() || single_value->field_routingAreaIdentification2TLV.is_value())
 && (single_value->field_p__TMSISignature2TLV.is_omit() || single_value->field_p__TMSISignature2TLV.is_value());
}

void PDU__ML3__IdentityResponse_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__ML3__IdentityResponse PDU__ML3__IdentityResponse_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_MM_Types.PDU_ML3_IdentityResponse.");
PDU__ML3__IdentityResponse ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_mobileIdentityLV.is_bound()) {
ret_val.mobileIdentityLV() = single_value->field_mobileIdentityLV.valueof();
}
if (single_value->field_p__TMSI__TypeTV.is_omit()) ret_val.p__TMSI__TypeTV() = OMIT_VALUE;
else if (single_value->field_p__TMSI__TypeTV.is_bound()) {
ret_val.p__TMSI__TypeTV() = single_value->field_p__TMSI__TypeTV.valueof();
}
if (single_value->field_routingAreaIdentification2TLV.is_omit()) ret_val.routingAreaIdentification2TLV() = OMIT_VALUE;
else if (single_value->field_routingAreaIdentification2TLV.is_bound()) {
ret_val.routingAreaIdentification2TLV() = single_value->field_routingAreaIdentification2TLV.valueof();
}
if (single_value->field_p__TMSISignature2TLV.is_omit()) ret_val.p__TMSISignature2TLV() = OMIT_VALUE;
else if (single_value->field_p__TMSISignature2TLV.is_bound()) {
ret_val.p__TMSISignature2TLV() = single_value->field_p__TMSISignature2TLV.valueof();
}
return ret_val;
}

void PDU__ML3__IdentityResponse_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_MM_Types.PDU_ML3_IdentityResponse.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__IdentityResponse_template[list_length];
}

PDU__ML3__IdentityResponse_template& PDU__ML3__IdentityResponse_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_MM_Types.PDU_ML3_IdentityResponse.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__IdentityResponse_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__IdentityResponse_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__IdentityResponse_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__IdentityResponse_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
return single_value->field_nsd;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__IdentityResponse_template::mobileIdentityLV()
{
set_specific();
return single_value->field_mobileIdentityLV;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__IdentityResponse_template::mobileIdentityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentityLV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
return single_value->field_mobileIdentityLV;
}

MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__ML3__IdentityResponse_template::p__TMSI__TypeTV()
{
set_specific();
return single_value->field_p__TMSI__TypeTV;
}

const MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__ML3__IdentityResponse_template::p__TMSI__TypeTV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_TMSI_TypeTV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
return single_value->field_p__TMSI__TypeTV;
}

MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__ML3__IdentityResponse_template::routingAreaIdentification2TLV()
{
set_specific();
return single_value->field_routingAreaIdentification2TLV;
}

const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__ML3__IdentityResponse_template::routingAreaIdentification2TLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaIdentification2TLV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
return single_value->field_routingAreaIdentification2TLV;
}

MobileL3__CommonIE__Types::P__TMSISignature2TLV_template& PDU__ML3__IdentityResponse_template::p__TMSISignature2TLV()
{
set_specific();
return single_value->field_p__TMSISignature2TLV;
}

const MobileL3__CommonIE__Types::P__TMSISignature2TLV_template& PDU__ML3__IdentityResponse_template::p__TMSISignature2TLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_TMSISignature2TLV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
return single_value->field_p__TMSISignature2TLV;
}

int PDU__ML3__IdentityResponse_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_p__TMSI__TypeTV.is_present()) ret_val++;
      if (single_value->field_routingAreaIdentification2TLV.is_present()) ret_val++;
      if (single_value->field_p__TMSISignature2TLV.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_MM_Types.PDU_ML3_IdentityResponse 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_MM_Types.PDU_ML3_IdentityResponse containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_MM_Types.PDU_ML3_IdentityResponse.");
  }
  return 0;
}

void PDU__ML3__IdentityResponse_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log();
TTCN_Logger::log_event_str(", p_TMSI_TypeTV := ");
single_value->field_p__TMSI__TypeTV.log();
TTCN_Logger::log_event_str(", routingAreaIdentification2TLV := ");
single_value->field_routingAreaIdentification2TLV.log();
TTCN_Logger::log_event_str(", p_TMSISignature2TLV := ");
single_value->field_p__TMSISignature2TLV.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__IdentityResponse_template::log_match(const PDU__ML3__IdentityResponse& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentityLV.match(match_value.mobileIdentityLV(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentityLV");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.p__TMSI__TypeTV().ispresent()){
if(!single_value->field_p__TMSI__TypeTV.match(match_value.p__TMSI__TypeTV(), legacy)){
TTCN_Logger::log_logmatch_info(".p_TMSI_TypeTV");
single_value->field_p__TMSI__TypeTV.log_match(match_value.p__TMSI__TypeTV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_p__TMSI__TypeTV.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".p_TMSI_TypeTV := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_p__TMSI__TypeTV.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routingAreaIdentification2TLV().ispresent()){
if(!single_value->field_routingAreaIdentification2TLV.match(match_value.routingAreaIdentification2TLV(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification2TLV");
single_value->field_routingAreaIdentification2TLV.log_match(match_value.routingAreaIdentification2TLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routingAreaIdentification2TLV.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routingAreaIdentification2TLV := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routingAreaIdentification2TLV.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.p__TMSISignature2TLV().ispresent()){
if(!single_value->field_p__TMSISignature2TLV.match(match_value.p__TMSISignature2TLV(), legacy)){
TTCN_Logger::log_logmatch_info(".p_TMSISignature2TLV");
single_value->field_p__TMSISignature2TLV.log_match(match_value.p__TMSISignature2TLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_p__TMSISignature2TLV.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".p_TMSISignature2TLV := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_p__TMSISignature2TLV.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), legacy);
TTCN_Logger::log_event_str(", p_TMSI_TypeTV := ");
if (match_value.p__TMSI__TypeTV().ispresent()) {
single_value->field_p__TMSI__TypeTV.log_match(match_value.p__TMSI__TypeTV(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_p__TMSI__TypeTV.log();
if (single_value->field_p__TMSI__TypeTV.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routingAreaIdentification2TLV := ");
if (match_value.routingAreaIdentification2TLV().ispresent()) {
single_value->field_routingAreaIdentification2TLV.log_match(match_value.routingAreaIdentification2TLV(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routingAreaIdentification2TLV.log();
if (single_value->field_routingAreaIdentification2TLV.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", p_TMSISignature2TLV := ");
if (match_value.p__TMSISignature2TLV().ispresent()) {
single_value->field_p__TMSISignature2TLV.log_match(match_value.p__TMSISignature2TLV(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_p__TMSISignature2TLV.log();
if (single_value->field_p__TMSISignature2TLV.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__IdentityResponse_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
if (!p__TMSI__TypeTV().is_bound()) p__TMSI__TypeTV() = OMIT_VALUE;
else p__TMSI__TypeTV().set_implicit_omit();
if (!routingAreaIdentification2TLV().is_bound()) routingAreaIdentification2TLV() = OMIT_VALUE;
else routingAreaIdentification2TLV().set_implicit_omit();
if (!p__TMSISignature2TLV().is_bound()) p__TMSISignature2TLV() = OMIT_VALUE;
else p__TMSISignature2TLV().set_implicit_omit();
}

void PDU__ML3__IdentityResponse_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_mobileIdentityLV.encode_text(text_buf);
single_value->field_p__TMSI__TypeTV.encode_text(text_buf);
single_value->field_routingAreaIdentification2TLV.encode_text(text_buf);
single_value->field_p__TMSISignature2TLV.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_MM_Types.PDU_ML3_IdentityResponse.");
}
}

void PDU__ML3__IdentityResponse_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_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_mobileIdentityLV.decode_text(text_buf);
single_value->field_p__TMSI__TypeTV.decode_text(text_buf);
single_value->field_routingAreaIdentification2TLV.decode_text(text_buf);
single_value->field_p__TMSISignature2TLV.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__IdentityResponse_template[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_MM_Types.PDU_ML3_IdentityResponse.");
}
}

void PDU__ML3__IdentityResponse_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__IdentityResponse_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_MM_Types.PDU_ML3_IdentityResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityLV().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__TypeTV().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification2TLV().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) p__TMSISignature2TLV().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_TypeTV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__TypeTV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification2TLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification2TLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSISignature2TLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSISignature2TLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_MM_Types.PDU_ML3_IdentityResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__IdentityResponse_template* precondition = new PDU__ML3__IdentityResponse_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__IdentityResponse_template* implied_template = new PDU__ML3__IdentityResponse_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__IdentityResponse_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__IdentityResponse_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
single_value->field_mobileIdentityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
single_value->field_p__TMSI__TypeTV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
single_value->field_routingAreaIdentification2TLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
single_value->field_p__TMSISignature2TLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IdentityResponse");
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_MM_Types.PDU_ML3_IdentityResponse");
}

boolean PDU__ML3__IdentityResponse_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__IdentityResponse_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


} /* end of namespace */
