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

namespace MobileL3__CommonIE__Types {

/* Literal string constants */

const unsigned char bs_1_bits[] = { 0 },
bs_7_bits[] = { 0 },
bs_3_bits[] = { 4 },
bs_2_bits[] = { 2 },
bs_4_bits[] = { 6 },
bs_5_bits[] = { 1 },
bs_0_bits[] = { 1 },
bs_8_bits[] = { 41 },
bs_6_bits[] = { 5 },
bs_10_bits[] = { 3 },
bs_9_bits[] = { 7 };
extern const BITSTRING bs_1(1, bs_1_bits),
bs_7(3, bs_7_bits),
bs_3(3, bs_3_bits),
bs_2(3, bs_2_bits),
bs_4(3, bs_4_bits),
bs_5(3, bs_5_bits),
bs_0(4, bs_0_bits),
bs_8(7, bs_8_bits),
bs_6(3, bs_6_bits),
bs_10(4, bs_10_bits),
bs_9(4, bs_9_bits);
const unsigned char os_0_octets[] = { 17 },
os_3_octets[] = { 25 },
os_4_octets[] = { 27 },
os_1_octets[] = { 32 },
os_2_octets[] = { 64 };
extern const OCTETSTRING os_0(1, os_0_octets),
os_3(1, os_3_octets),
os_4(1, os_4_octets),
os_1(1, os_1_octets),
os_2(1, os_2_octets);
const unsigned char module_checksum[] = { 0xc6, 0xcf, 0xa8, 0x65, 0xc9, 0x48, 0x77, 0x8b, 0x4e, 0x9b, 0x1d, 0xa6, 0xc5, 0x65, 0x1a, 0x45 };

/* Global variable definitions */

const XERdescriptor_t       MS__parameters_imsi__length_xer_ = { {"imsi_length>\n", "imsi_length>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MS__parameters_imsi__length_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters.imsi_length", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MS__parameters_imsi__length_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_imsi__length_default_coding("RAW");
const XERdescriptor_t       MS__parameters_imsi__firstdigit_xer_ = { {"imsi_firstdigit>\n", "imsi_firstdigit>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MS__parameters_imsi__firstdigit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MS__parameters_imsi__firstdigit_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters.imsi_firstdigit", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &MS__parameters_imsi__firstdigit_xer_, &BITSTRING_json_, &MS__parameters_imsi__firstdigit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_imsi__firstdigit_default_coding("RAW");
const XERdescriptor_t       MS__parameters_imsi_xer_ = { {"imsi>\n", "imsi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int MS__parameters_imsi_oer_ext_arr_[0] = {};
const int MS__parameters_imsi_oer_p_[0] = {};
const TTCN_OERdescriptor_t MS__parameters_imsi_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MS__parameters_imsi_oer_ext_arr_, 0, MS__parameters_imsi_oer_p_};
const TTCN_Typedescriptor_t MS__parameters_imsi_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters.imsi", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &MS__parameters_imsi_xer_, &OCTETSTRING_json_, &MS__parameters_imsi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_imsi_default_coding("RAW");
const XERdescriptor_t       MS__parameters_number_xer_ = { {"number>\n", "number>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int MS__parameters_number_oer_ext_arr_[0] = {};
const int MS__parameters_number_oer_p_[0] = {};
const TTCN_OERdescriptor_t MS__parameters_number_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MS__parameters_number_oer_ext_arr_, 0, MS__parameters_number_oer_p_};
const TTCN_Typedescriptor_t MS__parameters_number_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters.number", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &MS__parameters_number_xer_, &OCTETSTRING_json_, &MS__parameters_number_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_number_default_coding("RAW");
const XERdescriptor_t       MS__parameters_SCCP__connId_xer_ = { {"SCCP_connId>\n", "SCCP_connId>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MS__parameters_SCCP__connId_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters.SCCP_connId", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MS__parameters_SCCP__connId_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_SCCP__connId_default_coding("RAW");
const XERdescriptor_t       MS__parameters_L3__NSD_xer_ = { {"L3_NSD>\n", "L3_NSD>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MS__parameters_L3__NSD_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters.L3_NSD", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MS__parameters_L3__NSD_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_L3__NSD_default_coding("RAW");
const XERdescriptor_t       MS__parameters_tiFlag_xer_ = { {"tiFlag>\n", "tiFlag>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MS__parameters_tiFlag_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MS__parameters_tiFlag_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters.tiFlag", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MS__parameters_tiFlag_xer_, &BITSTRING_json_, &MS__parameters_tiFlag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_tiFlag_default_coding("RAW");
const TTCN_RAWdescriptor_t MS__parameters_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 MS__parameters
const TTCN_Typedescriptor_t MS__parameters_descr_ = { "@MobileL3_CommonIE_Types.MS_parameters", NULL, &MS__parameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__parameters_default_coding("RAW");
const XERdescriptor_t       Type1__V_dummy_xer_ = { {"dummy>\n", "dummy>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Type1__V_dummy_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Type1__V_dummy_descr_ = { "@MobileL3_CommonIE_Types.Type1_V.dummy", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &Type1__V_dummy_xer_, &BITSTRING_json_, &Type1__V_dummy_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type1__V_dummy_default_coding("RAW");
const XERdescriptor_t       Type1__V_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Type1__V_valuePart_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Type1__V_valuePart_descr_ = { "@MobileL3_CommonIE_Types.Type1_V.valuePart", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &Type1__V_valuePart_xer_, &BITSTRING_json_, &Type1__V_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type1__V_valuePart_default_coding("RAW");
const TTCN_RAWdescriptor_t Type1__V_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 Type1__V
const TTCN_Typedescriptor_t Type1__V_descr_ = { "@MobileL3_CommonIE_Types.Type1_V", NULL, &Type1__V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type1__V_default_coding("RAW");
const XERdescriptor_t       Type1__TV_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Type1__TV_valuePart_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Type1__TV_valuePart_descr_ = { "@MobileL3_CommonIE_Types.Type1_TV.valuePart", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &Type1__TV_valuePart_xer_, &BITSTRING_json_, &Type1__TV_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type1__TV_valuePart_default_coding("RAW");
const XERdescriptor_t       Type1__TV_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 Type1__TV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Type1__TV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.Type1_TV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &Type1__TV_elementIdentifier_xer_, &BITSTRING_json_, &Type1__TV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type1__TV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t Type1__TV_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 Type1__TV
const TTCN_Typedescriptor_t Type1__TV_descr_ = { "@MobileL3_CommonIE_Types.Type1_TV", NULL, &Type1__TV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type1__TV_default_coding("RAW");
const XERdescriptor_t       Type2_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 Type2_elementIdentifier_oer_ext_arr_[0] = {};
const int Type2_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t Type2_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, Type2_elementIdentifier_oer_ext_arr_, 0, Type2_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t Type2_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.Type2.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &Type2_elementIdentifier_xer_, &OCTETSTRING_json_, &Type2_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type2_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t Type2_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 Type2
const TTCN_Typedescriptor_t Type2_descr_ = { "@MobileL3_CommonIE_Types.Type2", NULL, &Type2_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type2_default_coding("RAW");
const XERdescriptor_t       Type3__V_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Type3__V_valuePart_oer_ext_arr_[0] = {};
const int Type3__V_valuePart_oer_p_[0] = {};
const TTCN_OERdescriptor_t Type3__V_valuePart_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Type3__V_valuePart_oer_ext_arr_, 0, Type3__V_valuePart_oer_p_};
const TTCN_Typedescriptor_t Type3__V_valuePart_descr_ = { "@MobileL3_CommonIE_Types.Type3_V.valuePart", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &Type3__V_valuePart_xer_, &OCTETSTRING_json_, &Type3__V_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type3__V_valuePart_default_coding("RAW");
const TTCN_RAWdescriptor_t Type3__V_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 Type3__V
const TTCN_Typedescriptor_t Type3__V_descr_ = { "@MobileL3_CommonIE_Types.Type3_V", NULL, &Type3__V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type3__V_default_coding("RAW");
const XERdescriptor_t       Type3__TV_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 Type3__TV_elementIdentifier_oer_ext_arr_[0] = {};
const int Type3__TV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t Type3__TV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, Type3__TV_elementIdentifier_oer_ext_arr_, 0, Type3__TV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t Type3__TV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.Type3_TV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &Type3__TV_elementIdentifier_xer_, &OCTETSTRING_json_, &Type3__TV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type3__TV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       Type3__TV_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Type3__TV_valuePart_oer_ext_arr_[0] = {};
const int Type3__TV_valuePart_oer_p_[0] = {};
const TTCN_OERdescriptor_t Type3__TV_valuePart_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Type3__TV_valuePart_oer_ext_arr_, 0, Type3__TV_valuePart_oer_p_};
const TTCN_Typedescriptor_t Type3__TV_valuePart_descr_ = { "@MobileL3_CommonIE_Types.Type3_TV.valuePart", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &Type3__TV_valuePart_xer_, &OCTETSTRING_json_, &Type3__TV_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type3__TV_valuePart_default_coding("RAW");
const TTCN_RAWdescriptor_t Type3__TV_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 Type3__TV
const TTCN_Typedescriptor_t Type3__TV_descr_ = { "@MobileL3_CommonIE_Types.Type3_TV", NULL, &Type3__TV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type3__TV_default_coding("RAW");
const TTCN_RAWdescriptor_t Type4__LV_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       Type4__LV_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 Type4__LV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Type4__LV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.Type4_LV.lengthIndicator", &INTEGER_ber_, &Type4__LV_lengthIndicator_raw_, &INTEGER_text_, &Type4__LV_lengthIndicator_xer_, &INTEGER_json_, &Type4__LV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type4__LV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       Type4__LV_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Type4__LV_valuePart_oer_ext_arr_[0] = {};
const int Type4__LV_valuePart_oer_p_[0] = {};
const TTCN_OERdescriptor_t Type4__LV_valuePart_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Type4__LV_valuePart_oer_ext_arr_, 0, Type4__LV_valuePart_oer_p_};
const TTCN_Typedescriptor_t Type4__LV_valuePart_descr_ = { "@MobileL3_CommonIE_Types.Type4_LV.valuePart", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &Type4__LV_valuePart_xer_, &OCTETSTRING_json_, &Type4__LV_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type4__LV_valuePart_default_coding("RAW");
const TTCN_RAWdescriptor_t Type4__LV_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 Type4__LV
const TTCN_Typedescriptor_t Type4__LV_descr_ = { "@MobileL3_CommonIE_Types.Type4_LV", NULL, &Type4__LV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type4__LV_default_coding("RAW");
const XERdescriptor_t       Type4__TLV_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 Type4__TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int Type4__TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t Type4__TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, Type4__TLV_elementIdentifier_oer_ext_arr_, 0, Type4__TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t Type4__TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.Type4_TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &Type4__TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &Type4__TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type4__TLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t Type4__TLV_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       Type4__TLV_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 Type4__TLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Type4__TLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.Type4_TLV.lengthIndicator", &INTEGER_ber_, &Type4__TLV_lengthIndicator_raw_, &INTEGER_text_, &Type4__TLV_lengthIndicator_xer_, &INTEGER_json_, &Type4__TLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type4__TLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       Type4__TLV_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Type4__TLV_valuePart_oer_ext_arr_[0] = {};
const int Type4__TLV_valuePart_oer_p_[0] = {};
const TTCN_OERdescriptor_t Type4__TLV_valuePart_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Type4__TLV_valuePart_oer_ext_arr_, 0, Type4__TLV_valuePart_oer_p_};
const TTCN_Typedescriptor_t Type4__TLV_valuePart_descr_ = { "@MobileL3_CommonIE_Types.Type4_TLV.valuePart", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &Type4__TLV_valuePart_xer_, &OCTETSTRING_json_, &Type4__TLV_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type4__TLV_valuePart_default_coding("RAW");
const TTCN_RAWdescriptor_t Type4__TLV_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 Type4__TLV
const TTCN_Typedescriptor_t Type4__TLV_descr_ = { "@MobileL3_CommonIE_Types.Type4_TLV", NULL, &Type4__TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Type4__TLV_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_sequenceTag_xer_ = { {"sequenceTag>\n", "sequenceTag>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_sequenceTag_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_sequenceTag_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_sequenceTag_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_sequenceTag_oer_ext_arr_, 0, ML3__NotifySS__Arg_sequenceTag_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_sequenceTag_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.sequenceTag", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_sequenceTag_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_sequenceTag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_sequenceTag_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_sequenceLength_xer_ = { {"sequenceLength>\n", "sequenceLength>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_sequenceLength_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_sequenceLength_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_sequenceLength_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_sequenceLength_oer_ext_arr_, 0, ML3__NotifySS__Arg_sequenceLength_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_sequenceLength_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.sequenceLength", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_sequenceLength_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_sequenceLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_sequenceLength_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_ssCodeTag_xer_ = { {"ssCodeTag>\n", "ssCodeTag>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_ssCodeTag_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_ssCodeTag_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_ssCodeTag_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_ssCodeTag_oer_ext_arr_, 0, ML3__NotifySS__Arg_ssCodeTag_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_ssCodeTag_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.ssCodeTag", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_ssCodeTag_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_ssCodeTag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_ssCodeTag_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_ssCodeLength_xer_ = { {"ssCodeLength>\n", "ssCodeLength>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_ssCodeLength_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_ssCodeLength_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_ssCodeLength_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_ssCodeLength_oer_ext_arr_, 0, ML3__NotifySS__Arg_ssCodeLength_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_ssCodeLength_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.ssCodeLength", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_ssCodeLength_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_ssCodeLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_ssCodeLength_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_ssCodeValue_xer_ = { {"ssCodeValue>\n", "ssCodeValue>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_ssCodeValue_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_ssCodeValue_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_ssCodeValue_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_ssCodeValue_oer_ext_arr_, 0, ML3__NotifySS__Arg_ssCodeValue_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_ssCodeValue_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.ssCodeValue", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_ssCodeValue_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_ssCodeValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_ssCodeValue_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_ssIndicatorTag_xer_ = { {"ssIndicatorTag>\n", "ssIndicatorTag>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_ssIndicatorTag_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_ssIndicatorTag_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_ssIndicatorTag_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_ssIndicatorTag_oer_ext_arr_, 0, ML3__NotifySS__Arg_ssIndicatorTag_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_ssIndicatorTag_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.ssIndicatorTag", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_ssIndicatorTag_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_ssIndicatorTag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_ssIndicatorTag_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_ssIndicatorLength_xer_ = { {"ssIndicatorLength>\n", "ssIndicatorLength>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_ssIndicatorLength_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_ssIndicatorLength_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_ssIndicatorLength_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_ssIndicatorLength_oer_ext_arr_, 0, ML3__NotifySS__Arg_ssIndicatorLength_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_ssIndicatorLength_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.ssIndicatorLength", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_ssIndicatorLength_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_ssIndicatorLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_ssIndicatorLength_default_coding("RAW");
const XERdescriptor_t       ML3__NotifySS__Arg_ssIndicatorValue_xer_ = { {"ssIndicatorValue>\n", "ssIndicatorValue>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__NotifySS__Arg_ssIndicatorValue_oer_ext_arr_[0] = {};
const int ML3__NotifySS__Arg_ssIndicatorValue_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__NotifySS__Arg_ssIndicatorValue_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__NotifySS__Arg_ssIndicatorValue_oer_ext_arr_, 0, ML3__NotifySS__Arg_ssIndicatorValue_oer_p_};
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_ssIndicatorValue_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg.ssIndicatorValue", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__NotifySS__Arg_ssIndicatorValue_xer_, &OCTETSTRING_json_, &ML3__NotifySS__Arg_ssIndicatorValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_ssIndicatorValue_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__NotifySS__Arg_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 ML3__NotifySS__Arg
const TTCN_Typedescriptor_t ML3__NotifySS__Arg_descr_ = { "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg", NULL, &ML3__NotifySS__Arg_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__NotifySS__Arg_default_coding("RAW");
const XERdescriptor_t       CellIdentity_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 CellIdentity_elementIdentifier_oer_ext_arr_[0] = {};
const int CellIdentity_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t CellIdentity_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, CellIdentity_elementIdentifier_oer_ext_arr_, 0, CellIdentity_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t CellIdentity_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.CellIdentity.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &CellIdentity_elementIdentifier_xer_, &OCTETSTRING_json_, &CellIdentity_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellIdentity_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       CellIdentity_cIvalue_xer_ = { {"cIvalue>\n", "cIvalue>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CellIdentity_cIvalue_oer_ext_arr_[0] = {};
const int CellIdentity_cIvalue_oer_p_[0] = {};
const TTCN_OERdescriptor_t CellIdentity_cIvalue_oer_ = { -1, TRUE, 2, FALSE, 0, 0, CellIdentity_cIvalue_oer_ext_arr_, 0, CellIdentity_cIvalue_oer_p_};
const TTCN_Typedescriptor_t CellIdentity_cIvalue_descr_ = { "@MobileL3_CommonIE_Types.CellIdentity.cIvalue", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &CellIdentity_cIvalue_xer_, &OCTETSTRING_json_, &CellIdentity_cIvalue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellIdentity_cIvalue_default_coding("RAW");
const TTCN_RAWdescriptor_t CellIdentity_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 CellIdentity
const TTCN_Typedescriptor_t CellIdentity_descr_ = { "@MobileL3_CommonIE_Types.CellIdentity", NULL, &CellIdentity_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellIdentity_default_coding("RAW");
const XERdescriptor_t       CipheringKeySequenceNumberV_keySequence_xer_ = { {"keySequence>\n", "keySequence>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CipheringKeySequenceNumberV_keySequence_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CipheringKeySequenceNumberV_keySequence_descr_ = { "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberV.keySequence", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &CipheringKeySequenceNumberV_keySequence_xer_, &BITSTRING_json_, &CipheringKeySequenceNumberV_keySequence_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CipheringKeySequenceNumberV_keySequence_default_coding("RAW");
const XERdescriptor_t       CipheringKeySequenceNumberV_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 CipheringKeySequenceNumberV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CipheringKeySequenceNumberV_spare_descr_ = { "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberV.spare", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &CipheringKeySequenceNumberV_spare_xer_, &BITSTRING_json_, &CipheringKeySequenceNumberV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CipheringKeySequenceNumberV_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t CipheringKeySequenceNumberV_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 CipheringKeySequenceNumberV
const TTCN_Typedescriptor_t CipheringKeySequenceNumberV_descr_ = { "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberV", NULL, &CipheringKeySequenceNumberV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CipheringKeySequenceNumberV_default_coding("RAW");
UNIVERSAL_CHARSTRING CipheringKeySequenceNumberTV_keySequence_default_coding("RAW");
const XERdescriptor_t       CipheringKeySequenceNumberTV_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 CipheringKeySequenceNumberTV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CipheringKeySequenceNumberTV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &CipheringKeySequenceNumberTV_elementIdentifier_xer_, &BITSTRING_json_, &CipheringKeySequenceNumberTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CipheringKeySequenceNumberTV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t CipheringKeySequenceNumberTV_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 CipheringKeySequenceNumberTV
const TTCN_Typedescriptor_t CipheringKeySequenceNumberTV_descr_ = { "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV", NULL, &CipheringKeySequenceNumberTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CipheringKeySequenceNumberTV_default_coding("RAW");
const XERdescriptor_t       LocationAreaIdentification__V_mcc__mnc_xer_ = { {"mcc_mnc>\n", "mcc_mnc>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int LocationAreaIdentification__V_mcc__mnc_oer_ext_arr_[0] = {};
const int LocationAreaIdentification__V_mcc__mnc_oer_p_[0] = {};
const TTCN_OERdescriptor_t LocationAreaIdentification__V_mcc__mnc_oer_ = { -1, TRUE, 3, FALSE, 0, 0, LocationAreaIdentification__V_mcc__mnc_oer_ext_arr_, 0, LocationAreaIdentification__V_mcc__mnc_oer_p_};
const TTCN_Typedescriptor_t LocationAreaIdentification__V_mcc__mnc_descr_ = { "@MobileL3_CommonIE_Types.LocationAreaIdentification_V.mcc_mnc", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &LocationAreaIdentification__V_mcc__mnc_xer_, &OCTETSTRING_json_, &LocationAreaIdentification__V_mcc__mnc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationAreaIdentification__V_mcc__mnc_default_coding("RAW");
const XERdescriptor_t       LocationAreaIdentification__V_lac_xer_ = { {"lac>\n", "lac>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int LocationAreaIdentification__V_lac_oer_ext_arr_[0] = {};
const int LocationAreaIdentification__V_lac_oer_p_[0] = {};
const TTCN_OERdescriptor_t LocationAreaIdentification__V_lac_oer_ = { -1, TRUE, 2, FALSE, 0, 0, LocationAreaIdentification__V_lac_oer_ext_arr_, 0, LocationAreaIdentification__V_lac_oer_p_};
const TTCN_Typedescriptor_t LocationAreaIdentification__V_lac_descr_ = { "@MobileL3_CommonIE_Types.LocationAreaIdentification_V.lac", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &LocationAreaIdentification__V_lac_xer_, &OCTETSTRING_json_, &LocationAreaIdentification__V_lac_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationAreaIdentification__V_lac_default_coding("RAW");
const TTCN_RAWdescriptor_t LocationAreaIdentification__V_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 LocationAreaIdentification__V
const TTCN_Typedescriptor_t LocationAreaIdentification__V_descr_ = { "@MobileL3_CommonIE_Types.LocationAreaIdentification_V", NULL, &LocationAreaIdentification__V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationAreaIdentification__V_default_coding("RAW");
const XERdescriptor_t       LocationAreaIdentification__TV_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 LocationAreaIdentification__TV_elementIdentifier_oer_ext_arr_[0] = {};
const int LocationAreaIdentification__TV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t LocationAreaIdentification__TV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, LocationAreaIdentification__TV_elementIdentifier_oer_ext_arr_, 0, LocationAreaIdentification__TV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t LocationAreaIdentification__TV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &LocationAreaIdentification__TV_elementIdentifier_xer_, &OCTETSTRING_json_, &LocationAreaIdentification__TV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationAreaIdentification__TV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       LocationAreaIdentification__TV_mcc__mnc_xer_ = { {"mcc_mnc>\n", "mcc_mnc>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int LocationAreaIdentification__TV_mcc__mnc_oer_ext_arr_[0] = {};
const int LocationAreaIdentification__TV_mcc__mnc_oer_p_[0] = {};
const TTCN_OERdescriptor_t LocationAreaIdentification__TV_mcc__mnc_oer_ = { -1, TRUE, 3, FALSE, 0, 0, LocationAreaIdentification__TV_mcc__mnc_oer_ext_arr_, 0, LocationAreaIdentification__TV_mcc__mnc_oer_p_};
const TTCN_Typedescriptor_t LocationAreaIdentification__TV_mcc__mnc_descr_ = { "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV.mcc_mnc", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &LocationAreaIdentification__TV_mcc__mnc_xer_, &OCTETSTRING_json_, &LocationAreaIdentification__TV_mcc__mnc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationAreaIdentification__TV_mcc__mnc_default_coding("RAW");
const XERdescriptor_t       LocationAreaIdentification__TV_lac_xer_ = { {"lac>\n", "lac>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int LocationAreaIdentification__TV_lac_oer_ext_arr_[0] = {};
const int LocationAreaIdentification__TV_lac_oer_p_[0] = {};
const TTCN_OERdescriptor_t LocationAreaIdentification__TV_lac_oer_ = { -1, TRUE, 2, FALSE, 0, 0, LocationAreaIdentification__TV_lac_oer_ext_arr_, 0, LocationAreaIdentification__TV_lac_oer_p_};
const TTCN_Typedescriptor_t LocationAreaIdentification__TV_lac_descr_ = { "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV.lac", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &LocationAreaIdentification__TV_lac_xer_, &OCTETSTRING_json_, &LocationAreaIdentification__TV_lac_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationAreaIdentification__TV_lac_default_coding("RAW");
const TTCN_RAWdescriptor_t LocationAreaIdentification__TV_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 LocationAreaIdentification__TV
const TTCN_Typedescriptor_t LocationAreaIdentification__TV_descr_ = { "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV", NULL, &LocationAreaIdentification__TV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LocationAreaIdentification__TV_default_coding("RAW");
const XERdescriptor_t       MobileIdentityTLV_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 MobileIdentityTLV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileIdentityTLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityTLV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &MobileIdentityTLV_elementIdentifier_xer_, &BITSTRING_json_, &MobileIdentityTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityTLV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       MobileIdentityTLV_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 MobileIdentityTLV_spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileIdentityTLV_spare1_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityTLV.spare1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileIdentityTLV_spare1_xer_, &BITSTRING_json_, &MobileIdentityTLV_spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityTLV_spare1_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileIdentityLV_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       MobileIdentityLV_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 MobileIdentityLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileIdentityLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityLV.lengthIndicator", &INTEGER_ber_, &MobileIdentityLV_lengthIndicator_raw_, &INTEGER_text_, &MobileIdentityLV_lengthIndicator_xer_, &INTEGER_json_, &MobileIdentityLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       MobileIdentityV_typeOfIdentity_xer_ = { {"typeOfIdentity>\n", "typeOfIdentity>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileIdentityV_typeOfIdentity_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileIdentityV_typeOfIdentity_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityV.typeOfIdentity", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &MobileIdentityV_typeOfIdentity_xer_, &BITSTRING_json_, &MobileIdentityV_typeOfIdentity_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityV_typeOfIdentity_default_coding("RAW");
const TTCN_RAWdescriptor_t OddEvenInd__Identity_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 OddEvenInd__Identity
const TTCN_Typedescriptor_t OddEvenInd__Identity_descr_ = { "@MobileL3_CommonIE_Types.OddEvenInd_Identity", NULL, &OddEvenInd__Identity_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       IMSI__L3_oddevenIndicator_xer_ = { {"oddevenIndicator>\n", "oddevenIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t IMSI__L3_oddevenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t IMSI__L3_oddevenIndicator_descr_ = { "@MobileL3_CommonIE_Types.IMSI_L3.oddevenIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &IMSI__L3_oddevenIndicator_xer_, &BITSTRING_json_, &IMSI__L3_oddevenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMSI__L3_oddevenIndicator_default_coding("RAW");
const XERdescriptor_t       IMSI__L3_digits_xer_ = { {"digits>\n", "digits>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t IMSI__L3_digits_descr_ = { "@MobileL3_CommonIE_Types.IMSI_L3.digits", NULL, &HEXSTRING_raw_, NULL, &IMSI__L3_digits_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMSI__L3_digits_default_coding("RAW");
const TTCN_RAWdescriptor_t IMSI__L3_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 IMSI__L3
const TTCN_Typedescriptor_t IMSI__L3_descr_ = { "@MobileL3_CommonIE_Types.IMSI_L3", NULL, &IMSI__L3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t IMSI__L3_fillerDigit_raw_ = {4,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,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       IMSI__L3_fillerDigit_xer_ = { {"fillerDigit>\n", "fillerDigit>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t IMSI__L3_fillerDigit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t IMSI__L3_fillerDigit_descr_ = { "@MobileL3_CommonIE_Types.IMSI_L3.fillerDigit", &BITSTRING_ber_, &IMSI__L3_fillerDigit_raw_, NULL, &IMSI__L3_fillerDigit_xer_, &BITSTRING_json_, &IMSI__L3_fillerDigit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMSI__L3_fillerDigit_default_coding("RAW");
UNIVERSAL_CHARSTRING IMSI__L3_default_coding("RAW");
UNIVERSAL_CHARSTRING OddEvenInd__Identity_imsi_default_coding("RAW");
const XERdescriptor_t       IMEI__L3_oddevenIndicator_xer_ = { {"oddevenIndicator>\n", "oddevenIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t IMEI__L3_oddevenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t IMEI__L3_oddevenIndicator_descr_ = { "@MobileL3_CommonIE_Types.IMEI_L3.oddevenIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &IMEI__L3_oddevenIndicator_xer_, &BITSTRING_json_, &IMEI__L3_oddevenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMEI__L3_oddevenIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t IMEI__L3_digits_raw_ = {60,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       IMEI__L3_digits_xer_ = { {"digits>\n", "digits>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t IMEI__L3_digits_descr_ = { "@MobileL3_CommonIE_Types.IMEI_L3.digits", NULL, &IMEI__L3_digits_raw_, NULL, &IMEI__L3_digits_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMEI__L3_digits_default_coding("RAW");
const TTCN_RAWdescriptor_t IMEI__L3_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 IMEI__L3
const TTCN_Typedescriptor_t IMEI__L3_descr_ = { "@MobileL3_CommonIE_Types.IMEI_L3", NULL, &IMEI__L3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMEI__L3_default_coding("RAW");
UNIVERSAL_CHARSTRING OddEvenInd__Identity_imei_default_coding("RAW");
const XERdescriptor_t       IMEI__SV_oddevenIndicator_xer_ = { {"oddevenIndicator>\n", "oddevenIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t IMEI__SV_oddevenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t IMEI__SV_oddevenIndicator_descr_ = { "@MobileL3_CommonIE_Types.IMEI_SV.oddevenIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &IMEI__SV_oddevenIndicator_xer_, &BITSTRING_json_, &IMEI__SV_oddevenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMEI__SV_oddevenIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t IMEI__SV_digits_raw_ = {64,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       IMEI__SV_digits_xer_ = { {"digits>\n", "digits>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t IMEI__SV_digits_descr_ = { "@MobileL3_CommonIE_Types.IMEI_SV.digits", NULL, &IMEI__SV_digits_raw_, NULL, &IMEI__SV_digits_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMEI__SV_digits_default_coding("RAW");
const XERdescriptor_t       IMEI__SV_fillerDigit_xer_ = { {"fillerDigit>\n", "fillerDigit>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t IMEI__SV_fillerDigit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t IMEI__SV_fillerDigit_descr_ = { "@MobileL3_CommonIE_Types.IMEI_SV.fillerDigit", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &IMEI__SV_fillerDigit_xer_, &BITSTRING_json_, &IMEI__SV_fillerDigit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMEI__SV_fillerDigit_default_coding("RAW");
const TTCN_RAWdescriptor_t IMEI__SV_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 IMEI__SV
const TTCN_Typedescriptor_t IMEI__SV_descr_ = { "@MobileL3_CommonIE_Types.IMEI_SV", NULL, &IMEI__SV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING IMEI__SV_default_coding("RAW");
UNIVERSAL_CHARSTRING OddEvenInd__Identity_imei__sv_default_coding("RAW");
const XERdescriptor_t       TMSI__PTMSI_oddevenIndicator_xer_ = { {"oddevenIndicator>\n", "oddevenIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TMSI__PTMSI_oddevenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TMSI__PTMSI_oddevenIndicator_descr_ = { "@MobileL3_CommonIE_Types.TMSI_PTMSI.oddevenIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TMSI__PTMSI_oddevenIndicator_xer_, &BITSTRING_json_, &TMSI__PTMSI_oddevenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMSI__PTMSI_oddevenIndicator_default_coding("RAW");
const XERdescriptor_t       TMSI__PTMSI_fillerDigit_xer_ = { {"fillerDigit>\n", "fillerDigit>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TMSI__PTMSI_fillerDigit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TMSI__PTMSI_fillerDigit_descr_ = { "@MobileL3_CommonIE_Types.TMSI_PTMSI.fillerDigit", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &TMSI__PTMSI_fillerDigit_xer_, &BITSTRING_json_, &TMSI__PTMSI_fillerDigit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMSI__PTMSI_fillerDigit_default_coding("RAW");
const XERdescriptor_t       TMSI__PTMSI_octets_xer_ = { {"octets>\n", "octets>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TMSI__PTMSI_octets_oer_ext_arr_[0] = {};
const int TMSI__PTMSI_octets_oer_p_[0] = {};
const TTCN_OERdescriptor_t TMSI__PTMSI_octets_oer_ = { -1, TRUE, 4, FALSE, 0, 0, TMSI__PTMSI_octets_oer_ext_arr_, 0, TMSI__PTMSI_octets_oer_p_};
const TTCN_Typedescriptor_t TMSI__PTMSI_octets_descr_ = { "@MobileL3_CommonIE_Types.TMSI_PTMSI.octets", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &TMSI__PTMSI_octets_xer_, &OCTETSTRING_json_, &TMSI__PTMSI_octets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMSI__PTMSI_octets_default_coding("RAW");
const TTCN_RAWdescriptor_t TMSI__PTMSI_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 TMSI__PTMSI
const TTCN_Typedescriptor_t TMSI__PTMSI_descr_ = { "@MobileL3_CommonIE_Types.TMSI_PTMSI", NULL, &TMSI__PTMSI_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMSI__PTMSI_default_coding("RAW");
UNIVERSAL_CHARSTRING OddEvenInd__Identity_tmsi__ptmsi_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_oddevenIndicator_xer_ = { {"oddevenIndicator>\n", "oddevenIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TMGI__and__MBMS__SessionID_oddevenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_oddevenIndicator_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.oddevenIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TMGI__and__MBMS__SessionID_oddevenIndicator_xer_, &BITSTRING_json_, &TMGI__and__MBMS__SessionID_oddevenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_oddevenIndicator_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mCC__MNCIndicator_xer_ = { {"mCC_MNCIndicator>\n", "mCC_MNCIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TMGI__and__MBMS__SessionID_mCC__MNCIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mCC__MNCIndicator_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mCC_MNCIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TMGI__and__MBMS__SessionID_mCC__MNCIndicator_xer_, &BITSTRING_json_, &TMGI__and__MBMS__SessionID_mCC__MNCIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mCC__MNCIndicator_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mBMS__SessionIdentityIndicator_xer_ = { {"mBMS_SessionIdentityIndicator>\n", "mBMS_SessionIdentityIndicator>\n"}, {31, 31}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TMGI__and__MBMS__SessionID_mBMS__SessionIdentityIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mBMS__SessionIdentityIndicator_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mBMS_SessionIdentityIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &TMGI__and__MBMS__SessionID_mBMS__SessionIdentityIndicator_xer_, &BITSTRING_json_, &TMGI__and__MBMS__SessionID_mBMS__SessionIdentityIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mBMS__SessionIdentityIndicator_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_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 TMGI__and__MBMS__SessionID_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_spare_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.spare", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &TMGI__and__MBMS__SessionID_spare_xer_, &BITSTRING_json_, &TMGI__and__MBMS__SessionID_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_spare_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mBMS__ServiceID_xer_ = { {"mBMS_ServiceID>\n", "mBMS_ServiceID>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TMGI__and__MBMS__SessionID_mBMS__ServiceID_oer_ext_arr_[0] = {};
const int TMGI__and__MBMS__SessionID_mBMS__ServiceID_oer_p_[0] = {};
const TTCN_OERdescriptor_t TMGI__and__MBMS__SessionID_mBMS__ServiceID_oer_ = { -1, TRUE, 3, FALSE, 0, 0, TMGI__and__MBMS__SessionID_mBMS__ServiceID_oer_ext_arr_, 0, TMGI__and__MBMS__SessionID_mBMS__ServiceID_oer_p_};
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mBMS__ServiceID_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mBMS_ServiceID", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &TMGI__and__MBMS__SessionID_mBMS__ServiceID_xer_, &OCTETSTRING_json_, &TMGI__and__MBMS__SessionID_mBMS__ServiceID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mBMS__ServiceID_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mccDigit1_xer_ = { {"mccDigit1>\n", "mccDigit1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mccDigit1_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mccDigit1", NULL, &General__Types::HEX1_raw_, NULL, &TMGI__and__MBMS__SessionID_mccDigit1_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mccDigit1_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mccDigit2_xer_ = { {"mccDigit2>\n", "mccDigit2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mccDigit2_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mccDigit2", NULL, &General__Types::HEX1_raw_, NULL, &TMGI__and__MBMS__SessionID_mccDigit2_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mccDigit2_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mccDigit3_xer_ = { {"mccDigit3>\n", "mccDigit3>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mccDigit3_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mccDigit3", NULL, &General__Types::HEX1_raw_, NULL, &TMGI__and__MBMS__SessionID_mccDigit3_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mccDigit3_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mncDigit3_xer_ = { {"mncDigit3>\n", "mncDigit3>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mncDigit3_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mncDigit3", NULL, &General__Types::HEX1_raw_, NULL, &TMGI__and__MBMS__SessionID_mncDigit3_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mncDigit3_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mncDigit1_xer_ = { {"mncDigit1>\n", "mncDigit1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mncDigit1_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mncDigit1", NULL, &General__Types::HEX1_raw_, NULL, &TMGI__and__MBMS__SessionID_mncDigit1_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mncDigit1_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mncDigit2_xer_ = { {"mncDigit2>\n", "mncDigit2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mncDigit2_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mncDigit2", NULL, &General__Types::HEX1_raw_, NULL, &TMGI__and__MBMS__SessionID_mncDigit2_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mncDigit2_default_coding("RAW");
const XERdescriptor_t       TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_xer_ = { {"mBMS_SessionIdentity>\n", "mBMS_SessionIdentity>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_oer_ext_arr_[0] = {};
const int TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_oer_p_[0] = {};
const TTCN_OERdescriptor_t TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_oer_ = { -1, TRUE, 1, FALSE, 0, 0, TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_oer_ext_arr_, 0, TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_oer_p_};
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.mBMS_SessionIdentity", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_xer_, &OCTETSTRING_json_, &TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_mBMS__SessionIdentity_default_coding("RAW");
const TTCN_RAWdescriptor_t TMGI__and__MBMS__SessionID_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 TMGI__and__MBMS__SessionID
const TTCN_Typedescriptor_t TMGI__and__MBMS__SessionID_descr_ = { "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID", NULL, &TMGI__and__MBMS__SessionID_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TMGI__and__MBMS__SessionID_default_coding("RAW");
UNIVERSAL_CHARSTRING OddEvenInd__Identity_tmgi__and__MBMS__SessionID_default_coding("RAW");
const XERdescriptor_t       No__Identity_oddevenIndicator_xer_ = { {"oddevenIndicator>\n", "oddevenIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t No__Identity_oddevenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t No__Identity_oddevenIndicator_descr_ = { "@MobileL3_CommonIE_Types.No_Identity.oddevenIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &No__Identity_oddevenIndicator_xer_, &BITSTRING_json_, &No__Identity_oddevenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING No__Identity_oddevenIndicator_default_coding("RAW");
const XERdescriptor_t       No__Identity_fillerDigits_xer_ = { {"fillerDigits>\n", "fillerDigits>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t No__Identity_fillerDigits_descr_ = { "@MobileL3_CommonIE_Types.No_Identity.fillerDigits", NULL, &HEXSTRING_raw_, NULL, &No__Identity_fillerDigits_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING No__Identity_fillerDigits_default_coding("RAW");
const TTCN_RAWdescriptor_t No__Identity_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 No__Identity
const TTCN_Typedescriptor_t No__Identity_descr_ = { "@MobileL3_CommonIE_Types.No_Identity", NULL, &No__Identity_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING No__Identity_default_coding("RAW");
UNIVERSAL_CHARSTRING OddEvenInd__Identity_no__identity_default_coding("RAW");
UNIVERSAL_CHARSTRING OddEvenInd__Identity_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileIdentityV_oddEvenInd__identity_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 MobileIdentityV_oddEvenInd__identity
const TTCN_Typedescriptor_t MobileIdentityV_oddEvenInd__identity_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityV.oddEvenInd_identity", NULL, &MobileIdentityV_oddEvenInd__identity_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityV_oddEvenInd__identity_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileIdentityV_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 MobileIdentityV
const TTCN_Typedescriptor_t MobileIdentityV_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityV", NULL, &MobileIdentityV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityV_default_coding("RAW");
UNIVERSAL_CHARSTRING MobileIdentityLV_mobileIdentityV_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileIdentityLV_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 MobileIdentityLV
const TTCN_Typedescriptor_t MobileIdentityLV_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityLV", NULL, &MobileIdentityLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityLV_default_coding("RAW");
UNIVERSAL_CHARSTRING MobileIdentityTLV_mobileIdentityLV_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileIdentityTLV_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 MobileIdentityTLV
const TTCN_Typedescriptor_t MobileIdentityTLV_descr_ = { "@MobileL3_CommonIE_Types.MobileIdentityTLV", NULL, &MobileIdentityTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileIdentityTLV_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__TV_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 MobileStationClassmark1__TV_elementIdentifier_oer_ext_arr_[0] = {};
const int MobileStationClassmark1__TV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t MobileStationClassmark1__TV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, MobileStationClassmark1__TV_elementIdentifier_oer_ext_arr_, 0, MobileStationClassmark1__TV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t MobileStationClassmark1__TV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &MobileStationClassmark1__TV_elementIdentifier_xer_, &OCTETSTRING_json_, &MobileStationClassmark1__TV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__TV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__TV_rf__PowerCapability_xer_ = { {"rf_PowerCapability>\n", "rf_PowerCapability>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__TV_rf__PowerCapability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__TV_rf__PowerCapability_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV.rf_PowerCapability", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &MobileStationClassmark1__TV_rf__PowerCapability_xer_, &BITSTRING_json_, &MobileStationClassmark1__TV_rf__PowerCapability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__TV_rf__PowerCapability_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__TV_a5__1_xer_ = { {"a5_1>\n", "a5_1>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__TV_a5__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__TV_a5__1_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV.a5_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark1__TV_a5__1_xer_, &BITSTRING_json_, &MobileStationClassmark1__TV_a5__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__TV_a5__1_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__TV_esind_xer_ = { {"esind>\n", "esind>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__TV_esind_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__TV_esind_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV.esind", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark1__TV_esind_xer_, &BITSTRING_json_, &MobileStationClassmark1__TV_esind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__TV_esind_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__TV_revisionLevel_xer_ = { {"revisionLevel>\n", "revisionLevel>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__TV_revisionLevel_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__TV_revisionLevel_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV.revisionLevel", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &MobileStationClassmark1__TV_revisionLevel_xer_, &BITSTRING_json_, &MobileStationClassmark1__TV_revisionLevel_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__TV_revisionLevel_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__TV_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 MobileStationClassmark1__TV_spare1__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__TV_spare1__1_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV.spare1_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark1__TV_spare1__1_xer_, &BITSTRING_json_, &MobileStationClassmark1__TV_spare1__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__TV_spare1__1_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark1__TV_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 MobileStationClassmark1__TV
const TTCN_Typedescriptor_t MobileStationClassmark1__TV_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV", NULL, &MobileStationClassmark1__TV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__TV_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__V_rf__PowerCapability_xer_ = { {"rf_PowerCapability>\n", "rf_PowerCapability>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__V_rf__PowerCapability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__V_rf__PowerCapability_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_V.rf_PowerCapability", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &MobileStationClassmark1__V_rf__PowerCapability_xer_, &BITSTRING_json_, &MobileStationClassmark1__V_rf__PowerCapability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__V_rf__PowerCapability_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__V_a5__1_xer_ = { {"a5_1>\n", "a5_1>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__V_a5__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__V_a5__1_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_V.a5_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark1__V_a5__1_xer_, &BITSTRING_json_, &MobileStationClassmark1__V_a5__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__V_a5__1_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__V_esind_xer_ = { {"esind>\n", "esind>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__V_esind_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__V_esind_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_V.esind", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark1__V_esind_xer_, &BITSTRING_json_, &MobileStationClassmark1__V_esind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__V_esind_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__V_revisionLevel_xer_ = { {"revisionLevel>\n", "revisionLevel>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark1__V_revisionLevel_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__V_revisionLevel_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_V.revisionLevel", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &MobileStationClassmark1__V_revisionLevel_xer_, &BITSTRING_json_, &MobileStationClassmark1__V_revisionLevel_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__V_revisionLevel_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark1__V_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 MobileStationClassmark1__V_spare1__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark1__V_spare1__1_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_V.spare1_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark1__V_spare1__1_xer_, &BITSTRING_json_, &MobileStationClassmark1__V_spare1__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__V_spare1__1_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark1__V_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 MobileStationClassmark1__V
const TTCN_Typedescriptor_t MobileStationClassmark1__V_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark1_V", NULL, &MobileStationClassmark1__V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark1__V_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct4_fc_xer_ = { {"fc>\n", "fc>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct4_fc_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_fc_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.fc", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct4_fc_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct4_fc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_fc_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct4_vgcs_xer_ = { {"vgcs>\n", "vgcs>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct4_vgcs_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_vgcs_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.vgcs", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct4_vgcs_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct4_vgcs_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_vgcs_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct4_vbs_xer_ = { {"vbs>\n", "vbs>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct4_vbs_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_vbs_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.vbs", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct4_vbs_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct4_vbs_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_vbs_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct4_sm__Capability_xer_ = { {"sm_Capability>\n", "sm_Capability>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct4_sm__Capability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_sm__Capability_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.sm_Capability", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct4_sm__Capability_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct4_sm__Capability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_sm__Capability_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct4_ss__ScreenIndicator_xer_ = { {"ss_ScreenIndicator>\n", "ss_ScreenIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct4_ss__ScreenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_ss__ScreenIndicator_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.ss_ScreenIndicator", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &MobileStationClassmark2__oct4_ss__ScreenIndicator_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct4_ss__ScreenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_ss__ScreenIndicator_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct4_ps__Capability_xer_ = { {"ps_Capability>\n", "ps_Capability>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct4_ps__Capability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_ps__Capability_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.ps_Capability", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct4_ps__Capability_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct4_ps__Capability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_ps__Capability_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct4_spare2__1_xer_ = { {"spare2_1>\n", "spare2_1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct4_spare2__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_spare2__1_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.spare2_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct4_spare2__1_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct4_spare2__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_spare2__1_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark2__oct4_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 MobileStationClassmark2__oct4
const TTCN_Typedescriptor_t MobileStationClassmark2__oct4_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4", NULL, &MobileStationClassmark2__oct4_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct4_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_a5__2_xer_ = { {"a5_2>\n", "a5_2>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_a5__2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_a5__2_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.a5_2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_a5__2_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_a5__2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_a5__2_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_a5__3_xer_ = { {"a5_3>\n", "a5_3>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_a5__3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_a5__3_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.a5_3", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_a5__3_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_a5__3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_a5__3_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_cmsp_xer_ = { {"cmsp>\n", "cmsp>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_cmsp_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_cmsp_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.cmsp", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_cmsp_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_cmsp_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_cmsp_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_solsa_xer_ = { {"solsa>\n", "solsa>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_solsa_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_solsa_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.solsa", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_solsa_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_solsa_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_solsa_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_ucs2_xer_ = { {"ucs2>\n", "ucs2>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_ucs2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_ucs2_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.ucs2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_ucs2_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_ucs2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_ucs2_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_lcsva__cap_xer_ = { {"lcsva_cap>\n", "lcsva_cap>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_lcsva__cap_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_lcsva__cap_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.lcsva_cap", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_lcsva__cap_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_lcsva__cap_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_lcsva__cap_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_spare5__7_xer_ = { {"spare5_7>\n", "spare5_7>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_spare5__7_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_spare5__7_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.spare5_7", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_spare5__7_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_spare5__7_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_spare5__7_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__oct5_cm3_xer_ = { {"cm3>\n", "cm3>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__oct5_cm3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_cm3_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.cm3", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__oct5_cm3_xer_, &BITSTRING_json_, &MobileStationClassmark2__oct5_cm3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_cm3_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark2__oct5_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 MobileStationClassmark2__oct5
const TTCN_Typedescriptor_t MobileStationClassmark2__oct5_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5", NULL, &MobileStationClassmark2__oct5_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__oct5_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark2__LV_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       MobileStationClassmark2__LV_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 MobileStationClassmark2__LV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__LV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV.lengthIndicator", &INTEGER_ber_, &MobileStationClassmark2__LV_lengthIndicator_raw_, &INTEGER_text_, &MobileStationClassmark2__LV_lengthIndicator_xer_, &INTEGER_json_, &MobileStationClassmark2__LV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__LV_rf__PowerCapability_xer_ = { {"rf_PowerCapability>\n", "rf_PowerCapability>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__LV_rf__PowerCapability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__LV_rf__PowerCapability_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV.rf_PowerCapability", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &MobileStationClassmark2__LV_rf__PowerCapability_xer_, &BITSTRING_json_, &MobileStationClassmark2__LV_rf__PowerCapability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_rf__PowerCapability_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__LV_a5__1_xer_ = { {"a5_1>\n", "a5_1>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__LV_a5__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__LV_a5__1_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV.a5_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__LV_a5__1_xer_, &BITSTRING_json_, &MobileStationClassmark2__LV_a5__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_a5__1_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__LV_esind_xer_ = { {"esind>\n", "esind>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__LV_esind_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__LV_esind_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV.esind", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__LV_esind_xer_, &BITSTRING_json_, &MobileStationClassmark2__LV_esind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_esind_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__LV_revisionLevel_xer_ = { {"revisionLevel>\n", "revisionLevel>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MobileStationClassmark2__LV_revisionLevel_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__LV_revisionLevel_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV.revisionLevel", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &MobileStationClassmark2__LV_revisionLevel_xer_, &BITSTRING_json_, &MobileStationClassmark2__LV_revisionLevel_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_revisionLevel_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__LV_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 MobileStationClassmark2__LV_spare1__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark2__LV_spare1__1_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV.spare1_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MobileStationClassmark2__LV_spare1__1_xer_, &BITSTRING_json_, &MobileStationClassmark2__LV_spare1__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_spare1__1_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark2__LV_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 MobileStationClassmark2__LV
const TTCN_Typedescriptor_t MobileStationClassmark2__LV_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV", NULL, &MobileStationClassmark2__LV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_mobileStationClassmark2__oct4_default_coding("RAW");
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_mobileStationClassmark2__oct5_default_coding("RAW");
UNIVERSAL_CHARSTRING MobileStationClassmark2__LV_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark2__TLV_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 MobileStationClassmark2__TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int MobileStationClassmark2__TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t MobileStationClassmark2__TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, MobileStationClassmark2__TLV_elementIdentifier_oer_ext_arr_, 0, MobileStationClassmark2__TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t MobileStationClassmark2__TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &MobileStationClassmark2__TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &MobileStationClassmark2__TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__TLV_elementIdentifier_default_coding("RAW");
UNIVERSAL_CHARSTRING MobileStationClassmark2__TLV_mobileStationClassmark2LV_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark2__TLV_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 MobileStationClassmark2__TLV
const TTCN_Typedescriptor_t MobileStationClassmark2__TLV_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark2_TLV", NULL, &MobileStationClassmark2__TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark2__TLV_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_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 ClassmarkInformationType2__forUMTS_elementIdentifier_oer_ext_arr_[0] = {};
const int ClassmarkInformationType2__forUMTS_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ClassmarkInformationType2__forUMTS_elementIdentifier_oer_ext_arr_, 0, ClassmarkInformationType2__forUMTS_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ClassmarkInformationType2__forUMTS_elementIdentifier_xer_, &OCTETSTRING_json_, &ClassmarkInformationType2__forUMTS_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t ClassmarkInformationType2__forUMTS_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       ClassmarkInformationType2__forUMTS_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 ClassmarkInformationType2__forUMTS_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.lengthIndicator", &INTEGER_ber_, &ClassmarkInformationType2__forUMTS_lengthIndicator_raw_, &INTEGER_text_, &ClassmarkInformationType2__forUMTS_lengthIndicator_xer_, &INTEGER_json_, &ClassmarkInformationType2__forUMTS_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_rf__PowerCapability_xer_ = { {"rf_PowerCapability>\n", "rf_PowerCapability>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_rf__PowerCapability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_rf__PowerCapability_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.rf_PowerCapability", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &ClassmarkInformationType2__forUMTS_rf__PowerCapability_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_rf__PowerCapability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_rf__PowerCapability_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_a5__1_xer_ = { {"a5_1>\n", "a5_1>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_a5__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_a5__1_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.a5_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_a5__1_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_a5__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_a5__1_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_esind_xer_ = { {"esind>\n", "esind>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_esind_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_esind_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.esind", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_esind_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_esind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_esind_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_revisionLevel_xer_ = { {"revisionLevel>\n", "revisionLevel>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_revisionLevel_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_revisionLevel_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.revisionLevel", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &ClassmarkInformationType2__forUMTS_revisionLevel_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_revisionLevel_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_revisionLevel_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_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 ClassmarkInformationType2__forUMTS_spare1__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_spare1__1_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.spare1_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_spare1__1_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_spare1__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_spare1__1_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_fc_xer_ = { {"fc>\n", "fc>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_fc_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_fc_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.fc", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_fc_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_fc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_fc_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_vgcs_xer_ = { {"vgcs>\n", "vgcs>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_vgcs_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_vgcs_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.vgcs", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_vgcs_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_vgcs_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_vgcs_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_vbs_xer_ = { {"vbs>\n", "vbs>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_vbs_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_vbs_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.vbs", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_vbs_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_vbs_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_vbs_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_sm__Capability_xer_ = { {"sm_Capability>\n", "sm_Capability>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_sm__Capability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_sm__Capability_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.sm_Capability", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_sm__Capability_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_sm__Capability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_sm__Capability_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_ss__ScreenIndicator_xer_ = { {"ss_ScreenIndicator>\n", "ss_ScreenIndicator>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_ss__ScreenIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_ss__ScreenIndicator_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.ss_ScreenIndicator", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &ClassmarkInformationType2__forUMTS_ss__ScreenIndicator_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_ss__ScreenIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_ss__ScreenIndicator_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_ps__Capability_xer_ = { {"ps_Capability>\n", "ps_Capability>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_ps__Capability_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_ps__Capability_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.ps_Capability", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_ps__Capability_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_ps__Capability_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_ps__Capability_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_spare2__1_xer_ = { {"spare2_1>\n", "spare2_1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_spare2__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_spare2__1_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.spare2_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_spare2__1_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_spare2__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_spare2__1_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_a5__2_xer_ = { {"a5_2>\n", "a5_2>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_a5__2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_a5__2_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.a5_2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_a5__2_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_a5__2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_a5__2_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_a5__3_xer_ = { {"a5_3>\n", "a5_3>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_a5__3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_a5__3_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.a5_3", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_a5__3_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_a5__3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_a5__3_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_cmsp_xer_ = { {"cmsp>\n", "cmsp>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_cmsp_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_cmsp_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.cmsp", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_cmsp_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_cmsp_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_cmsp_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_solsa_xer_ = { {"solsa>\n", "solsa>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_solsa_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_solsa_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.solsa", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_solsa_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_solsa_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_solsa_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_ucs2_xer_ = { {"ucs2>\n", "ucs2>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_ucs2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_ucs2_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.ucs2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_ucs2_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_ucs2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_ucs2_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_lcsva__cap_xer_ = { {"lcsva_cap>\n", "lcsva_cap>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_lcsva__cap_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_lcsva__cap_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.lcsva_cap", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_lcsva__cap_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_lcsva__cap_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_lcsva__cap_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_spare5__7_xer_ = { {"spare5_7>\n", "spare5_7>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_spare5__7_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_spare5__7_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.spare5_7", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_spare5__7_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_spare5__7_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_spare5__7_default_coding("RAW");
const XERdescriptor_t       ClassmarkInformationType2__forUMTS_cm3_xer_ = { {"cm3>\n", "cm3>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClassmarkInformationType2__forUMTS_cm3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_cm3_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.cm3", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ClassmarkInformationType2__forUMTS_cm3_xer_, &BITSTRING_json_, &ClassmarkInformationType2__forUMTS_cm3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_cm3_default_coding("RAW");
const TTCN_RAWdescriptor_t ClassmarkInformationType2__forUMTS_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 ClassmarkInformationType2__forUMTS
const TTCN_Typedescriptor_t ClassmarkInformationType2__forUMTS_descr_ = { "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS", NULL, &ClassmarkInformationType2__forUMTS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClassmarkInformationType2__forUMTS_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark3__TLV_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 MobileStationClassmark3__TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int MobileStationClassmark3__TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t MobileStationClassmark3__TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, MobileStationClassmark3__TLV_elementIdentifier_oer_ext_arr_, 0, MobileStationClassmark3__TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t MobileStationClassmark3__TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &MobileStationClassmark3__TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &MobileStationClassmark3__TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark3__TLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark3__TLV_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       MobileStationClassmark3__TLV_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 MobileStationClassmark3__TLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark3__TLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV.lengthIndicator", &INTEGER_ber_, &MobileStationClassmark3__TLV_lengthIndicator_raw_, &INTEGER_text_, &MobileStationClassmark3__TLV_lengthIndicator_xer_, &INTEGER_json_, &MobileStationClassmark3__TLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark3__TLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark3__TLV_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int MobileStationClassmark3__TLV_valuePart_oer_ext_arr_[0] = {};
const int MobileStationClassmark3__TLV_valuePart_oer_p_[0] = {};
const TTCN_OERdescriptor_t MobileStationClassmark3__TLV_valuePart_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MobileStationClassmark3__TLV_valuePart_oer_ext_arr_, 0, MobileStationClassmark3__TLV_valuePart_oer_p_};
const TTCN_Typedescriptor_t MobileStationClassmark3__TLV_valuePart_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV.valuePart", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &MobileStationClassmark3__TLV_valuePart_xer_, &OCTETSTRING_json_, &MobileStationClassmark3__TLV_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark3__TLV_valuePart_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark3__TLV_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 MobileStationClassmark3__TLV
const TTCN_Typedescriptor_t MobileStationClassmark3__TLV_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV", NULL, &MobileStationClassmark3__TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark3__TLV_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark3__LV_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       MobileStationClassmark3__LV_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 MobileStationClassmark3__LV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MobileStationClassmark3__LV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark3_LV.lengthIndicator", &INTEGER_ber_, &MobileStationClassmark3__LV_lengthIndicator_raw_, &INTEGER_text_, &MobileStationClassmark3__LV_lengthIndicator_xer_, &INTEGER_json_, &MobileStationClassmark3__LV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark3__LV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       MobileStationClassmark3__LV_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int MobileStationClassmark3__LV_valuePart_oer_ext_arr_[0] = {};
const int MobileStationClassmark3__LV_valuePart_oer_p_[0] = {};
const TTCN_OERdescriptor_t MobileStationClassmark3__LV_valuePart_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MobileStationClassmark3__LV_valuePart_oer_ext_arr_, 0, MobileStationClassmark3__LV_valuePart_oer_p_};
const TTCN_Typedescriptor_t MobileStationClassmark3__LV_valuePart_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark3_LV.valuePart", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &MobileStationClassmark3__LV_valuePart_xer_, &OCTETSTRING_json_, &MobileStationClassmark3__LV_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark3__LV_valuePart_default_coding("RAW");
const TTCN_RAWdescriptor_t MobileStationClassmark3__LV_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 MobileStationClassmark3__LV
const TTCN_Typedescriptor_t MobileStationClassmark3__LV_descr_ = { "@MobileL3_CommonIE_Types.MobileStationClassmark3_LV", NULL, &MobileStationClassmark3__LV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MobileStationClassmark3__LV_default_coding("RAW");
const TTCN_RAWdescriptor_t UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_xer_ = { {"reportingofUTRANCSGCellsSupport>\n", "reportingofUTRANCSGCellsSupport>\n"}, {33, 33}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_descr_ = { "@MobileL3_CommonIE_Types.UTRACSGCellsReporting.reportingofUTRANCSGCellsSupport", &BITSTRING_ber_, &UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_raw_, NULL, &UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_xer_, &BITSTRING_json_, &UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING UTRACSGCellsReporting_reportingofUTRANCSGCellsSupport_default_coding("RAW");
const TTCN_RAWdescriptor_t UTRACSGCellsReporting_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for UTRACSGCellsReporting
const TTCN_Typedescriptor_t UTRACSGCellsReporting_descr_ = { "@MobileL3_CommonIE_Types.UTRACSGCellsReporting", NULL, &UTRACSGCellsReporting_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING UTRACSGCellsReporting_default_coding("RAW");
const TTCN_RAWdescriptor_t VAMOSLevel_vAMOSSupport_raw_ = {2,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,2,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       VAMOSLevel_vAMOSSupport_xer_ = { {"vAMOSSupport>\n", "vAMOSSupport>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t VAMOSLevel_vAMOSSupport_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t VAMOSLevel_vAMOSSupport_descr_ = { "@MobileL3_CommonIE_Types.VAMOSLevel.vAMOSSupport", &BITSTRING_ber_, &VAMOSLevel_vAMOSSupport_raw_, NULL, &VAMOSLevel_vAMOSSupport_xer_, &BITSTRING_json_, &VAMOSLevel_vAMOSSupport_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING VAMOSLevel_vAMOSSupport_default_coding("RAW");
const TTCN_RAWdescriptor_t VAMOSLevel_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for VAMOSLevel
const TTCN_Typedescriptor_t VAMOSLevel_descr_ = { "@MobileL3_CommonIE_Types.VAMOSLevel", NULL, &VAMOSLevel_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING VAMOSLevel_default_coding("RAW");
const TTCN_RAWdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_binaryCodingOfGroupOrBroadcastCallReference_raw_ = {27,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       DescriptiveGroupOrBroadcastCallReference__V_binaryCodingOfGroupOrBroadcastCallReference_xer_ = { {"binaryCodingOfGroupOrBroadcastCallReference>\n", "binaryCodingOfGroupOrBroadcastCallReference>\n"}, {45, 45}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t DescriptiveGroupOrBroadcastCallReference__V_binaryCodingOfGroupOrBroadcastCallReference_descr_ = { "@MobileL3_CommonIE_Types.DescriptiveGroupOrBroadcastCallReference_V.binaryCodingOfGroupOrBroadcastCallReference", &BITSTRING_ber_, &DescriptiveGroupOrBroadcastCallReference__V_binaryCodingOfGroupOrBroadcastCallReference_raw_, NULL, &DescriptiveGroupOrBroadcastCallReference__V_binaryCodingOfGroupOrBroadcastCallReference_xer_, &BITSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DescriptiveGroupOrBroadcastCallReference__V_binaryCodingOfGroupOrBroadcastCallReference_default_coding("RAW");
const TTCN_RAWdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_sF_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       DescriptiveGroupOrBroadcastCallReference__V_sF_xer_ = { {"sF>\n", "sF>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_sF_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DescriptiveGroupOrBroadcastCallReference__V_sF_descr_ = { "@MobileL3_CommonIE_Types.DescriptiveGroupOrBroadcastCallReference_V.sF", &BITSTRING_ber_, &DescriptiveGroupOrBroadcastCallReference__V_sF_raw_, NULL, &DescriptiveGroupOrBroadcastCallReference__V_sF_xer_, &BITSTRING_json_, &DescriptiveGroupOrBroadcastCallReference__V_sF_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DescriptiveGroupOrBroadcastCallReference__V_sF_default_coding("RAW");
const TTCN_RAWdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_aF_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       DescriptiveGroupOrBroadcastCallReference__V_aF_xer_ = { {"aF>\n", "aF>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_aF_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DescriptiveGroupOrBroadcastCallReference__V_aF_descr_ = { "@MobileL3_CommonIE_Types.DescriptiveGroupOrBroadcastCallReference_V.aF", &BITSTRING_ber_, &DescriptiveGroupOrBroadcastCallReference__V_aF_raw_, NULL, &DescriptiveGroupOrBroadcastCallReference__V_aF_xer_, &BITSTRING_json_, &DescriptiveGroupOrBroadcastCallReference__V_aF_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DescriptiveGroupOrBroadcastCallReference__V_aF_default_coding("RAW");
const TTCN_RAWdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_callPriority_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,3,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       DescriptiveGroupOrBroadcastCallReference__V_callPriority_xer_ = { {"callPriority>\n", "callPriority>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_callPriority_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DescriptiveGroupOrBroadcastCallReference__V_callPriority_descr_ = { "@MobileL3_CommonIE_Types.DescriptiveGroupOrBroadcastCallReference_V.callPriority", &BITSTRING_ber_, &DescriptiveGroupOrBroadcastCallReference__V_callPriority_raw_, NULL, &DescriptiveGroupOrBroadcastCallReference__V_callPriority_xer_, &BITSTRING_json_, &DescriptiveGroupOrBroadcastCallReference__V_callPriority_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DescriptiveGroupOrBroadcastCallReference__V_callPriority_default_coding("RAW");
const TTCN_RAWdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_xer_ = { {"cipheringInformation>\n", "cipheringInformation>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_descr_ = { "@MobileL3_CommonIE_Types.DescriptiveGroupOrBroadcastCallReference_V.cipheringInformation", &BITSTRING_ber_, &DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_raw_, NULL, &DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_xer_, &BITSTRING_json_, &DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DescriptiveGroupOrBroadcastCallReference__V_cipheringInformation_default_coding("RAW");
const TTCN_RAWdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_spare_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       DescriptiveGroupOrBroadcastCallReference__V_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 DescriptiveGroupOrBroadcastCallReference__V_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DescriptiveGroupOrBroadcastCallReference__V_spare_descr_ = { "@MobileL3_CommonIE_Types.DescriptiveGroupOrBroadcastCallReference_V.spare", &BITSTRING_ber_, &DescriptiveGroupOrBroadcastCallReference__V_spare_raw_, NULL, &DescriptiveGroupOrBroadcastCallReference__V_spare_xer_, &BITSTRING_json_, &DescriptiveGroupOrBroadcastCallReference__V_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DescriptiveGroupOrBroadcastCallReference__V_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t DescriptiveGroupOrBroadcastCallReference__V_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 DescriptiveGroupOrBroadcastCallReference__V
const TTCN_Typedescriptor_t DescriptiveGroupOrBroadcastCallReference__V_descr_ = { "@MobileL3_CommonIE_Types.DescriptiveGroupOrBroadcastCallReference_V", NULL, &DescriptiveGroupOrBroadcastCallReference__V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DescriptiveGroupOrBroadcastCallReference__V_default_coding("RAW");
const XERdescriptor_t       groupCipherKeyNumber__TV_valuePart_xer_ = { {"valuePart>\n", "valuePart>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t groupCipherKeyNumber__TV_valuePart_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t groupCipherKeyNumber__TV_valuePart_descr_ = { "@MobileL3_CommonIE_Types.groupCipherKeyNumber_TV.valuePart", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &groupCipherKeyNumber__TV_valuePart_xer_, &BITSTRING_json_, &groupCipherKeyNumber__TV_valuePart_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING groupCipherKeyNumber__TV_valuePart_default_coding("RAW");
const XERdescriptor_t       groupCipherKeyNumber__TV_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 groupCipherKeyNumber__TV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t groupCipherKeyNumber__TV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.groupCipherKeyNumber_TV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &groupCipherKeyNumber__TV_elementIdentifier_xer_, &BITSTRING_json_, &groupCipherKeyNumber__TV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING groupCipherKeyNumber__TV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t groupCipherKeyNumber__TV_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 groupCipherKeyNumber__TV
const TTCN_Typedescriptor_t groupCipherKeyNumber__TV_descr_ = { "@MobileL3_CommonIE_Types.groupCipherKeyNumber_TV", NULL, &groupCipherKeyNumber__TV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING groupCipherKeyNumber__TV_default_coding("RAW");
const XERdescriptor_t       groupCipherKeyNumber__V_xer_ = { {"groupCipherKeyNumber_V>\n", "groupCipherKeyNumber_V>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t groupCipherKeyNumber__V_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t groupCipherKeyNumber__V_descr_ = { "@MobileL3_CommonIE_Types.groupCipherKeyNumber_V", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &groupCipherKeyNumber__V_xer_, &BITSTRING_json_, &groupCipherKeyNumber__V_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING groupCipherKeyNumber__V_default_coding("RAW");
const XERdescriptor_t       PdAndSapi_protocolDiscriminator_xer_ = { {"protocolDiscriminator>\n", "protocolDiscriminator>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PdAndSapi_protocolDiscriminator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PdAndSapi_protocolDiscriminator_descr_ = { "@MobileL3_CommonIE_Types.PdAndSapi.protocolDiscriminator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PdAndSapi_protocolDiscriminator_xer_, &BITSTRING_json_, &PdAndSapi_protocolDiscriminator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PdAndSapi_protocolDiscriminator_default_coding("RAW");
const XERdescriptor_t       PdAndSapi_sapi_xer_ = { {"sapi>\n", "sapi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PdAndSapi_sapi_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PdAndSapi_sapi_descr_ = { "@MobileL3_CommonIE_Types.PdAndSapi.sapi", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PdAndSapi_sapi_xer_, &BITSTRING_json_, &PdAndSapi_sapi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PdAndSapi_sapi_default_coding("RAW");
const XERdescriptor_t       PdAndSapi_spare2_xer_ = { {"spare2>\n", "spare2>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PdAndSapi_spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PdAndSapi_spare2_descr_ = { "@MobileL3_CommonIE_Types.PdAndSapi.spare2", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &PdAndSapi_spare2_xer_, &BITSTRING_json_, &PdAndSapi_spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PdAndSapi_spare2_default_coding("RAW");
const TTCN_RAWdescriptor_t PdAndSapi_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 PdAndSapi
const TTCN_Typedescriptor_t PdAndSapi_descr_ = { "@MobileL3_CommonIE_Types.PdAndSapi", NULL, &PdAndSapi_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PdAndSapi_default_coding("RAW");
const XERdescriptor_t       PriorityLevel__ML3_callPriority_xer_ = { {"callPriority>\n", "callPriority>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PriorityLevel__ML3_callPriority_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PriorityLevel__ML3_callPriority_descr_ = { "@MobileL3_CommonIE_Types.PriorityLevel_ML3.callPriority", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &PriorityLevel__ML3_callPriority_xer_, &BITSTRING_json_, &PriorityLevel__ML3_callPriority_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PriorityLevel__ML3_callPriority_default_coding("RAW");
const XERdescriptor_t       PriorityLevel__ML3_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 PriorityLevel__ML3_spare1__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PriorityLevel__ML3_spare1__1_descr_ = { "@MobileL3_CommonIE_Types.PriorityLevel_ML3.spare1_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &PriorityLevel__ML3_spare1__1_xer_, &BITSTRING_json_, &PriorityLevel__ML3_spare1__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PriorityLevel__ML3_spare1__1_default_coding("RAW");
const XERdescriptor_t       PriorityLevel__ML3_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 PriorityLevel__ML3_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PriorityLevel__ML3_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.PriorityLevel_ML3.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PriorityLevel__ML3_elementIdentifier_xer_, &BITSTRING_json_, &PriorityLevel__ML3_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PriorityLevel__ML3_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t PriorityLevel__ML3_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 PriorityLevel__ML3
const TTCN_Typedescriptor_t PriorityLevel__ML3_descr_ = { "@MobileL3_CommonIE_Types.PriorityLevel_ML3", NULL, &PriorityLevel__ML3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PriorityLevel__ML3_default_coding("RAW");
const XERdescriptor_t       PLMNListTLV_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 PLMNListTLV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PLMNListTLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.PLMNListTLV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &PLMNListTLV_elementIdentifier_xer_, &BITSTRING_json_, &PLMNListTLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PLMNListTLV_elementIdentifier_default_coding("RAW");
const XERdescriptor_t       PLMNListTLV_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 PLMNListTLV_spare1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PLMNListTLV_spare1_descr_ = { "@MobileL3_CommonIE_Types.PLMNListTLV.spare1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &PLMNListTLV_spare1_xer_, &BITSTRING_json_, &PLMNListTLV_spare1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PLMNListTLV_spare1_default_coding("RAW");
const TTCN_RAWdescriptor_t PLMNListTLV_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       PLMNListTLV_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 PLMNListTLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PLMNListTLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.PLMNListTLV.lengthIndicator", &INTEGER_ber_, &PLMNListTLV_lengthIndicator_raw_, &INTEGER_text_, &PLMNListTLV_lengthIndicator_xer_, &INTEGER_json_, &PLMNListTLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PLMNListTLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       PLMNListTLV_digits_xer_ = { {"digits>\n", "digits>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PLMNListTLV_digits_oer_ext_arr_[0] = {};
const int PLMNListTLV_digits_oer_p_[0] = {};
const TTCN_OERdescriptor_t PLMNListTLV_digits_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PLMNListTLV_digits_oer_ext_arr_, 0, PLMNListTLV_digits_oer_p_};
const TTCN_Typedescriptor_t PLMNListTLV_digits_descr_ = { "@MobileL3_CommonIE_Types.PLMNListTLV.digits", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &PLMNListTLV_digits_xer_, &OCTETSTRING_json_, &PLMNListTLV_digits_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PLMNListTLV_digits_default_coding("RAW");
const TTCN_RAWdescriptor_t PLMNListTLV_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 PLMNListTLV
const TTCN_Typedescriptor_t PLMNListTLV_descr_ = { "@MobileL3_CommonIE_Types.PLMNListTLV", NULL, &PLMNListTLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PLMNListTLV_default_coding("RAW");
const XERdescriptor_t       MS__NetworkFeatureSupportTV_extendedPeriodicTimers_xer_ = { {"extendedPeriodicTimers>\n", "extendedPeriodicTimers>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MS__NetworkFeatureSupportTV_extendedPeriodicTimers_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MS__NetworkFeatureSupportTV_extendedPeriodicTimers_descr_ = { "@MobileL3_CommonIE_Types.MS_NetworkFeatureSupportTV.extendedPeriodicTimers", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &MS__NetworkFeatureSupportTV_extendedPeriodicTimers_xer_, &BITSTRING_json_, &MS__NetworkFeatureSupportTV_extendedPeriodicTimers_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__NetworkFeatureSupportTV_extendedPeriodicTimers_default_coding("RAW");
const XERdescriptor_t       MS__NetworkFeatureSupportTV_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 MS__NetworkFeatureSupportTV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MS__NetworkFeatureSupportTV_spare_descr_ = { "@MobileL3_CommonIE_Types.MS_NetworkFeatureSupportTV.spare", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &MS__NetworkFeatureSupportTV_spare_xer_, &BITSTRING_json_, &MS__NetworkFeatureSupportTV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__NetworkFeatureSupportTV_spare_default_coding("RAW");
const XERdescriptor_t       MS__NetworkFeatureSupportTV_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 MS__NetworkFeatureSupportTV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MS__NetworkFeatureSupportTV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.MS_NetworkFeatureSupportTV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &MS__NetworkFeatureSupportTV_elementIdentifier_xer_, &BITSTRING_json_, &MS__NetworkFeatureSupportTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__NetworkFeatureSupportTV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t MS__NetworkFeatureSupportTV_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 MS__NetworkFeatureSupportTV
const TTCN_Typedescriptor_t MS__NetworkFeatureSupportTV_descr_ = { "@MobileL3_CommonIE_Types.MS_NetworkFeatureSupportTV", NULL, &MS__NetworkFeatureSupportTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MS__NetworkFeatureSupportTV_default_coding("RAW");
const XERdescriptor_t       GPRSTimer3TLV_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 GPRSTimer3TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int GPRSTimer3TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t GPRSTimer3TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, GPRSTimer3TLV_elementIdentifier_oer_ext_arr_, 0, GPRSTimer3TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t GPRSTimer3TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.GPRSTimer3TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &GPRSTimer3TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &GPRSTimer3TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING GPRSTimer3TLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t GPRSTimer3TLV_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       GPRSTimer3TLV_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 GPRSTimer3TLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t GPRSTimer3TLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.GPRSTimer3TLV.lengthIndicator", &INTEGER_ber_, &GPRSTimer3TLV_lengthIndicator_raw_, &INTEGER_text_, &GPRSTimer3TLV_lengthIndicator_xer_, &INTEGER_json_, &GPRSTimer3TLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING GPRSTimer3TLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       GPRSTimer3V_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 GPRSTimer3V_timerValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t GPRSTimer3V_timerValue_descr_ = { "@MobileL3_CommonIE_Types.GPRSTimer3V.timerValue", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &GPRSTimer3V_timerValue_xer_, &BITSTRING_json_, &GPRSTimer3V_timerValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING GPRSTimer3V_timerValue_default_coding("RAW");
const XERdescriptor_t       GPRSTimer3V_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 GPRSTimer3V_unit_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t GPRSTimer3V_unit_descr_ = { "@MobileL3_CommonIE_Types.GPRSTimer3V.unit", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &GPRSTimer3V_unit_xer_, &BITSTRING_json_, &GPRSTimer3V_unit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING GPRSTimer3V_unit_default_coding("RAW");
const TTCN_RAWdescriptor_t GPRSTimer3V_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 GPRSTimer3V
const TTCN_Typedescriptor_t GPRSTimer3V_descr_ = { "@MobileL3_CommonIE_Types.GPRSTimer3V", NULL, &GPRSTimer3V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING GPRSTimer3V_default_coding("RAW");
UNIVERSAL_CHARSTRING GPRSTimer3TLV_gprsTimer3V_default_coding("RAW");
const TTCN_RAWdescriptor_t GPRSTimer3TLV_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 GPRSTimer3TLV
const TTCN_Typedescriptor_t GPRSTimer3TLV_descr_ = { "@MobileL3_CommonIE_Types.GPRSTimer3TLV", NULL, &GPRSTimer3TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING GPRSTimer3TLV_default_coding("RAW");
const XERdescriptor_t       Diagnostics_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Diagnostics_data_oer_ext_arr_[0] = {};
const int Diagnostics_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t Diagnostics_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Diagnostics_data_oer_ext_arr_, 0, Diagnostics_data_oer_p_};
const TTCN_Typedescriptor_t Diagnostics_data_descr_ = { "@MobileL3_CommonIE_Types.Diagnostics.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &Diagnostics_data_xer_, &OCTETSTRING_json_, &Diagnostics_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Diagnostics_data_default_coding("RAW");
const TTCN_RAWdescriptor_t Diagnostics_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_YES,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Diagnostics
const TTCN_Typedescriptor_t Diagnostics_descr_ = { "@MobileL3_CommonIE_Types.Diagnostics", NULL, &Diagnostics_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Diagnostics_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__oct3_location_xer_ = { {"location>\n", "location>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ML3__Cause__oct3_location_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct3_location_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct3.location", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &ML3__Cause__oct3_location_xer_, &BITSTRING_json_, &ML3__Cause__oct3_location_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct3_location_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__oct3_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 ML3__Cause__oct3_spare1__1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct3_spare1__1_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct3.spare1_1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ML3__Cause__oct3_spare1__1_xer_, &BITSTRING_json_, &ML3__Cause__oct3_spare1__1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct3_spare1__1_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__oct3_codingStandard_xer_ = { {"codingStandard>\n", "codingStandard>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ML3__Cause__oct3_codingStandard_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct3_codingStandard_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct3.codingStandard", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &ML3__Cause__oct3_codingStandard_xer_, &BITSTRING_json_, &ML3__Cause__oct3_codingStandard_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct3_codingStandard_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__oct3_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 ML3__Cause__oct3_ext1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct3_ext1_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct3.ext1", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ML3__Cause__oct3_ext1_xer_, &BITSTRING_json_, &ML3__Cause__oct3_ext1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct3_ext1_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Cause__oct3_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_YES,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ML3__Cause__oct3
const TTCN_Typedescriptor_t ML3__Cause__oct3_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct3", NULL, &ML3__Cause__oct3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ML3__Cause__oct3_recommendation_xer_ = { {"recommendation>\n", "recommendation>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ML3__Cause__oct3_recommendation_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct3_recommendation_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct3.recommendation", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &ML3__Cause__oct3_recommendation_xer_, &BITSTRING_json_, &ML3__Cause__oct3_recommendation_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct3_recommendation_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__oct3_ext2_xer_ = { {"ext2>\n", "ext2>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ML3__Cause__oct3_ext2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct3_ext2_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct3.ext2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ML3__Cause__oct3_ext2_xer_, &BITSTRING_json_, &ML3__Cause__oct3_ext2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct3_ext2_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Cause__oct3_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__oct4_causeValue_xer_ = { {"causeValue>\n", "causeValue>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ML3__Cause__oct4_causeValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct4_causeValue_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct4.causeValue", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &ML3__Cause__oct4_causeValue_xer_, &BITSTRING_json_, &ML3__Cause__oct4_causeValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct4_causeValue_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__oct4_ext3_xer_ = { {"ext3>\n", "ext3>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ML3__Cause__oct4_ext3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__oct4_ext3_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct4.ext3", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &ML3__Cause__oct4_ext3_xer_, &BITSTRING_json_, &ML3__Cause__oct4_ext3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct4_ext3_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Cause__oct4_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_YES,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ML3__Cause__oct4
const TTCN_Typedescriptor_t ML3__Cause__oct4_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_oct4", NULL, &ML3__Cause__oct4_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__oct4_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Cause__LV_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       ML3__Cause__LV_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 ML3__Cause__LV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__LV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_LV.lengthIndicator", &INTEGER_ber_, &ML3__Cause__LV_lengthIndicator_raw_, &INTEGER_text_, &ML3__Cause__LV_lengthIndicator_xer_, &INTEGER_json_, &ML3__Cause__LV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__LV_lengthIndicator_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Cause__LV_oct3_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Cause__LV_oct4_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Cause__LV_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 ML3__Cause__LV
const TTCN_Typedescriptor_t ML3__Cause__LV_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_LV", NULL, &ML3__Cause__LV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__LV_diagnostics_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Cause__LV_default_coding("RAW");
const XERdescriptor_t       ML3__Cause__TLV_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 ML3__Cause__TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int ML3__Cause__TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Cause__TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ML3__Cause__TLV_elementIdentifier_oer_ext_arr_, 0, ML3__Cause__TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t ML3__Cause__TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ML3__Cause__TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &ML3__Cause__TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__TLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Cause__TLV_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       ML3__Cause__TLV_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 ML3__Cause__TLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ML3__Cause__TLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_TLV.lengthIndicator", &INTEGER_ber_, &ML3__Cause__TLV_lengthIndicator_raw_, &INTEGER_text_, &ML3__Cause__TLV_lengthIndicator_xer_, &INTEGER_json_, &ML3__Cause__TLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__TLV_lengthIndicator_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Cause__TLV_oct3_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Cause__TLV_oct4_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Cause__TLV_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 ML3__Cause__TLV
const TTCN_Typedescriptor_t ML3__Cause__TLV_descr_ = { "@MobileL3_CommonIE_Types.ML3_Cause_TLV", NULL, &ML3__Cause__TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Cause__TLV_diagnostics_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Cause__TLV_default_coding("RAW");
const XERdescriptor_t       Facility__TLV_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 Facility__TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int Facility__TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t Facility__TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, Facility__TLV_elementIdentifier_oer_ext_arr_, 0, Facility__TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t Facility__TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.Facility_TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &Facility__TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &Facility__TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Facility__TLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t Facility__TLV_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       Facility__TLV_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 Facility__TLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Facility__TLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.Facility_TLV.lengthIndicator", &INTEGER_ber_, &Facility__TLV_lengthIndicator_raw_, &INTEGER_text_, &Facility__TLV_lengthIndicator_xer_, &INTEGER_json_, &Facility__TLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Facility__TLV_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t Facility__TLV_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 Facility__TLV
const TTCN_Typedescriptor_t Facility__TLV_descr_ = { "@MobileL3_CommonIE_Types.Facility_TLV", NULL, &Facility__TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Facility__TLV_facilityInformation_xer_ = { {"facilityInformation>\n", "facilityInformation>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Facility__TLV_facilityInformation_oer_ext_arr_[0] = {};
const int Facility__TLV_facilityInformation_oer_p_[0] = {};
const TTCN_OERdescriptor_t Facility__TLV_facilityInformation_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Facility__TLV_facilityInformation_oer_ext_arr_, 0, Facility__TLV_facilityInformation_oer_p_};
const TTCN_Typedescriptor_t Facility__TLV_facilityInformation_descr_ = { "@MobileL3_CommonIE_Types.Facility_TLV.facilityInformation", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &Facility__TLV_facilityInformation_xer_, &OCTETSTRING_json_, &Facility__TLV_facilityInformation_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Facility__TLV_facilityInformation_default_coding("RAW");
UNIVERSAL_CHARSTRING Facility__TLV_default_coding("RAW");
const TTCN_RAWdescriptor_t Facility__LV_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       Facility__LV_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 Facility__LV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Facility__LV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.Facility_LV.lengthIndicator", &INTEGER_ber_, &Facility__LV_lengthIndicator_raw_, &INTEGER_text_, &Facility__LV_lengthIndicator_xer_, &INTEGER_json_, &Facility__LV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Facility__LV_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t Facility__LV_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 Facility__LV
const TTCN_Typedescriptor_t Facility__LV_descr_ = { "@MobileL3_CommonIE_Types.Facility_LV", NULL, &Facility__LV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Facility__LV_facilityInformation_xer_ = { {"facilityInformation>\n", "facilityInformation>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Facility__LV_facilityInformation_oer_ext_arr_[0] = {};
const int Facility__LV_facilityInformation_oer_p_[0] = {};
const TTCN_OERdescriptor_t Facility__LV_facilityInformation_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Facility__LV_facilityInformation_oer_ext_arr_, 0, Facility__LV_facilityInformation_oer_p_};
const TTCN_Typedescriptor_t Facility__LV_facilityInformation_descr_ = { "@MobileL3_CommonIE_Types.Facility_LV.facilityInformation", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &Facility__LV_facilityInformation_xer_, &OCTETSTRING_json_, &Facility__LV_facilityInformation_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Facility__LV_facilityInformation_default_coding("RAW");
UNIVERSAL_CHARSTRING Facility__LV_default_coding("RAW");
const XERdescriptor_t       SS__VersionIndicator_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 SS__VersionIndicator_elementIdentifier_oer_ext_arr_[0] = {};
const int SS__VersionIndicator_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t SS__VersionIndicator_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SS__VersionIndicator_elementIdentifier_oer_ext_arr_, 0, SS__VersionIndicator_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t SS__VersionIndicator_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.SS_VersionIndicator.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SS__VersionIndicator_elementIdentifier_xer_, &OCTETSTRING_json_, &SS__VersionIndicator_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SS__VersionIndicator_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t SS__VersionIndicator_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       SS__VersionIndicator_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 SS__VersionIndicator_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SS__VersionIndicator_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.SS_VersionIndicator.lengthIndicator", &INTEGER_ber_, &SS__VersionIndicator_lengthIndicator_raw_, &INTEGER_text_, &SS__VersionIndicator_lengthIndicator_xer_, &INTEGER_json_, &SS__VersionIndicator_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SS__VersionIndicator_lengthIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t SS__VersionIndicator_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 SS__VersionIndicator
const TTCN_Typedescriptor_t SS__VersionIndicator_descr_ = { "@MobileL3_CommonIE_Types.SS_VersionIndicator", NULL, &SS__VersionIndicator_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SS__VersionIndicator_ss__VersionIndicatorContents_xer_ = { {"ss_VersionIndicatorContents>\n", "ss_VersionIndicatorContents>\n"}, {29, 29}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SS__VersionIndicator_ss__VersionIndicatorContents_oer_ext_arr_[0] = {};
const int SS__VersionIndicator_ss__VersionIndicatorContents_oer_p_[0] = {};
const TTCN_OERdescriptor_t SS__VersionIndicator_ss__VersionIndicatorContents_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SS__VersionIndicator_ss__VersionIndicatorContents_oer_ext_arr_, 0, SS__VersionIndicator_ss__VersionIndicatorContents_oer_p_};
const TTCN_Typedescriptor_t SS__VersionIndicator_ss__VersionIndicatorContents_descr_ = { "@MobileL3_CommonIE_Types.SS_VersionIndicator.ss_VersionIndicatorContents", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SS__VersionIndicator_ss__VersionIndicatorContents_xer_, &OCTETSTRING_json_, &SS__VersionIndicator_ss__VersionIndicatorContents_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SS__VersionIndicator_ss__VersionIndicatorContents_default_coding("RAW");
UNIVERSAL_CHARSTRING SS__VersionIndicator_default_coding("RAW");
const XERdescriptor_t       codec_systemIdentification1_xer_ = { {"systemIdentification1>\n", "systemIdentification1>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int codec_systemIdentification1_oer_ext_arr_[0] = {};
const int codec_systemIdentification1_oer_p_[0] = {};
const TTCN_OERdescriptor_t codec_systemIdentification1_oer_ = { -1, TRUE, 1, FALSE, 0, 0, codec_systemIdentification1_oer_ext_arr_, 0, codec_systemIdentification1_oer_p_};
const TTCN_Typedescriptor_t codec_systemIdentification1_descr_ = { "@MobileL3_CommonIE_Types.codec.systemIdentification1", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &codec_systemIdentification1_xer_, &OCTETSTRING_json_, &codec_systemIdentification1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING codec_systemIdentification1_default_coding("RAW");
const XERdescriptor_t       codec_lengthOfBitmap1_xer_ = { {"lengthOfBitmap1>\n", "lengthOfBitmap1>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int codec_lengthOfBitmap1_oer_ext_arr_[0] = {};
const int codec_lengthOfBitmap1_oer_p_[0] = {};
const TTCN_OERdescriptor_t codec_lengthOfBitmap1_oer_ = { -1, TRUE, 1, FALSE, 0, 0, codec_lengthOfBitmap1_oer_ext_arr_, 0, codec_lengthOfBitmap1_oer_p_};
const TTCN_Typedescriptor_t codec_lengthOfBitmap1_descr_ = { "@MobileL3_CommonIE_Types.codec.lengthOfBitmap1", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &codec_lengthOfBitmap1_xer_, &OCTETSTRING_json_, &codec_lengthOfBitmap1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING codec_lengthOfBitmap1_default_coding("RAW");
const XERdescriptor_t       codec_codecBitmap1__bits1to8_xer_ = { {"codecBitmap1_bits1to8>\n", "codecBitmap1_bits1to8>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int codec_codecBitmap1__bits1to8_oer_ext_arr_[0] = {};
const int codec_codecBitmap1__bits1to8_oer_p_[0] = {};
const TTCN_OERdescriptor_t codec_codecBitmap1__bits1to8_oer_ = { -1, TRUE, 1, FALSE, 0, 0, codec_codecBitmap1__bits1to8_oer_ext_arr_, 0, codec_codecBitmap1__bits1to8_oer_p_};
const TTCN_Typedescriptor_t codec_codecBitmap1__bits1to8_descr_ = { "@MobileL3_CommonIE_Types.codec.codecBitmap1_bits1to8", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &codec_codecBitmap1__bits1to8_xer_, &OCTETSTRING_json_, &codec_codecBitmap1__bits1to8_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING codec_codecBitmap1__bits1to8_default_coding("RAW");
const XERdescriptor_t       codec_codecBitmap1__bits9to16_xer_ = { {"codecBitmap1_bits9to16>\n", "codecBitmap1_bits9to16>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int codec_codecBitmap1__bits9to16_oer_ext_arr_[0] = {};
const int codec_codecBitmap1__bits9to16_oer_p_[0] = {};
const TTCN_OERdescriptor_t codec_codecBitmap1__bits9to16_oer_ = { -1, TRUE, 1, FALSE, 0, 0, codec_codecBitmap1__bits9to16_oer_ext_arr_, 0, codec_codecBitmap1__bits9to16_oer_p_};
const TTCN_Typedescriptor_t codec_codecBitmap1__bits9to16_descr_ = { "@MobileL3_CommonIE_Types.codec.codecBitmap1_bits9to16", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &codec_codecBitmap1__bits9to16_xer_, &OCTETSTRING_json_, &codec_codecBitmap1__bits9to16_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING codec_codecBitmap1__bits9to16_default_coding("RAW");
const TTCN_RAWdescriptor_t codec_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 codec
const TTCN_Typedescriptor_t codec_descr_ = { "@MobileL3_CommonIE_Types.codec", NULL, &codec_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING codec_default_coding("RAW");
const TTCN_RAWdescriptor_t CodecList__ML3_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 CodecList__ML3
const TTCN_Typedescriptor_t CodecList__ML3_descr_ = { "@MobileL3_CommonIE_Types.CodecList_ML3", NULL, &CodecList__ML3_raw_, NULL, NULL, NULL, NULL, NULL, &codec_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CodecList__ML3_0_default_coding("RAW");
UNIVERSAL_CHARSTRING CodecList__ML3_default_coding("RAW");
const XERdescriptor_t       SupportedCodecList_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 SupportedCodecList_elementIdentifier_oer_ext_arr_[0] = {};
const int SupportedCodecList_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t SupportedCodecList_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SupportedCodecList_elementIdentifier_oer_ext_arr_, 0, SupportedCodecList_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t SupportedCodecList_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.SupportedCodecList.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SupportedCodecList_elementIdentifier_xer_, &OCTETSTRING_json_, &SupportedCodecList_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SupportedCodecList_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t SupportedCodecList_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       SupportedCodecList_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 SupportedCodecList_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SupportedCodecList_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.SupportedCodecList.lengthIndicator", &INTEGER_ber_, &SupportedCodecList_lengthIndicator_raw_, &INTEGER_text_, &SupportedCodecList_lengthIndicator_xer_, &INTEGER_json_, &SupportedCodecList_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SupportedCodecList_lengthIndicator_default_coding("RAW");
UNIVERSAL_CHARSTRING SupportedCodecList_codecList_default_coding("RAW");
const TTCN_RAWdescriptor_t SupportedCodecList_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 SupportedCodecList
const TTCN_Typedescriptor_t SupportedCodecList_descr_ = { "@MobileL3_CommonIE_Types.SupportedCodecList", NULL, &SupportedCodecList_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SupportedCodecList_default_coding("RAW");
const XERdescriptor_t       DevicePropertiesTV_lowPriority_xer_ = { {"lowPriority>\n", "lowPriority>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DevicePropertiesTV_lowPriority_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DevicePropertiesTV_lowPriority_descr_ = { "@MobileL3_CommonIE_Types.DevicePropertiesTV.lowPriority", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &DevicePropertiesTV_lowPriority_xer_, &BITSTRING_json_, &DevicePropertiesTV_lowPriority_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DevicePropertiesTV_lowPriority_default_coding("RAW");
const XERdescriptor_t       DevicePropertiesTV_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 DevicePropertiesTV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DevicePropertiesTV_spare_descr_ = { "@MobileL3_CommonIE_Types.DevicePropertiesTV.spare", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &DevicePropertiesTV_spare_xer_, &BITSTRING_json_, &DevicePropertiesTV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DevicePropertiesTV_spare_default_coding("RAW");
const XERdescriptor_t       DevicePropertiesTV_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 DevicePropertiesTV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DevicePropertiesTV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.DevicePropertiesTV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &DevicePropertiesTV_elementIdentifier_xer_, &BITSTRING_json_, &DevicePropertiesTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DevicePropertiesTV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t DevicePropertiesTV_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 DevicePropertiesTV
const TTCN_Typedescriptor_t DevicePropertiesTV_descr_ = { "@MobileL3_CommonIE_Types.DevicePropertiesTV", NULL, &DevicePropertiesTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DevicePropertiesTV_default_coding("RAW");
const XERdescriptor_t       P__TMSISignature2TLV_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 P__TMSISignature2TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int P__TMSISignature2TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t P__TMSISignature2TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, P__TMSISignature2TLV_elementIdentifier_oer_ext_arr_, 0, P__TMSISignature2TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t P__TMSISignature2TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.P_TMSISignature2TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &P__TMSISignature2TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &P__TMSISignature2TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSISignature2TLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t P__TMSISignature2TLV_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       P__TMSISignature2TLV_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 P__TMSISignature2TLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t P__TMSISignature2TLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.P_TMSISignature2TLV.lengthIndicator", &INTEGER_ber_, &P__TMSISignature2TLV_lengthIndicator_raw_, &INTEGER_text_, &P__TMSISignature2TLV_lengthIndicator_xer_, &INTEGER_json_, &P__TMSISignature2TLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSISignature2TLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       P__TMSISignature2TLV_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 P__TMSISignature2TLV_valueField_oer_ext_arr_[0] = {};
const int P__TMSISignature2TLV_valueField_oer_p_[0] = {};
const TTCN_OERdescriptor_t P__TMSISignature2TLV_valueField_oer_ = { -1, TRUE, 3, FALSE, 0, 0, P__TMSISignature2TLV_valueField_oer_ext_arr_, 0, P__TMSISignature2TLV_valueField_oer_p_};
const TTCN_Typedescriptor_t P__TMSISignature2TLV_valueField_descr_ = { "@MobileL3_CommonIE_Types.P_TMSISignature2TLV.valueField", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &P__TMSISignature2TLV_valueField_xer_, &OCTETSTRING_json_, &P__TMSISignature2TLV_valueField_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSISignature2TLV_valueField_default_coding("RAW");
const TTCN_RAWdescriptor_t P__TMSISignature2TLV_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 P__TMSISignature2TLV
const TTCN_Typedescriptor_t P__TMSISignature2TLV_descr_ = { "@MobileL3_CommonIE_Types.P_TMSISignature2TLV", NULL, &P__TMSISignature2TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSISignature2TLV_default_coding("RAW");
const XERdescriptor_t       P__TMSI__TypeTV_pTMSI__TypeValue_xer_ = { {"pTMSI_TypeValue>\n", "pTMSI_TypeValue>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t P__TMSI__TypeTV_pTMSI__TypeValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t P__TMSI__TypeTV_pTMSI__TypeValue_descr_ = { "@MobileL3_CommonIE_Types.P_TMSI_TypeTV.pTMSI_TypeValue", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &P__TMSI__TypeTV_pTMSI__TypeValue_xer_, &BITSTRING_json_, &P__TMSI__TypeTV_pTMSI__TypeValue_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSI__TypeTV_pTMSI__TypeValue_default_coding("RAW");
const XERdescriptor_t       P__TMSI__TypeTV_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 P__TMSI__TypeTV_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t P__TMSI__TypeTV_spare_descr_ = { "@MobileL3_CommonIE_Types.P_TMSI_TypeTV.spare", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &P__TMSI__TypeTV_spare_xer_, &BITSTRING_json_, &P__TMSI__TypeTV_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSI__TypeTV_spare_default_coding("RAW");
const XERdescriptor_t       P__TMSI__TypeTV_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 P__TMSI__TypeTV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t P__TMSI__TypeTV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.P_TMSI_TypeTV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &P__TMSI__TypeTV_elementIdentifier_xer_, &BITSTRING_json_, &P__TMSI__TypeTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSI__TypeTV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t P__TMSI__TypeTV_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 P__TMSI__TypeTV
const TTCN_Typedescriptor_t P__TMSI__TypeTV_descr_ = { "@MobileL3_CommonIE_Types.P_TMSI_TypeTV", NULL, &P__TMSI__TypeTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING P__TMSI__TypeTV_default_coding("RAW");
const XERdescriptor_t       RoutingAreaIdentification2TLV_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 RoutingAreaIdentification2TLV_elementIdentifier_oer_ext_arr_[0] = {};
const int RoutingAreaIdentification2TLV_elementIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t RoutingAreaIdentification2TLV_elementIdentifier_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RoutingAreaIdentification2TLV_elementIdentifier_oer_ext_arr_, 0, RoutingAreaIdentification2TLV_elementIdentifier_oer_p_};
const TTCN_Typedescriptor_t RoutingAreaIdentification2TLV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.RoutingAreaIdentification2TLV.elementIdentifier", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RoutingAreaIdentification2TLV_elementIdentifier_xer_, &OCTETSTRING_json_, &RoutingAreaIdentification2TLV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RoutingAreaIdentification2TLV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t RoutingAreaIdentification2TLV_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       RoutingAreaIdentification2TLV_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 RoutingAreaIdentification2TLV_lengthIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RoutingAreaIdentification2TLV_lengthIndicator_descr_ = { "@MobileL3_CommonIE_Types.RoutingAreaIdentification2TLV.lengthIndicator", &INTEGER_ber_, &RoutingAreaIdentification2TLV_lengthIndicator_raw_, &INTEGER_text_, &RoutingAreaIdentification2TLV_lengthIndicator_xer_, &INTEGER_json_, &RoutingAreaIdentification2TLV_lengthIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RoutingAreaIdentification2TLV_lengthIndicator_default_coding("RAW");
const XERdescriptor_t       RoutingAreaIdentification2TLV_routingAreaIdentification2_xer_ = { {"routingAreaIdentification2>\n", "routingAreaIdentification2>\n"}, {28, 28}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RoutingAreaIdentification2TLV_routingAreaIdentification2_oer_ext_arr_[0] = {};
const int RoutingAreaIdentification2TLV_routingAreaIdentification2_oer_p_[0] = {};
const TTCN_OERdescriptor_t RoutingAreaIdentification2TLV_routingAreaIdentification2_oer_ = { -1, TRUE, 6, FALSE, 0, 0, RoutingAreaIdentification2TLV_routingAreaIdentification2_oer_ext_arr_, 0, RoutingAreaIdentification2TLV_routingAreaIdentification2_oer_p_};
const TTCN_Typedescriptor_t RoutingAreaIdentification2TLV_routingAreaIdentification2_descr_ = { "@MobileL3_CommonIE_Types.RoutingAreaIdentification2TLV.routingAreaIdentification2", &OCTETSTRING_ber_, &General__Types::OCT6_raw_, &OCTETSTRING_text_, &RoutingAreaIdentification2TLV_routingAreaIdentification2_xer_, &OCTETSTRING_json_, &RoutingAreaIdentification2TLV_routingAreaIdentification2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RoutingAreaIdentification2TLV_routingAreaIdentification2_default_coding("RAW");
const TTCN_RAWdescriptor_t RoutingAreaIdentification2TLV_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 RoutingAreaIdentification2TLV
const TTCN_Typedescriptor_t RoutingAreaIdentification2TLV_descr_ = { "@MobileL3_CommonIE_Types.RoutingAreaIdentification2TLV", NULL, &RoutingAreaIdentification2TLV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RoutingAreaIdentification2TLV_default_coding("RAW");
const XERdescriptor_t       AdditionalUpdateParameterTV_cSMT_xer_ = { {"cSMT>\n", "cSMT>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t AdditionalUpdateParameterTV_cSMT_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AdditionalUpdateParameterTV_cSMT_descr_ = { "@MobileL3_CommonIE_Types.AdditionalUpdateParameterTV.cSMT", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &AdditionalUpdateParameterTV_cSMT_xer_, &BITSTRING_json_, &AdditionalUpdateParameterTV_cSMT_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AdditionalUpdateParameterTV_cSMT_default_coding("RAW");
const XERdescriptor_t       AdditionalUpdateParameterTV_cSMO_xer_ = { {"cSMO>\n", "cSMO>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t AdditionalUpdateParameterTV_cSMO_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AdditionalUpdateParameterTV_cSMO_descr_ = { "@MobileL3_CommonIE_Types.AdditionalUpdateParameterTV.cSMO", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &AdditionalUpdateParameterTV_cSMO_xer_, &BITSTRING_json_, &AdditionalUpdateParameterTV_cSMO_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AdditionalUpdateParameterTV_cSMO_default_coding("RAW");
const XERdescriptor_t       AdditionalUpdateParameterTV_spare2_xer_ = { {"spare2>\n", "spare2>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t AdditionalUpdateParameterTV_spare2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AdditionalUpdateParameterTV_spare2_descr_ = { "@MobileL3_CommonIE_Types.AdditionalUpdateParameterTV.spare2", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &AdditionalUpdateParameterTV_spare2_xer_, &BITSTRING_json_, &AdditionalUpdateParameterTV_spare2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AdditionalUpdateParameterTV_spare2_default_coding("RAW");
const XERdescriptor_t       AdditionalUpdateParameterTV_spare3_xer_ = { {"spare3>\n", "spare3>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t AdditionalUpdateParameterTV_spare3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AdditionalUpdateParameterTV_spare3_descr_ = { "@MobileL3_CommonIE_Types.AdditionalUpdateParameterTV.spare3", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &AdditionalUpdateParameterTV_spare3_xer_, &BITSTRING_json_, &AdditionalUpdateParameterTV_spare3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AdditionalUpdateParameterTV_spare3_default_coding("RAW");
const XERdescriptor_t       AdditionalUpdateParameterTV_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 AdditionalUpdateParameterTV_elementIdentifier_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t AdditionalUpdateParameterTV_elementIdentifier_descr_ = { "@MobileL3_CommonIE_Types.AdditionalUpdateParameterTV.elementIdentifier", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &AdditionalUpdateParameterTV_elementIdentifier_xer_, &BITSTRING_json_, &AdditionalUpdateParameterTV_elementIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AdditionalUpdateParameterTV_elementIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t AdditionalUpdateParameterTV_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 AdditionalUpdateParameterTV
const TTCN_Typedescriptor_t AdditionalUpdateParameterTV_descr_ = { "@MobileL3_CommonIE_Types.AdditionalUpdateParameterTV", NULL, &AdditionalUpdateParameterTV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AdditionalUpdateParameterTV_default_coding("RAW");
TTCN_Module module_object("MobileL3_CommonIE_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 */

MS__parameters::MS__parameters()
{
}

MS__parameters::MS__parameters(const INTEGER& par_imsi__length,
    const BITSTRING& par_imsi__firstdigit,
    const OCTETSTRING& par_imsi,
    const OCTETSTRING& par_number,
    const INTEGER& par_SCCP__connId,
    const INTEGER& par_L3__NSD,
    const BITSTRING& par_tiFlag)
  :   field_imsi__length(par_imsi__length),
  field_imsi__firstdigit(par_imsi__firstdigit),
  field_imsi(par_imsi),
  field_number(par_number),
  field_SCCP__connId(par_SCCP__connId),
  field_L3__NSD(par_L3__NSD),
  field_tiFlag(par_tiFlag)
{
}

MS__parameters::MS__parameters(const MS__parameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MS_parameters.");
if (other_value.imsi__length().is_bound()) field_imsi__length = other_value.imsi__length();
else field_imsi__length.clean_up();
if (other_value.imsi__firstdigit().is_bound()) field_imsi__firstdigit = other_value.imsi__firstdigit();
else field_imsi__firstdigit.clean_up();
if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
else field_imsi.clean_up();
if (other_value.number().is_bound()) field_number = other_value.number();
else field_number.clean_up();
if (other_value.SCCP__connId().is_bound()) field_SCCP__connId = other_value.SCCP__connId();
else field_SCCP__connId.clean_up();
if (other_value.L3__NSD().is_bound()) field_L3__NSD = other_value.L3__NSD();
else field_L3__NSD.clean_up();
if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
else field_tiFlag.clean_up();
}

void MS__parameters::clean_up()
{
field_imsi__length.clean_up();
field_imsi__firstdigit.clean_up();
field_imsi.clean_up();
field_number.clean_up();
field_SCCP__connId.clean_up();
field_L3__NSD.clean_up();
field_tiFlag.clean_up();
}

const TTCN_Typedescriptor_t* MS__parameters::get_descriptor() const { return &MS__parameters_descr_; }
MS__parameters& MS__parameters::operator=(const MS__parameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MS_parameters.");
  if (other_value.imsi__length().is_bound()) field_imsi__length = other_value.imsi__length();
  else field_imsi__length.clean_up();
  if (other_value.imsi__firstdigit().is_bound()) field_imsi__firstdigit = other_value.imsi__firstdigit();
  else field_imsi__firstdigit.clean_up();
  if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
  else field_imsi.clean_up();
  if (other_value.number().is_bound()) field_number = other_value.number();
  else field_number.clean_up();
  if (other_value.SCCP__connId().is_bound()) field_SCCP__connId = other_value.SCCP__connId();
  else field_SCCP__connId.clean_up();
  if (other_value.L3__NSD().is_bound()) field_L3__NSD = other_value.L3__NSD();
  else field_L3__NSD.clean_up();
  if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
  else field_tiFlag.clean_up();
}
return *this;
}

boolean MS__parameters::operator==(const MS__parameters& other_value) const
{
return field_imsi__length==other_value.field_imsi__length
  && field_imsi__firstdigit==other_value.field_imsi__firstdigit
  && field_imsi==other_value.field_imsi
  && field_number==other_value.field_number
  && field_SCCP__connId==other_value.field_SCCP__connId
  && field_L3__NSD==other_value.field_L3__NSD
  && field_tiFlag==other_value.field_tiFlag;
}

boolean MS__parameters::is_bound() const
{
return (field_imsi__length.is_bound())
  || (field_imsi__firstdigit.is_bound())
  || (field_imsi.is_bound())
  || (field_number.is_bound())
  || (field_SCCP__connId.is_bound())
  || (field_L3__NSD.is_bound())
  || (field_tiFlag.is_bound());
}
boolean MS__parameters::is_value() const
{
return field_imsi__length.is_value()
  && field_imsi__firstdigit.is_value()
  && field_imsi.is_value()
  && field_number.is_value()
  && field_SCCP__connId.is_value()
  && field_L3__NSD.is_value()
  && field_tiFlag.is_value();
}
void MS__parameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ imsi_length := ");
field_imsi__length.log();
TTCN_Logger::log_event_str(", imsi_firstdigit := ");
field_imsi__firstdigit.log();
TTCN_Logger::log_event_str(", imsi := ");
field_imsi.log();
TTCN_Logger::log_event_str(", number := ");
field_number.log();
TTCN_Logger::log_event_str(", SCCP_connId := ");
field_SCCP__connId.log();
TTCN_Logger::log_event_str(", L3_NSD := ");
field_L3__NSD.log();
TTCN_Logger::log_event_str(", tiFlag := ");
field_tiFlag.log();
TTCN_Logger::log_event_str(" }");
}

void MS__parameters::set_implicit_omit()
{
if (imsi__length().is_bound()) imsi__length().set_implicit_omit();
if (imsi__firstdigit().is_bound()) imsi__firstdigit().set_implicit_omit();
if (imsi().is_bound()) imsi().set_implicit_omit();
if (number().is_bound()) number().set_implicit_omit();
if (SCCP__connId().is_bound()) SCCP__connId().set_implicit_omit();
if (L3__NSD().is_bound()) L3__NSD().set_implicit_omit();
if (tiFlag().is_bound()) tiFlag().set_implicit_omit();
}

void MS__parameters::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_CommonIE_Types.MS_parameters 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) imsi__length().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) imsi__firstdigit().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imsi().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) number().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) SCCP__connId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) L3__NSD().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tiFlag().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(), "imsi_length")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi__length().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imsi_firstdigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi__firstdigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "SCCP_connId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          SCCP__connId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "L3_NSD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          L3__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(), "tiFlag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiFlag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MS_parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MS_parameters");
  }
}

void MS__parameters::encode_text(Text_Buf& text_buf) const
{
field_imsi__length.encode_text(text_buf);
field_imsi__firstdigit.encode_text(text_buf);
field_imsi.encode_text(text_buf);
field_number.encode_text(text_buf);
field_SCCP__connId.encode_text(text_buf);
field_L3__NSD.encode_text(text_buf);
field_tiFlag.encode_text(text_buf);
}

void MS__parameters::decode_text(Text_Buf& text_buf)
{
field_imsi__length.decode_text(text_buf);
field_imsi__firstdigit.decode_text(text_buf);
field_imsi.decode_text(text_buf);
field_number.decode_text(text_buf);
field_SCCP__connId.decode_text(text_buf);
field_L3__NSD.decode_text(text_buf);
field_tiFlag.decode_text(text_buf);
}

void MS__parameters::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 MS__parameters::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 MS__parameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_imsi__length.RAW_decode(INTEGER_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_imsi__firstdigit.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_imsi.RAW_decode(OCTETSTRING_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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_number.RAW_decode(OCTETSTRING_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, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_SCCP__connId.RAW_decode(INTEGER_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, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_L3__NSD.RAW_decode(INTEGER_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tiFlag.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MS__parameters::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, INTEGER_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, INTEGER_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, INTEGER_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  encoded_length += field_imsi__length.RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_imsi__firstdigit.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_imsi.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_number.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_SCCP__connId.RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_L3__NSD.RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tiFlag.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct MS__parameters_template::single_value_struct {
INTEGER_template field_imsi__length;
BITSTRING_template field_imsi__firstdigit;
OCTETSTRING_template field_imsi;
OCTETSTRING_template field_number;
INTEGER_template field_SCCP__connId;
INTEGER_template field_L3__NSD;
BITSTRING_template field_tiFlag;
};

void MS__parameters_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_imsi__length = ANY_VALUE;
single_value->field_imsi__firstdigit = ANY_VALUE;
single_value->field_imsi = ANY_VALUE;
single_value->field_number = ANY_VALUE;
single_value->field_SCCP__connId = ANY_VALUE;
single_value->field_L3__NSD = ANY_VALUE;
single_value->field_tiFlag = ANY_VALUE;
}
}
}

void MS__parameters_template::copy_value(const MS__parameters& other_value)
{
single_value = new single_value_struct;
if (other_value.imsi__length().is_bound()) {
  single_value->field_imsi__length = other_value.imsi__length();
} else {
  single_value->field_imsi__length.clean_up();
}
if (other_value.imsi__firstdigit().is_bound()) {
  single_value->field_imsi__firstdigit = other_value.imsi__firstdigit();
} else {
  single_value->field_imsi__firstdigit.clean_up();
}
if (other_value.imsi().is_bound()) {
  single_value->field_imsi = other_value.imsi();
} else {
  single_value->field_imsi.clean_up();
}
if (other_value.number().is_bound()) {
  single_value->field_number = other_value.number();
} else {
  single_value->field_number.clean_up();
}
if (other_value.SCCP__connId().is_bound()) {
  single_value->field_SCCP__connId = other_value.SCCP__connId();
} else {
  single_value->field_SCCP__connId.clean_up();
}
if (other_value.L3__NSD().is_bound()) {
  single_value->field_L3__NSD = other_value.L3__NSD();
} else {
  single_value->field_L3__NSD.clean_up();
}
if (other_value.tiFlag().is_bound()) {
  single_value->field_tiFlag = other_value.tiFlag();
} else {
  single_value->field_tiFlag.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MS__parameters_template::copy_template(const MS__parameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.imsi__length().get_selection()) {
single_value->field_imsi__length = other_value.imsi__length();
} else {
single_value->field_imsi__length.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imsi__firstdigit().get_selection()) {
single_value->field_imsi__firstdigit = other_value.imsi__firstdigit();
} else {
single_value->field_imsi__firstdigit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imsi().get_selection()) {
single_value->field_imsi = other_value.imsi();
} else {
single_value->field_imsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.number().get_selection()) {
single_value->field_number = other_value.number();
} else {
single_value->field_number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.SCCP__connId().get_selection()) {
single_value->field_SCCP__connId = other_value.SCCP__connId();
} else {
single_value->field_SCCP__connId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.L3__NSD().get_selection()) {
single_value->field_L3__NSD = other_value.L3__NSD();
} else {
single_value->field_L3__NSD.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiFlag().get_selection()) {
single_value->field_tiFlag = other_value.tiFlag();
} else {
single_value->field_tiFlag.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 MS__parameters_template[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 MS__parameters_template(*other_value.implication_.precondition);
implication_.implied_template = new MS__parameters_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_CommonIE_Types.MS_parameters.");
break;
}
set_selection(other_value);
}

MS__parameters_template::MS__parameters_template()
{
}

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

MS__parameters_template::MS__parameters_template(const MS__parameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MS__parameters_template::match(const MS__parameters& 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.imsi__length().is_bound()) return FALSE;
if(!single_value->field_imsi__length.match(other_value.imsi__length(), legacy))return FALSE;
if(!other_value.imsi__firstdigit().is_bound()) return FALSE;
if(!single_value->field_imsi__firstdigit.match(other_value.imsi__firstdigit(), legacy))return FALSE;
if(!other_value.imsi().is_bound()) return FALSE;
if(!single_value->field_imsi.match(other_value.imsi(), legacy))return FALSE;
if(!other_value.number().is_bound()) return FALSE;
if(!single_value->field_number.match(other_value.number(), legacy))return FALSE;
if(!other_value.SCCP__connId().is_bound()) return FALSE;
if(!single_value->field_SCCP__connId.match(other_value.SCCP__connId(), legacy))return FALSE;
if(!other_value.L3__NSD().is_bound()) return FALSE;
if(!single_value->field_L3__NSD.match(other_value.L3__NSD(), legacy))return FALSE;
if(!other_value.tiFlag().is_bound()) return FALSE;
if(!single_value->field_tiFlag.match(other_value.tiFlag(), 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_CommonIE_Types.MS_parameters.");
}
return FALSE;
}

boolean MS__parameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_imsi__length.is_bound()
 || single_value->field_imsi__firstdigit.is_bound()
 || single_value->field_imsi.is_bound()
 || single_value->field_number.is_bound()
 || single_value->field_SCCP__connId.is_bound()
 || single_value->field_L3__NSD.is_bound()
 || single_value->field_tiFlag.is_bound();
}

boolean MS__parameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_imsi__length.is_value()
 && single_value->field_imsi__firstdigit.is_value()
 && single_value->field_imsi.is_value()
 && single_value->field_number.is_value()
 && single_value->field_SCCP__connId.is_value()
 && single_value->field_L3__NSD.is_value()
 && single_value->field_tiFlag.is_value();
}

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

MS__parameters MS__parameters_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_CommonIE_Types.MS_parameters.");
MS__parameters ret_val;
if (single_value->field_imsi__length.is_bound()) {
ret_val.imsi__length() = single_value->field_imsi__length.valueof();
}
if (single_value->field_imsi__firstdigit.is_bound()) {
ret_val.imsi__firstdigit() = single_value->field_imsi__firstdigit.valueof();
}
if (single_value->field_imsi.is_bound()) {
ret_val.imsi() = single_value->field_imsi.valueof();
}
if (single_value->field_number.is_bound()) {
ret_val.number() = single_value->field_number.valueof();
}
if (single_value->field_SCCP__connId.is_bound()) {
ret_val.SCCP__connId() = single_value->field_SCCP__connId.valueof();
}
if (single_value->field_L3__NSD.is_bound()) {
ret_val.L3__NSD() = single_value->field_L3__NSD.valueof();
}
if (single_value->field_tiFlag.is_bound()) {
ret_val.tiFlag() = single_value->field_tiFlag.valueof();
}
return ret_val;
}

void MS__parameters_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_CommonIE_Types.MS_parameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MS__parameters_template[list_length];
}

MS__parameters_template& MS__parameters_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_CommonIE_Types.MS_parameters.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MS_parameters.");
return value_list.list_value[list_index];
}

INTEGER_template& MS__parameters_template::imsi__length()
{
set_specific();
return single_value->field_imsi__length;
}

const INTEGER_template& MS__parameters_template::imsi__length() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imsi_length of a non-specific template of type @MobileL3_CommonIE_Types.MS_parameters.");
return single_value->field_imsi__length;
}

BITSTRING_template& MS__parameters_template::imsi__firstdigit()
{
set_specific();
return single_value->field_imsi__firstdigit;
}

const BITSTRING_template& MS__parameters_template::imsi__firstdigit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imsi_firstdigit of a non-specific template of type @MobileL3_CommonIE_Types.MS_parameters.");
return single_value->field_imsi__firstdigit;
}

OCTETSTRING_template& MS__parameters_template::imsi()
{
set_specific();
return single_value->field_imsi;
}

const OCTETSTRING_template& MS__parameters_template::imsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imsi of a non-specific template of type @MobileL3_CommonIE_Types.MS_parameters.");
return single_value->field_imsi;
}

OCTETSTRING_template& MS__parameters_template::number()
{
set_specific();
return single_value->field_number;
}

const OCTETSTRING_template& MS__parameters_template::number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number of a non-specific template of type @MobileL3_CommonIE_Types.MS_parameters.");
return single_value->field_number;
}

INTEGER_template& MS__parameters_template::SCCP__connId()
{
set_specific();
return single_value->field_SCCP__connId;
}

const INTEGER_template& MS__parameters_template::SCCP__connId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field SCCP_connId of a non-specific template of type @MobileL3_CommonIE_Types.MS_parameters.");
return single_value->field_SCCP__connId;
}

INTEGER_template& MS__parameters_template::L3__NSD()
{
set_specific();
return single_value->field_L3__NSD;
}

const INTEGER_template& MS__parameters_template::L3__NSD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field L3_NSD of a non-specific template of type @MobileL3_CommonIE_Types.MS_parameters.");
return single_value->field_L3__NSD;
}

BITSTRING_template& MS__parameters_template::tiFlag()
{
set_specific();
return single_value->field_tiFlag;
}

const BITSTRING_template& MS__parameters_template::tiFlag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiFlag of a non-specific template of type @MobileL3_CommonIE_Types.MS_parameters.");
return single_value->field_tiFlag;
}

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

void MS__parameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ imsi_length := ");
single_value->field_imsi__length.log();
TTCN_Logger::log_event_str(", imsi_firstdigit := ");
single_value->field_imsi__firstdigit.log();
TTCN_Logger::log_event_str(", imsi := ");
single_value->field_imsi.log();
TTCN_Logger::log_event_str(", number := ");
single_value->field_number.log();
TTCN_Logger::log_event_str(", SCCP_connId := ");
single_value->field_SCCP__connId.log();
TTCN_Logger::log_event_str(", L3_NSD := ");
single_value->field_L3__NSD.log();
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.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 MS__parameters_template::log_match(const MS__parameters& 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_imsi__length.match(match_value.imsi__length(), legacy)){
TTCN_Logger::log_logmatch_info(".imsi_length");
single_value->field_imsi__length.log_match(match_value.imsi__length(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_imsi__firstdigit.match(match_value.imsi__firstdigit(), legacy)){
TTCN_Logger::log_logmatch_info(".imsi_firstdigit");
single_value->field_imsi__firstdigit.log_match(match_value.imsi__firstdigit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_imsi.match(match_value.imsi(), legacy)){
TTCN_Logger::log_logmatch_info(".imsi");
single_value->field_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_number.match(match_value.number(), legacy)){
TTCN_Logger::log_logmatch_info(".number");
single_value->field_number.log_match(match_value.number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_SCCP__connId.match(match_value.SCCP__connId(), legacy)){
TTCN_Logger::log_logmatch_info(".SCCP_connId");
single_value->field_SCCP__connId.log_match(match_value.SCCP__connId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_L3__NSD.match(match_value.L3__NSD(), legacy)){
TTCN_Logger::log_logmatch_info(".L3_NSD");
single_value->field_L3__NSD.log_match(match_value.L3__NSD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiFlag.match(match_value.tiFlag(), legacy)){
TTCN_Logger::log_logmatch_info(".tiFlag");
single_value->field_tiFlag.log_match(match_value.tiFlag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ imsi_length := ");
single_value->field_imsi__length.log_match(match_value.imsi__length(), legacy);
TTCN_Logger::log_event_str(", imsi_firstdigit := ");
single_value->field_imsi__firstdigit.log_match(match_value.imsi__firstdigit(), legacy);
TTCN_Logger::log_event_str(", imsi := ");
single_value->field_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::log_event_str(", number := ");
single_value->field_number.log_match(match_value.number(), legacy);
TTCN_Logger::log_event_str(", SCCP_connId := ");
single_value->field_SCCP__connId.log_match(match_value.SCCP__connId(), legacy);
TTCN_Logger::log_event_str(", L3_NSD := ");
single_value->field_L3__NSD.log_match(match_value.L3__NSD(), legacy);
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.log_match(match_value.tiFlag(), 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 MS__parameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (imsi__length().is_bound()) imsi__length().set_implicit_omit();
if (imsi__firstdigit().is_bound()) imsi__firstdigit().set_implicit_omit();
if (imsi().is_bound()) imsi().set_implicit_omit();
if (number().is_bound()) number().set_implicit_omit();
if (SCCP__connId().is_bound()) SCCP__connId().set_implicit_omit();
if (L3__NSD().is_bound()) L3__NSD().set_implicit_omit();
if (tiFlag().is_bound()) tiFlag().set_implicit_omit();
}

void MS__parameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_imsi__length.encode_text(text_buf);
single_value->field_imsi__firstdigit.encode_text(text_buf);
single_value->field_imsi.encode_text(text_buf);
single_value->field_number.encode_text(text_buf);
single_value->field_SCCP__connId.encode_text(text_buf);
single_value->field_L3__NSD.encode_text(text_buf);
single_value->field_tiFlag.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_CommonIE_Types.MS_parameters.");
}
}

void MS__parameters_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_imsi__length.decode_text(text_buf);
single_value->field_imsi__firstdigit.decode_text(text_buf);
single_value->field_imsi.decode_text(text_buf);
single_value->field_number.decode_text(text_buf);
single_value->field_SCCP__connId.decode_text(text_buf);
single_value->field_L3__NSD.decode_text(text_buf);
single_value->field_tiFlag.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 MS__parameters_template[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_CommonIE_Types.MS_parameters.");
}
}

void MS__parameters_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: {
    MS__parameters_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_CommonIE_Types.MS_parameters 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) imsi__length().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) imsi__firstdigit().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imsi().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) number().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) SCCP__connId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) L3__NSD().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tiFlag().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(), "imsi_length")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi__length().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imsi_firstdigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi__firstdigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "SCCP_connId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          SCCP__connId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "L3_NSD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          L3__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(), "tiFlag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiFlag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MS_parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MS__parameters_template* precondition = new MS__parameters_template;
    precondition->set_param(*param.get_elem(0));
    MS__parameters_template* implied_template = new MS__parameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MS__parameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MS_parameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void MS__parameters_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_imsi__length.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MS_parameters");
single_value->field_imsi__firstdigit.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MS_parameters");
single_value->field_imsi.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MS_parameters");
single_value->field_number.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MS_parameters");
single_value->field_SCCP__connId.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MS_parameters");
single_value->field_L3__NSD.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MS_parameters");
single_value->field_tiFlag.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MS_parameters");
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_CommonIE_Types.MS_parameters");
}

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

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

Type1__V::Type1__V()
{
}

Type1__V::Type1__V(const BITSTRING& par_dummy,
    const BITSTRING& par_valuePart)
  :   field_dummy(par_dummy),
  field_valuePart(par_valuePart)
{
}

Type1__V::Type1__V(const Type1__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.Type1_V.");
if (other_value.dummy().is_bound()) field_dummy = other_value.dummy();
else field_dummy.clean_up();
if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void Type1__V::clean_up()
{
field_dummy.clean_up();
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* Type1__V::get_descriptor() const { return &Type1__V_descr_; }
Type1__V& Type1__V::operator=(const Type1__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.Type1_V.");
  if (other_value.dummy().is_bound()) field_dummy = other_value.dummy();
  else field_dummy.clean_up();
  if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

boolean Type1__V::operator==(const Type1__V& other_value) const
{
return field_dummy==other_value.field_dummy
  && field_valuePart==other_value.field_valuePart;
}

boolean Type1__V::is_bound() const
{
return (field_dummy.is_bound())
  || (field_valuePart.is_bound());
}
boolean Type1__V::is_value() const
{
return field_dummy.is_value()
  && field_valuePart.is_value();
}
void Type1__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dummy := ");
field_dummy.log();
TTCN_Logger::log_event_str(", valuePart := ");
field_valuePart.log();
TTCN_Logger::log_event_str(" }");
}

void Type1__V::set_implicit_omit()
{
if (dummy().is_bound()) dummy().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type1__V::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_CommonIE_Types.Type1_V 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) dummy().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) valuePart().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(), "dummy")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dummy().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type1_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.Type1_V");
  }
}

void Type1__V::encode_text(Text_Buf& text_buf) const
{
field_dummy.encode_text(text_buf);
field_valuePart.encode_text(text_buf);
}

void Type1__V::decode_text(Text_Buf& text_buf)
{
field_dummy.decode_text(text_buf);
field_valuePart.decode_text(text_buf);
}

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

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

struct Type1__V_template::single_value_struct {
BITSTRING_template field_dummy;
BITSTRING_template field_valuePart;
};

void Type1__V_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_dummy = ANY_VALUE;
single_value->field_valuePart = ANY_VALUE;
}
}
}

void Type1__V_template::copy_value(const Type1__V& other_value)
{
single_value = new single_value_struct;
if (other_value.dummy().is_bound()) {
  single_value->field_dummy = other_value.dummy();
} else {
  single_value->field_dummy.clean_up();
}
if (other_value.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Type1__V_template::copy_template(const Type1__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dummy().get_selection()) {
single_value->field_dummy = other_value.dummy();
} else {
single_value->field_dummy.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.valuePart().get_selection()) {
single_value->field_valuePart = other_value.valuePart();
} else {
single_value->field_valuePart.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 Type1__V_template[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 Type1__V_template(*other_value.implication_.precondition);
implication_.implied_template = new Type1__V_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_CommonIE_Types.Type1_V.");
break;
}
set_selection(other_value);
}

Type1__V_template::Type1__V_template()
{
}

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

Type1__V_template::Type1__V_template(const Type1__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Type1__V_template::match(const Type1__V& 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.dummy().is_bound()) return FALSE;
if(!single_value->field_dummy.match(other_value.dummy(), legacy))return FALSE;
if(!other_value.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), 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_CommonIE_Types.Type1_V.");
}
return FALSE;
}

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

boolean Type1__V_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dummy.is_value()
 && single_value->field_valuePart.is_value();
}

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

Type1__V Type1__V_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_CommonIE_Types.Type1_V.");
Type1__V ret_val;
if (single_value->field_dummy.is_bound()) {
ret_val.dummy() = single_value->field_dummy.valueof();
}
if (single_value->field_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

void Type1__V_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_CommonIE_Types.Type1_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Type1__V_template[list_length];
}

Type1__V_template& Type1__V_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_CommonIE_Types.Type1_V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.Type1_V.");
return value_list.list_value[list_index];
}

BITSTRING_template& Type1__V_template::dummy()
{
set_specific();
return single_value->field_dummy;
}

const BITSTRING_template& Type1__V_template::dummy() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dummy of a non-specific template of type @MobileL3_CommonIE_Types.Type1_V.");
return single_value->field_dummy;
}

BITSTRING_template& Type1__V_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const BITSTRING_template& Type1__V_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_CommonIE_Types.Type1_V.");
return single_value->field_valuePart;
}

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

void Type1__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dummy := ");
single_value->field_dummy.log();
TTCN_Logger::log_event_str(", valuePart := ");
single_value->field_valuePart.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 Type1__V_template::log_match(const Type1__V& 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_dummy.match(match_value.dummy(), legacy)){
TTCN_Logger::log_logmatch_info(".dummy");
single_value->field_dummy.log_match(match_value.dummy(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), 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("{ dummy := ");
single_value->field_dummy.log_match(match_value.dummy(), legacy);
TTCN_Logger::log_event_str(", valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), 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 Type1__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dummy().is_bound()) dummy().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type1__V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dummy.encode_text(text_buf);
single_value->field_valuePart.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_CommonIE_Types.Type1_V.");
}
}

void Type1__V_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_dummy.decode_text(text_buf);
single_value->field_valuePart.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 Type1__V_template[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_CommonIE_Types.Type1_V.");
}
}

void Type1__V_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: {
    Type1__V_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_CommonIE_Types.Type1_V 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) dummy().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) valuePart().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(), "dummy")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dummy().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type1_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Type1__V_template* precondition = new Type1__V_template;
    precondition->set_param(*param.get_elem(0));
    Type1__V_template* implied_template = new Type1__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Type1__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.Type1_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void Type1__V_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_dummy.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type1_V");
single_value->field_valuePart.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type1_V");
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_CommonIE_Types.Type1_V");
}

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

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

Type1__TV::Type1__TV()
{
}

Type1__TV::Type1__TV(const BITSTRING& par_valuePart,
    const BITSTRING& par_elementIdentifier)
  :   field_valuePart(par_valuePart),
  field_elementIdentifier(par_elementIdentifier)
{
}

Type1__TV::Type1__TV(const Type1__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.Type1_TV.");
if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void Type1__TV::clean_up()
{
field_valuePart.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* Type1__TV::get_descriptor() const { return &Type1__TV_descr_; }
Type1__TV& Type1__TV::operator=(const Type1__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.Type1_TV.");
  if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean Type1__TV::operator==(const Type1__TV& other_value) const
{
return field_valuePart==other_value.field_valuePart
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

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

void Type1__TV::set_implicit_omit()
{
if (valuePart().is_bound()) valuePart().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void Type1__TV::encode_text(Text_Buf& text_buf) const
{
field_valuePart.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void Type1__TV::decode_text(Text_Buf& text_buf)
{
field_valuePart.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

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

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

struct Type1__TV_template::single_value_struct {
BITSTRING_template field_valuePart;
BITSTRING_template field_elementIdentifier;
};

void Type1__TV_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_valuePart = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void Type1__TV_template::copy_value(const Type1__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

Type1__TV_template::Type1__TV_template()
{
}

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

Type1__TV_template::Type1__TV_template(const Type1__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

Type1__TV Type1__TV_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_CommonIE_Types.Type1_TV.");
Type1__TV ret_val;
if (single_value->field_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void Type1__TV_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_CommonIE_Types.Type1_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Type1__TV_template[list_length];
}

Type1__TV_template& Type1__TV_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_CommonIE_Types.Type1_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.Type1_TV.");
return value_list.list_value[list_index];
}

BITSTRING_template& Type1__TV_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const BITSTRING_template& Type1__TV_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_CommonIE_Types.Type1_TV.");
return single_value->field_valuePart;
}

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

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

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

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

void Type1__TV_template::log_match(const Type1__TV& 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_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

void Type1__TV_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_valuePart.decode_text(text_buf);
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Type1__TV_template[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_CommonIE_Types.Type1_TV.");
}
}

void Type1__TV_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: {
    Type1__TV_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_CommonIE_Types.Type1_TV 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) valuePart().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type1_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Type1__TV_template* precondition = new Type1__TV_template;
    precondition->set_param(*param.get_elem(0));
    Type1__TV_template* implied_template = new Type1__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Type1__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.Type1_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void Type1__TV_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_valuePart.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type1_TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type1_TV");
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_CommonIE_Types.Type1_TV");
}

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

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

Type2::Type2()
{
}

Type2::Type2(const OCTETSTRING& par_elementIdentifier)
  :   field_elementIdentifier(par_elementIdentifier)
{
}

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

void Type2::clean_up()
{
field_elementIdentifier.clean_up();
}

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

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

boolean Type2::is_bound() const
{
return (field_elementIdentifier.is_bound());
}
boolean Type2::is_value() const
{
return field_elementIdentifier.is_value();
}
void Type2::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(" }");
}

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

void Type2::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_CommonIE_Types.Type2 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) elementIdentifier().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type2: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.Type2");
  }
}

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

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

void Type2::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 Type2::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 Type2::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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct Type2_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
};

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

void Type2_template::copy_value(const Type2& 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();
}
set_selection(SPECIFIC_VALUE);
}

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

Type2_template::Type2_template()
{
}

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

Type2_template::Type2_template(const Type2& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean Type2_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();
}

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

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

Type2 Type2_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_CommonIE_Types.Type2.");
Type2 ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void Type2_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_CommonIE_Types.Type2.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Type2_template[list_length];
}

Type2_template& Type2_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_CommonIE_Types.Type2.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.Type2.");
return value_list.list_value[list_index];
}

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

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

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

void Type2_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(" }");
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 Type2_template::log_match(const Type2& 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);
}
}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(" }");
} 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 Type2_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void Type2_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);
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_CommonIE_Types.Type2.");
}
}

void Type2_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);
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 Type2_template[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_CommonIE_Types.Type2.");
}
}

void Type2_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: {
    Type2_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_CommonIE_Types.Type2 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) elementIdentifier().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type2: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Type2_template* precondition = new Type2_template;
    precondition->set_param(*param.get_elem(0));
    Type2_template* implied_template = new Type2_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Type2_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.Type2");
  }
  is_ifpresent = param.get_ifpresent();
}

void Type2_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_CommonIE_Types.Type2");
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_CommonIE_Types.Type2");
}

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

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

Type3__V::Type3__V()
{
}

Type3__V::Type3__V(const OCTETSTRING& par_valuePart)
  :   field_valuePart(par_valuePart)
{
}

Type3__V::Type3__V(const Type3__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.Type3_V.");
if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void Type3__V::clean_up()
{
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* Type3__V::get_descriptor() const { return &Type3__V_descr_; }
Type3__V& Type3__V::operator=(const Type3__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.Type3_V.");
  if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

boolean Type3__V::operator==(const Type3__V& other_value) const
{
return field_valuePart==other_value.field_valuePart;
}

boolean Type3__V::is_bound() const
{
return (field_valuePart.is_bound());
}
boolean Type3__V::is_value() const
{
return field_valuePart.is_value();
}
void Type3__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valuePart := ");
field_valuePart.log();
TTCN_Logger::log_event_str(" }");
}

void Type3__V::set_implicit_omit()
{
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type3__V::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_CommonIE_Types.Type3_V 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type3_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.Type3_V");
  }
}

void Type3__V::encode_text(Text_Buf& text_buf) const
{
field_valuePart.encode_text(text_buf);
}

void Type3__V::decode_text(Text_Buf& text_buf)
{
field_valuePart.decode_text(text_buf);
}

void Type3__V::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 Type3__V::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 Type3__V::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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_valuePart.RAW_decode(General__Types::OCTN_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 Type3__V::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::OCTN_descr_.raw);
  encoded_length += field_valuePart.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct Type3__V_template::single_value_struct {
OCTETSTRING_template field_valuePart;
};

void Type3__V_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_valuePart = ANY_VALUE;
}
}
}

void Type3__V_template::copy_value(const Type3__V& other_value)
{
single_value = new single_value_struct;
if (other_value.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Type3__V_template::copy_template(const Type3__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valuePart().get_selection()) {
single_value->field_valuePart = other_value.valuePart();
} else {
single_value->field_valuePart.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 Type3__V_template[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 Type3__V_template(*other_value.implication_.precondition);
implication_.implied_template = new Type3__V_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_CommonIE_Types.Type3_V.");
break;
}
set_selection(other_value);
}

Type3__V_template::Type3__V_template()
{
}

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

Type3__V_template::Type3__V_template(const Type3__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Type3__V_template::match(const Type3__V& 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.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), 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_CommonIE_Types.Type3_V.");
}
return FALSE;
}

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

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

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

Type3__V Type3__V_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_CommonIE_Types.Type3_V.");
Type3__V ret_val;
if (single_value->field_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

void Type3__V_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_CommonIE_Types.Type3_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Type3__V_template[list_length];
}

Type3__V_template& Type3__V_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_CommonIE_Types.Type3_V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.Type3_V.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Type3__V_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const OCTETSTRING_template& Type3__V_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_CommonIE_Types.Type3_V.");
return single_value->field_valuePart;
}

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

void Type3__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valuePart := ");
single_value->field_valuePart.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 Type3__V_template::log_match(const Type3__V& 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_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), 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("{ valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), 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 Type3__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

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

void Type3__V_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_valuePart.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 Type3__V_template[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_CommonIE_Types.Type3_V.");
}
}

void Type3__V_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: {
    Type3__V_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_CommonIE_Types.Type3_V 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type3_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Type3__V_template* precondition = new Type3__V_template;
    precondition->set_param(*param.get_elem(0));
    Type3__V_template* implied_template = new Type3__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Type3__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.Type3_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void Type3__V_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_valuePart.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type3_V");
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_CommonIE_Types.Type3_V");
}

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

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

Type3__TV::Type3__TV()
{
}

Type3__TV::Type3__TV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_valuePart)
  :   field_elementIdentifier(par_elementIdentifier),
  field_valuePart(par_valuePart)
{
}

Type3__TV::Type3__TV(const Type3__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.Type3_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void Type3__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* Type3__TV::get_descriptor() const { return &Type3__TV_descr_; }
Type3__TV& Type3__TV::operator=(const Type3__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.Type3_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

boolean Type3__TV::operator==(const Type3__TV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_valuePart==other_value.field_valuePart;
}

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

void Type3__TV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type3__TV::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_CommonIE_Types.Type3_TV 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type3_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.Type3_TV");
  }
}

void Type3__TV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_valuePart.encode_text(text_buf);
}

void Type3__TV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_valuePart.decode_text(text_buf);
}

void Type3__TV::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 Type3__TV::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 Type3__TV::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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_valuePart.RAW_decode(General__Types::OCTN_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 Type3__TV::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::OCTN_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_valuePart.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct Type3__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_valuePart;
};

void Type3__TV_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_valuePart = ANY_VALUE;
}
}
}

void Type3__TV_template::copy_value(const Type3__TV& 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.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Type3__TV_template::copy_template(const Type3__TV_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.valuePart().get_selection()) {
single_value->field_valuePart = other_value.valuePart();
} else {
single_value->field_valuePart.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 Type3__TV_template[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 Type3__TV_template(*other_value.implication_.precondition);
implication_.implied_template = new Type3__TV_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_CommonIE_Types.Type3_TV.");
break;
}
set_selection(other_value);
}

Type3__TV_template::Type3__TV_template()
{
}

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

Type3__TV_template::Type3__TV_template(const Type3__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Type3__TV_template::match(const Type3__TV& 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.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), 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_CommonIE_Types.Type3_TV.");
}
return FALSE;
}

boolean Type3__TV_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_valuePart.is_bound();
}

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

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

Type3__TV Type3__TV_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_CommonIE_Types.Type3_TV.");
Type3__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

void Type3__TV_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_CommonIE_Types.Type3_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Type3__TV_template[list_length];
}

Type3__TV_template& Type3__TV_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_CommonIE_Types.Type3_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.Type3_TV.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& Type3__TV_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const OCTETSTRING_template& Type3__TV_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_CommonIE_Types.Type3_TV.");
return single_value->field_valuePart;
}

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

void Type3__TV_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(", valuePart := ");
single_value->field_valuePart.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 Type3__TV_template::log_match(const Type3__TV& 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_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), 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(", valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), 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 Type3__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type3__TV_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_valuePart.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_CommonIE_Types.Type3_TV.");
}
}

void Type3__TV_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_valuePart.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 Type3__TV_template[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_CommonIE_Types.Type3_TV.");
}
}

void Type3__TV_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: {
    Type3__TV_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_CommonIE_Types.Type3_TV 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type3_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Type3__TV_template* precondition = new Type3__TV_template;
    precondition->set_param(*param.get_elem(0));
    Type3__TV_template* implied_template = new Type3__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Type3__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.Type3_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void Type3__TV_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_CommonIE_Types.Type3_TV");
single_value->field_valuePart.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type3_TV");
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_CommonIE_Types.Type3_TV");
}

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

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

Type4__LV::Type4__LV()
{
}

Type4__LV::Type4__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_valuePart)
  :   field_lengthIndicator(par_lengthIndicator),
  field_valuePart(par_valuePart)
{
}

Type4__LV::Type4__LV(const Type4__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.Type4_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void Type4__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* Type4__LV::get_descriptor() const { return &Type4__LV_descr_; }
Type4__LV& Type4__LV::operator=(const Type4__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.Type4_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

boolean Type4__LV::operator==(const Type4__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_valuePart==other_value.field_valuePart;
}

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

void Type4__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

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

void Type4__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_valuePart.encode_text(text_buf);
}

void Type4__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_valuePart.decode_text(text_buf);
}

void Type4__LV::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 Type4__LV::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 Type4__LV::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, Type4__LV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Type4__LV_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(Type4__LV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_valuePart.RAW_decode(General__Types::OCTN_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct Type4__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valuePart;
};

void Type4__LV_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_valuePart = ANY_VALUE;
}
}
}

void Type4__LV_template::copy_value(const Type4__LV& 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.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Type4__LV_template::copy_template(const Type4__LV_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.valuePart().get_selection()) {
single_value->field_valuePart = other_value.valuePart();
} else {
single_value->field_valuePart.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 Type4__LV_template[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 Type4__LV_template(*other_value.implication_.precondition);
implication_.implied_template = new Type4__LV_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_CommonIE_Types.Type4_LV.");
break;
}
set_selection(other_value);
}

Type4__LV_template::Type4__LV_template()
{
}

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

Type4__LV_template::Type4__LV_template(const Type4__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Type4__LV_template::match(const Type4__LV& 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.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), 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_CommonIE_Types.Type4_LV.");
}
return FALSE;
}

boolean Type4__LV_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_valuePart.is_bound();
}

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

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

Type4__LV Type4__LV_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_CommonIE_Types.Type4_LV.");
Type4__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

void Type4__LV_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_CommonIE_Types.Type4_LV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Type4__LV_template[list_length];
}

Type4__LV_template& Type4__LV_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_CommonIE_Types.Type4_LV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.Type4_LV.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& Type4__LV_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const OCTETSTRING_template& Type4__LV_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_CommonIE_Types.Type4_LV.");
return single_value->field_valuePart;
}

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

void Type4__LV_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(", valuePart := ");
single_value->field_valuePart.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 Type4__LV_template::log_match(const Type4__LV& 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_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), 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(", valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), 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 Type4__LV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type4__LV_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_valuePart.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_CommonIE_Types.Type4_LV.");
}
}

void Type4__LV_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_valuePart.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 Type4__LV_template[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_CommonIE_Types.Type4_LV.");
}
}

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

void Type4__LV_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_CommonIE_Types.Type4_LV");
single_value->field_valuePart.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type4_LV");
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_CommonIE_Types.Type4_LV");
}

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

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

Type4__TLV::Type4__TLV()
{
}

Type4__TLV::Type4__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_valuePart)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valuePart(par_valuePart)
{
}

Type4__TLV::Type4__TLV(const Type4__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.Type4_TLV.");
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.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void Type4__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* Type4__TLV::get_descriptor() const { return &Type4__TLV_descr_; }
Type4__TLV& Type4__TLV::operator=(const Type4__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.Type4_TLV.");
  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.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

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

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

void Type4__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type4__TLV::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_CommonIE_Types.Type4_TLV 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type4_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.Type4_TLV");
  }
}

void Type4__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_valuePart.encode_text(text_buf);
}

void Type4__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valuePart.decode_text(text_buf);
}

void Type4__TLV::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 Type4__TLV::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 Type4__TLV::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, Type4__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Type4__TLV_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(Type4__TLV_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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_valuePart.RAW_decode(General__Types::OCTN_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 Type4__TLV::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, Type4__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCTN_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 = &Type4__TLV_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_valuePart.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct Type4__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valuePart;
};

void Type4__TLV_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_valuePart = ANY_VALUE;
}
}
}

void Type4__TLV_template::copy_value(const Type4__TLV& 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.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Type4__TLV_template::copy_template(const Type4__TLV_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.valuePart().get_selection()) {
single_value->field_valuePart = other_value.valuePart();
} else {
single_value->field_valuePart.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 Type4__TLV_template[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 Type4__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new Type4__TLV_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_CommonIE_Types.Type4_TLV.");
break;
}
set_selection(other_value);
}

Type4__TLV_template::Type4__TLV_template()
{
}

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

Type4__TLV_template::Type4__TLV_template(const Type4__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Type4__TLV_template::match(const Type4__TLV& 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.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), 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_CommonIE_Types.Type4_TLV.");
}
return FALSE;
}

boolean Type4__TLV_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_valuePart.is_bound();
}

boolean Type4__TLV_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_valuePart.is_value();
}

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

Type4__TLV Type4__TLV_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_CommonIE_Types.Type4_TLV.");
Type4__TLV 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_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

void Type4__TLV_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_CommonIE_Types.Type4_TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Type4__TLV_template[list_length];
}

Type4__TLV_template& Type4__TLV_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_CommonIE_Types.Type4_TLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.Type4_TLV.");
return value_list.list_value[list_index];
}

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

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

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

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

OCTETSTRING_template& Type4__TLV_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const OCTETSTRING_template& Type4__TLV_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_CommonIE_Types.Type4_TLV.");
return single_value->field_valuePart;
}

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

void Type4__TLV_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(", valuePart := ");
single_value->field_valuePart.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 Type4__TLV_template::log_match(const Type4__TLV& 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_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), 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(", valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), 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 Type4__TLV_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 (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Type4__TLV_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_valuePart.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_CommonIE_Types.Type4_TLV.");
}
}

void Type4__TLV_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_valuePart.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 Type4__TLV_template[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_CommonIE_Types.Type4_TLV.");
}
}

void Type4__TLV_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: {
    Type4__TLV_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_CommonIE_Types.Type4_TLV 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.Type4_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Type4__TLV_template* precondition = new Type4__TLV_template;
    precondition->set_param(*param.get_elem(0));
    Type4__TLV_template* implied_template = new Type4__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Type4__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.Type4_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void Type4__TLV_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_CommonIE_Types.Type4_TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type4_TLV");
single_value->field_valuePart.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.Type4_TLV");
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_CommonIE_Types.Type4_TLV");
}

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

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

ML3__NotifySS__Arg::ML3__NotifySS__Arg()
{
}

ML3__NotifySS__Arg::ML3__NotifySS__Arg(const OCTETSTRING& par_sequenceTag,
    const OCTETSTRING& par_sequenceLength,
    const OCTETSTRING& par_ssCodeTag,
    const OCTETSTRING& par_ssCodeLength,
    const OCTETSTRING& par_ssCodeValue,
    const OCTETSTRING& par_ssIndicatorTag,
    const OCTETSTRING& par_ssIndicatorLength,
    const OCTETSTRING& par_ssIndicatorValue)
  :   field_sequenceTag(par_sequenceTag),
  field_sequenceLength(par_sequenceLength),
  field_ssCodeTag(par_ssCodeTag),
  field_ssCodeLength(par_ssCodeLength),
  field_ssCodeValue(par_ssCodeValue),
  field_ssIndicatorTag(par_ssIndicatorTag),
  field_ssIndicatorLength(par_ssIndicatorLength),
  field_ssIndicatorValue(par_ssIndicatorValue)
{
}

ML3__NotifySS__Arg::ML3__NotifySS__Arg(const ML3__NotifySS__Arg& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
if (other_value.sequenceTag().is_bound()) field_sequenceTag = other_value.sequenceTag();
else field_sequenceTag.clean_up();
if (other_value.sequenceLength().is_bound()) field_sequenceLength = other_value.sequenceLength();
else field_sequenceLength.clean_up();
if (other_value.ssCodeTag().is_bound()) field_ssCodeTag = other_value.ssCodeTag();
else field_ssCodeTag.clean_up();
if (other_value.ssCodeLength().is_bound()) field_ssCodeLength = other_value.ssCodeLength();
else field_ssCodeLength.clean_up();
if (other_value.ssCodeValue().is_bound()) field_ssCodeValue = other_value.ssCodeValue();
else field_ssCodeValue.clean_up();
if (other_value.ssIndicatorTag().is_bound()) field_ssIndicatorTag = other_value.ssIndicatorTag();
else field_ssIndicatorTag.clean_up();
if (other_value.ssIndicatorLength().is_bound()) field_ssIndicatorLength = other_value.ssIndicatorLength();
else field_ssIndicatorLength.clean_up();
if (other_value.ssIndicatorValue().is_bound()) field_ssIndicatorValue = other_value.ssIndicatorValue();
else field_ssIndicatorValue.clean_up();
}

void ML3__NotifySS__Arg::clean_up()
{
field_sequenceTag.clean_up();
field_sequenceLength.clean_up();
field_ssCodeTag.clean_up();
field_ssCodeLength.clean_up();
field_ssCodeValue.clean_up();
field_ssIndicatorTag.clean_up();
field_ssIndicatorLength.clean_up();
field_ssIndicatorValue.clean_up();
}

const TTCN_Typedescriptor_t* ML3__NotifySS__Arg::get_descriptor() const { return &ML3__NotifySS__Arg_descr_; }
ML3__NotifySS__Arg& ML3__NotifySS__Arg::operator=(const ML3__NotifySS__Arg& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
  if (other_value.sequenceTag().is_bound()) field_sequenceTag = other_value.sequenceTag();
  else field_sequenceTag.clean_up();
  if (other_value.sequenceLength().is_bound()) field_sequenceLength = other_value.sequenceLength();
  else field_sequenceLength.clean_up();
  if (other_value.ssCodeTag().is_bound()) field_ssCodeTag = other_value.ssCodeTag();
  else field_ssCodeTag.clean_up();
  if (other_value.ssCodeLength().is_bound()) field_ssCodeLength = other_value.ssCodeLength();
  else field_ssCodeLength.clean_up();
  if (other_value.ssCodeValue().is_bound()) field_ssCodeValue = other_value.ssCodeValue();
  else field_ssCodeValue.clean_up();
  if (other_value.ssIndicatorTag().is_bound()) field_ssIndicatorTag = other_value.ssIndicatorTag();
  else field_ssIndicatorTag.clean_up();
  if (other_value.ssIndicatorLength().is_bound()) field_ssIndicatorLength = other_value.ssIndicatorLength();
  else field_ssIndicatorLength.clean_up();
  if (other_value.ssIndicatorValue().is_bound()) field_ssIndicatorValue = other_value.ssIndicatorValue();
  else field_ssIndicatorValue.clean_up();
}
return *this;
}

boolean ML3__NotifySS__Arg::operator==(const ML3__NotifySS__Arg& other_value) const
{
return field_sequenceTag==other_value.field_sequenceTag
  && field_sequenceLength==other_value.field_sequenceLength
  && field_ssCodeTag==other_value.field_ssCodeTag
  && field_ssCodeLength==other_value.field_ssCodeLength
  && field_ssCodeValue==other_value.field_ssCodeValue
  && field_ssIndicatorTag==other_value.field_ssIndicatorTag
  && field_ssIndicatorLength==other_value.field_ssIndicatorLength
  && field_ssIndicatorValue==other_value.field_ssIndicatorValue;
}

boolean ML3__NotifySS__Arg::is_bound() const
{
return (field_sequenceTag.is_bound())
  || (field_sequenceLength.is_bound())
  || (field_ssCodeTag.is_bound())
  || (field_ssCodeLength.is_bound())
  || (field_ssCodeValue.is_bound())
  || (field_ssIndicatorTag.is_bound())
  || (field_ssIndicatorLength.is_bound())
  || (field_ssIndicatorValue.is_bound());
}
boolean ML3__NotifySS__Arg::is_value() const
{
return field_sequenceTag.is_value()
  && field_sequenceLength.is_value()
  && field_ssCodeTag.is_value()
  && field_ssCodeLength.is_value()
  && field_ssCodeValue.is_value()
  && field_ssIndicatorTag.is_value()
  && field_ssIndicatorLength.is_value()
  && field_ssIndicatorValue.is_value();
}
void ML3__NotifySS__Arg::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sequenceTag := ");
field_sequenceTag.log();
TTCN_Logger::log_event_str(", sequenceLength := ");
field_sequenceLength.log();
TTCN_Logger::log_event_str(", ssCodeTag := ");
field_ssCodeTag.log();
TTCN_Logger::log_event_str(", ssCodeLength := ");
field_ssCodeLength.log();
TTCN_Logger::log_event_str(", ssCodeValue := ");
field_ssCodeValue.log();
TTCN_Logger::log_event_str(", ssIndicatorTag := ");
field_ssIndicatorTag.log();
TTCN_Logger::log_event_str(", ssIndicatorLength := ");
field_ssIndicatorLength.log();
TTCN_Logger::log_event_str(", ssIndicatorValue := ");
field_ssIndicatorValue.log();
TTCN_Logger::log_event_str(" }");
}

void ML3__NotifySS__Arg::set_implicit_omit()
{
if (sequenceTag().is_bound()) sequenceTag().set_implicit_omit();
if (sequenceLength().is_bound()) sequenceLength().set_implicit_omit();
if (ssCodeTag().is_bound()) ssCodeTag().set_implicit_omit();
if (ssCodeLength().is_bound()) ssCodeLength().set_implicit_omit();
if (ssCodeValue().is_bound()) ssCodeValue().set_implicit_omit();
if (ssIndicatorTag().is_bound()) ssIndicatorTag().set_implicit_omit();
if (ssIndicatorLength().is_bound()) ssIndicatorLength().set_implicit_omit();
if (ssIndicatorValue().is_bound()) ssIndicatorValue().set_implicit_omit();
}

void ML3__NotifySS__Arg::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_CommonIE_Types.ML3_NotifySS_Arg 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) sequenceTag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sequenceLength().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ssCodeTag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ssCodeLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ssCodeValue().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ssIndicatorTag().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) ssIndicatorLength().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ssIndicatorValue().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(), "sequenceTag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequenceTag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sequenceLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequenceLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssCodeTag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssCodeTag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssCodeLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssCodeLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssCodeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssCodeValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssIndicatorTag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssIndicatorTag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssIndicatorLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssIndicatorLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssIndicatorValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssIndicatorValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
  }
}

void ML3__NotifySS__Arg::encode_text(Text_Buf& text_buf) const
{
field_sequenceTag.encode_text(text_buf);
field_sequenceLength.encode_text(text_buf);
field_ssCodeTag.encode_text(text_buf);
field_ssCodeLength.encode_text(text_buf);
field_ssCodeValue.encode_text(text_buf);
field_ssIndicatorTag.encode_text(text_buf);
field_ssIndicatorLength.encode_text(text_buf);
field_ssIndicatorValue.encode_text(text_buf);
}

void ML3__NotifySS__Arg::decode_text(Text_Buf& text_buf)
{
field_sequenceTag.decode_text(text_buf);
field_sequenceLength.decode_text(text_buf);
field_ssCodeTag.decode_text(text_buf);
field_ssCodeLength.decode_text(text_buf);
field_ssCodeValue.decode_text(text_buf);
field_ssIndicatorTag.decode_text(text_buf);
field_ssIndicatorLength.decode_text(text_buf);
field_ssIndicatorValue.decode_text(text_buf);
}

void ML3__NotifySS__Arg::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 ML3__NotifySS__Arg::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 ML3__NotifySS__Arg::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_sequenceTag.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_sequenceLength.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_ssCodeTag.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_ssCodeLength.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_ssCodeValue.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_ssIndicatorTag.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_ssIndicatorLength.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_ssIndicatorValue.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ML3__NotifySS__Arg::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::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);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::OCT1_descr_.raw);
  encoded_length += field_sequenceTag.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_sequenceLength.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_ssCodeTag.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_ssCodeLength.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_ssCodeValue.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_ssIndicatorTag.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_ssIndicatorLength.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_ssIndicatorValue.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct ML3__NotifySS__Arg_template::single_value_struct {
OCTETSTRING_template field_sequenceTag;
OCTETSTRING_template field_sequenceLength;
OCTETSTRING_template field_ssCodeTag;
OCTETSTRING_template field_ssCodeLength;
OCTETSTRING_template field_ssCodeValue;
OCTETSTRING_template field_ssIndicatorTag;
OCTETSTRING_template field_ssIndicatorLength;
OCTETSTRING_template field_ssIndicatorValue;
};

void ML3__NotifySS__Arg_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_sequenceTag = ANY_VALUE;
single_value->field_sequenceLength = ANY_VALUE;
single_value->field_ssCodeTag = ANY_VALUE;
single_value->field_ssCodeLength = ANY_VALUE;
single_value->field_ssCodeValue = ANY_VALUE;
single_value->field_ssIndicatorTag = ANY_VALUE;
single_value->field_ssIndicatorLength = ANY_VALUE;
single_value->field_ssIndicatorValue = ANY_VALUE;
}
}
}

void ML3__NotifySS__Arg_template::copy_value(const ML3__NotifySS__Arg& other_value)
{
single_value = new single_value_struct;
if (other_value.sequenceTag().is_bound()) {
  single_value->field_sequenceTag = other_value.sequenceTag();
} else {
  single_value->field_sequenceTag.clean_up();
}
if (other_value.sequenceLength().is_bound()) {
  single_value->field_sequenceLength = other_value.sequenceLength();
} else {
  single_value->field_sequenceLength.clean_up();
}
if (other_value.ssCodeTag().is_bound()) {
  single_value->field_ssCodeTag = other_value.ssCodeTag();
} else {
  single_value->field_ssCodeTag.clean_up();
}
if (other_value.ssCodeLength().is_bound()) {
  single_value->field_ssCodeLength = other_value.ssCodeLength();
} else {
  single_value->field_ssCodeLength.clean_up();
}
if (other_value.ssCodeValue().is_bound()) {
  single_value->field_ssCodeValue = other_value.ssCodeValue();
} else {
  single_value->field_ssCodeValue.clean_up();
}
if (other_value.ssIndicatorTag().is_bound()) {
  single_value->field_ssIndicatorTag = other_value.ssIndicatorTag();
} else {
  single_value->field_ssIndicatorTag.clean_up();
}
if (other_value.ssIndicatorLength().is_bound()) {
  single_value->field_ssIndicatorLength = other_value.ssIndicatorLength();
} else {
  single_value->field_ssIndicatorLength.clean_up();
}
if (other_value.ssIndicatorValue().is_bound()) {
  single_value->field_ssIndicatorValue = other_value.ssIndicatorValue();
} else {
  single_value->field_ssIndicatorValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ML3__NotifySS__Arg_template::copy_template(const ML3__NotifySS__Arg_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sequenceTag().get_selection()) {
single_value->field_sequenceTag = other_value.sequenceTag();
} else {
single_value->field_sequenceTag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sequenceLength().get_selection()) {
single_value->field_sequenceLength = other_value.sequenceLength();
} else {
single_value->field_sequenceLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ssCodeTag().get_selection()) {
single_value->field_ssCodeTag = other_value.ssCodeTag();
} else {
single_value->field_ssCodeTag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ssCodeLength().get_selection()) {
single_value->field_ssCodeLength = other_value.ssCodeLength();
} else {
single_value->field_ssCodeLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ssCodeValue().get_selection()) {
single_value->field_ssCodeValue = other_value.ssCodeValue();
} else {
single_value->field_ssCodeValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ssIndicatorTag().get_selection()) {
single_value->field_ssIndicatorTag = other_value.ssIndicatorTag();
} else {
single_value->field_ssIndicatorTag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ssIndicatorLength().get_selection()) {
single_value->field_ssIndicatorLength = other_value.ssIndicatorLength();
} else {
single_value->field_ssIndicatorLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ssIndicatorValue().get_selection()) {
single_value->field_ssIndicatorValue = other_value.ssIndicatorValue();
} else {
single_value->field_ssIndicatorValue.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 ML3__NotifySS__Arg_template[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 ML3__NotifySS__Arg_template(*other_value.implication_.precondition);
implication_.implied_template = new ML3__NotifySS__Arg_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_CommonIE_Types.ML3_NotifySS_Arg.");
break;
}
set_selection(other_value);
}

ML3__NotifySS__Arg_template::ML3__NotifySS__Arg_template()
{
}

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

ML3__NotifySS__Arg_template::ML3__NotifySS__Arg_template(const ML3__NotifySS__Arg& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ML3__NotifySS__Arg_template::match(const ML3__NotifySS__Arg& 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.sequenceTag().is_bound()) return FALSE;
if(!single_value->field_sequenceTag.match(other_value.sequenceTag(), legacy))return FALSE;
if(!other_value.sequenceLength().is_bound()) return FALSE;
if(!single_value->field_sequenceLength.match(other_value.sequenceLength(), legacy))return FALSE;
if(!other_value.ssCodeTag().is_bound()) return FALSE;
if(!single_value->field_ssCodeTag.match(other_value.ssCodeTag(), legacy))return FALSE;
if(!other_value.ssCodeLength().is_bound()) return FALSE;
if(!single_value->field_ssCodeLength.match(other_value.ssCodeLength(), legacy))return FALSE;
if(!other_value.ssCodeValue().is_bound()) return FALSE;
if(!single_value->field_ssCodeValue.match(other_value.ssCodeValue(), legacy))return FALSE;
if(!other_value.ssIndicatorTag().is_bound()) return FALSE;
if(!single_value->field_ssIndicatorTag.match(other_value.ssIndicatorTag(), legacy))return FALSE;
if(!other_value.ssIndicatorLength().is_bound()) return FALSE;
if(!single_value->field_ssIndicatorLength.match(other_value.ssIndicatorLength(), legacy))return FALSE;
if(!other_value.ssIndicatorValue().is_bound()) return FALSE;
if(!single_value->field_ssIndicatorValue.match(other_value.ssIndicatorValue(), 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_CommonIE_Types.ML3_NotifySS_Arg.");
}
return FALSE;
}

boolean ML3__NotifySS__Arg_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_sequenceTag.is_bound()
 || single_value->field_sequenceLength.is_bound()
 || single_value->field_ssCodeTag.is_bound()
 || single_value->field_ssCodeLength.is_bound()
 || single_value->field_ssCodeValue.is_bound()
 || single_value->field_ssIndicatorTag.is_bound()
 || single_value->field_ssIndicatorLength.is_bound()
 || single_value->field_ssIndicatorValue.is_bound();
}

boolean ML3__NotifySS__Arg_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sequenceTag.is_value()
 && single_value->field_sequenceLength.is_value()
 && single_value->field_ssCodeTag.is_value()
 && single_value->field_ssCodeLength.is_value()
 && single_value->field_ssCodeValue.is_value()
 && single_value->field_ssIndicatorTag.is_value()
 && single_value->field_ssIndicatorLength.is_value()
 && single_value->field_ssIndicatorValue.is_value();
}

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

ML3__NotifySS__Arg ML3__NotifySS__Arg_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_CommonIE_Types.ML3_NotifySS_Arg.");
ML3__NotifySS__Arg ret_val;
if (single_value->field_sequenceTag.is_bound()) {
ret_val.sequenceTag() = single_value->field_sequenceTag.valueof();
}
if (single_value->field_sequenceLength.is_bound()) {
ret_val.sequenceLength() = single_value->field_sequenceLength.valueof();
}
if (single_value->field_ssCodeTag.is_bound()) {
ret_val.ssCodeTag() = single_value->field_ssCodeTag.valueof();
}
if (single_value->field_ssCodeLength.is_bound()) {
ret_val.ssCodeLength() = single_value->field_ssCodeLength.valueof();
}
if (single_value->field_ssCodeValue.is_bound()) {
ret_val.ssCodeValue() = single_value->field_ssCodeValue.valueof();
}
if (single_value->field_ssIndicatorTag.is_bound()) {
ret_val.ssIndicatorTag() = single_value->field_ssIndicatorTag.valueof();
}
if (single_value->field_ssIndicatorLength.is_bound()) {
ret_val.ssIndicatorLength() = single_value->field_ssIndicatorLength.valueof();
}
if (single_value->field_ssIndicatorValue.is_bound()) {
ret_val.ssIndicatorValue() = single_value->field_ssIndicatorValue.valueof();
}
return ret_val;
}

void ML3__NotifySS__Arg_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_CommonIE_Types.ML3_NotifySS_Arg.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ML3__NotifySS__Arg_template[list_length];
}

ML3__NotifySS__Arg_template& ML3__NotifySS__Arg_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_CommonIE_Types.ML3_NotifySS_Arg.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::sequenceTag()
{
set_specific();
return single_value->field_sequenceTag;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::sequenceTag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sequenceTag of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_sequenceTag;
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::sequenceLength()
{
set_specific();
return single_value->field_sequenceLength;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::sequenceLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sequenceLength of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_sequenceLength;
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::ssCodeTag()
{
set_specific();
return single_value->field_ssCodeTag;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::ssCodeTag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssCodeTag of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_ssCodeTag;
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::ssCodeLength()
{
set_specific();
return single_value->field_ssCodeLength;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::ssCodeLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssCodeLength of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_ssCodeLength;
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::ssCodeValue()
{
set_specific();
return single_value->field_ssCodeValue;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::ssCodeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssCodeValue of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_ssCodeValue;
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::ssIndicatorTag()
{
set_specific();
return single_value->field_ssIndicatorTag;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::ssIndicatorTag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssIndicatorTag of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_ssIndicatorTag;
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::ssIndicatorLength()
{
set_specific();
return single_value->field_ssIndicatorLength;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::ssIndicatorLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssIndicatorLength of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_ssIndicatorLength;
}

OCTETSTRING_template& ML3__NotifySS__Arg_template::ssIndicatorValue()
{
set_specific();
return single_value->field_ssIndicatorValue;
}

const OCTETSTRING_template& ML3__NotifySS__Arg_template::ssIndicatorValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssIndicatorValue of a non-specific template of type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg.");
return single_value->field_ssIndicatorValue;
}

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

void ML3__NotifySS__Arg_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sequenceTag := ");
single_value->field_sequenceTag.log();
TTCN_Logger::log_event_str(", sequenceLength := ");
single_value->field_sequenceLength.log();
TTCN_Logger::log_event_str(", ssCodeTag := ");
single_value->field_ssCodeTag.log();
TTCN_Logger::log_event_str(", ssCodeLength := ");
single_value->field_ssCodeLength.log();
TTCN_Logger::log_event_str(", ssCodeValue := ");
single_value->field_ssCodeValue.log();
TTCN_Logger::log_event_str(", ssIndicatorTag := ");
single_value->field_ssIndicatorTag.log();
TTCN_Logger::log_event_str(", ssIndicatorLength := ");
single_value->field_ssIndicatorLength.log();
TTCN_Logger::log_event_str(", ssIndicatorValue := ");
single_value->field_ssIndicatorValue.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 ML3__NotifySS__Arg_template::log_match(const ML3__NotifySS__Arg& 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_sequenceTag.match(match_value.sequenceTag(), legacy)){
TTCN_Logger::log_logmatch_info(".sequenceTag");
single_value->field_sequenceTag.log_match(match_value.sequenceTag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sequenceLength.match(match_value.sequenceLength(), legacy)){
TTCN_Logger::log_logmatch_info(".sequenceLength");
single_value->field_sequenceLength.log_match(match_value.sequenceLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ssCodeTag.match(match_value.ssCodeTag(), legacy)){
TTCN_Logger::log_logmatch_info(".ssCodeTag");
single_value->field_ssCodeTag.log_match(match_value.ssCodeTag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ssCodeLength.match(match_value.ssCodeLength(), legacy)){
TTCN_Logger::log_logmatch_info(".ssCodeLength");
single_value->field_ssCodeLength.log_match(match_value.ssCodeLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ssCodeValue.match(match_value.ssCodeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".ssCodeValue");
single_value->field_ssCodeValue.log_match(match_value.ssCodeValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ssIndicatorTag.match(match_value.ssIndicatorTag(), legacy)){
TTCN_Logger::log_logmatch_info(".ssIndicatorTag");
single_value->field_ssIndicatorTag.log_match(match_value.ssIndicatorTag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ssIndicatorLength.match(match_value.ssIndicatorLength(), legacy)){
TTCN_Logger::log_logmatch_info(".ssIndicatorLength");
single_value->field_ssIndicatorLength.log_match(match_value.ssIndicatorLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ssIndicatorValue.match(match_value.ssIndicatorValue(), legacy)){
TTCN_Logger::log_logmatch_info(".ssIndicatorValue");
single_value->field_ssIndicatorValue.log_match(match_value.ssIndicatorValue(), 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("{ sequenceTag := ");
single_value->field_sequenceTag.log_match(match_value.sequenceTag(), legacy);
TTCN_Logger::log_event_str(", sequenceLength := ");
single_value->field_sequenceLength.log_match(match_value.sequenceLength(), legacy);
TTCN_Logger::log_event_str(", ssCodeTag := ");
single_value->field_ssCodeTag.log_match(match_value.ssCodeTag(), legacy);
TTCN_Logger::log_event_str(", ssCodeLength := ");
single_value->field_ssCodeLength.log_match(match_value.ssCodeLength(), legacy);
TTCN_Logger::log_event_str(", ssCodeValue := ");
single_value->field_ssCodeValue.log_match(match_value.ssCodeValue(), legacy);
TTCN_Logger::log_event_str(", ssIndicatorTag := ");
single_value->field_ssIndicatorTag.log_match(match_value.ssIndicatorTag(), legacy);
TTCN_Logger::log_event_str(", ssIndicatorLength := ");
single_value->field_ssIndicatorLength.log_match(match_value.ssIndicatorLength(), legacy);
TTCN_Logger::log_event_str(", ssIndicatorValue := ");
single_value->field_ssIndicatorValue.log_match(match_value.ssIndicatorValue(), 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 ML3__NotifySS__Arg_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (sequenceTag().is_bound()) sequenceTag().set_implicit_omit();
if (sequenceLength().is_bound()) sequenceLength().set_implicit_omit();
if (ssCodeTag().is_bound()) ssCodeTag().set_implicit_omit();
if (ssCodeLength().is_bound()) ssCodeLength().set_implicit_omit();
if (ssCodeValue().is_bound()) ssCodeValue().set_implicit_omit();
if (ssIndicatorTag().is_bound()) ssIndicatorTag().set_implicit_omit();
if (ssIndicatorLength().is_bound()) ssIndicatorLength().set_implicit_omit();
if (ssIndicatorValue().is_bound()) ssIndicatorValue().set_implicit_omit();
}

void ML3__NotifySS__Arg_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_sequenceTag.encode_text(text_buf);
single_value->field_sequenceLength.encode_text(text_buf);
single_value->field_ssCodeTag.encode_text(text_buf);
single_value->field_ssCodeLength.encode_text(text_buf);
single_value->field_ssCodeValue.encode_text(text_buf);
single_value->field_ssIndicatorTag.encode_text(text_buf);
single_value->field_ssIndicatorLength.encode_text(text_buf);
single_value->field_ssIndicatorValue.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_CommonIE_Types.ML3_NotifySS_Arg.");
}
}

void ML3__NotifySS__Arg_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_sequenceTag.decode_text(text_buf);
single_value->field_sequenceLength.decode_text(text_buf);
single_value->field_ssCodeTag.decode_text(text_buf);
single_value->field_ssCodeLength.decode_text(text_buf);
single_value->field_ssCodeValue.decode_text(text_buf);
single_value->field_ssIndicatorTag.decode_text(text_buf);
single_value->field_ssIndicatorLength.decode_text(text_buf);
single_value->field_ssIndicatorValue.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 ML3__NotifySS__Arg_template[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_CommonIE_Types.ML3_NotifySS_Arg.");
}
}

void ML3__NotifySS__Arg_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: {
    ML3__NotifySS__Arg_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_CommonIE_Types.ML3_NotifySS_Arg 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) sequenceTag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sequenceLength().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ssCodeTag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ssCodeLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ssCodeValue().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ssIndicatorTag().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) ssIndicatorLength().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ssIndicatorValue().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(), "sequenceTag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequenceTag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sequenceLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequenceLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssCodeTag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssCodeTag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssCodeLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssCodeLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssCodeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssCodeValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssIndicatorTag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssIndicatorTag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssIndicatorLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssIndicatorLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssIndicatorValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssIndicatorValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.ML3_NotifySS_Arg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ML3__NotifySS__Arg_template* precondition = new ML3__NotifySS__Arg_template;
    precondition->set_param(*param.get_elem(0));
    ML3__NotifySS__Arg_template* implied_template = new ML3__NotifySS__Arg_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ML3__NotifySS__Arg_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
  }
  is_ifpresent = param.get_ifpresent();
}

void ML3__NotifySS__Arg_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_sequenceTag.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
single_value->field_sequenceLength.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
single_value->field_ssCodeTag.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
single_value->field_ssCodeLength.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
single_value->field_ssCodeValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
single_value->field_ssIndicatorTag.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
single_value->field_ssIndicatorLength.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
single_value->field_ssIndicatorValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ML3_NotifySS_Arg");
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_CommonIE_Types.ML3_NotifySS_Arg");
}

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

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

CellIdentity::CellIdentity()
{
}

CellIdentity::CellIdentity(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_cIvalue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_cIvalue(par_cIvalue)
{
}

CellIdentity::CellIdentity(const CellIdentity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.CellIdentity.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.cIvalue().is_bound()) field_cIvalue = other_value.cIvalue();
else field_cIvalue.clean_up();
}

void CellIdentity::clean_up()
{
field_elementIdentifier.clean_up();
field_cIvalue.clean_up();
}

const TTCN_Typedescriptor_t* CellIdentity::get_descriptor() const { return &CellIdentity_descr_; }
CellIdentity& CellIdentity::operator=(const CellIdentity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.CellIdentity.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.cIvalue().is_bound()) field_cIvalue = other_value.cIvalue();
  else field_cIvalue.clean_up();
}
return *this;
}

boolean CellIdentity::operator==(const CellIdentity& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_cIvalue==other_value.field_cIvalue;
}

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

void CellIdentity::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (cIvalue().is_bound()) cIvalue().set_implicit_omit();
}

void CellIdentity::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_CommonIE_Types.CellIdentity 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) cIvalue().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(), "cIvalue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cIvalue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.CellIdentity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.CellIdentity");
  }
}

void CellIdentity::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_cIvalue.encode_text(text_buf);
}

void CellIdentity::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_cIvalue.decode_text(text_buf);
}

void CellIdentity::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 CellIdentity::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 CellIdentity::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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_cIvalue.RAW_decode(General__Types::OCT2_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 CellIdentity::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::OCT2_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cIvalue.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct CellIdentity_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_cIvalue;
};

void CellIdentity_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_cIvalue = ANY_VALUE;
}
}
}

void CellIdentity_template::copy_value(const CellIdentity& 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.cIvalue().is_bound()) {
  single_value->field_cIvalue = other_value.cIvalue();
} else {
  single_value->field_cIvalue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CellIdentity_template::copy_template(const CellIdentity_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.cIvalue().get_selection()) {
single_value->field_cIvalue = other_value.cIvalue();
} else {
single_value->field_cIvalue.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 CellIdentity_template[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 CellIdentity_template(*other_value.implication_.precondition);
implication_.implied_template = new CellIdentity_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_CommonIE_Types.CellIdentity.");
break;
}
set_selection(other_value);
}

CellIdentity_template::CellIdentity_template()
{
}

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

CellIdentity_template::CellIdentity_template(const CellIdentity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CellIdentity_template::match(const CellIdentity& 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.cIvalue().is_bound()) return FALSE;
if(!single_value->field_cIvalue.match(other_value.cIvalue(), 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_CommonIE_Types.CellIdentity.");
}
return FALSE;
}

boolean CellIdentity_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_cIvalue.is_bound();
}

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

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

CellIdentity CellIdentity_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_CommonIE_Types.CellIdentity.");
CellIdentity ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_cIvalue.is_bound()) {
ret_val.cIvalue() = single_value->field_cIvalue.valueof();
}
return ret_val;
}

void CellIdentity_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_CommonIE_Types.CellIdentity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CellIdentity_template[list_length];
}

CellIdentity_template& CellIdentity_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_CommonIE_Types.CellIdentity.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.CellIdentity.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& CellIdentity_template::cIvalue()
{
set_specific();
return single_value->field_cIvalue;
}

const OCTETSTRING_template& CellIdentity_template::cIvalue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cIvalue of a non-specific template of type @MobileL3_CommonIE_Types.CellIdentity.");
return single_value->field_cIvalue;
}

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

void CellIdentity_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(", cIvalue := ");
single_value->field_cIvalue.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 CellIdentity_template::log_match(const CellIdentity& 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_cIvalue.match(match_value.cIvalue(), legacy)){
TTCN_Logger::log_logmatch_info(".cIvalue");
single_value->field_cIvalue.log_match(match_value.cIvalue(), 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(", cIvalue := ");
single_value->field_cIvalue.log_match(match_value.cIvalue(), 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 CellIdentity_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (cIvalue().is_bound()) cIvalue().set_implicit_omit();
}

void CellIdentity_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_cIvalue.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_CommonIE_Types.CellIdentity.");
}
}

void CellIdentity_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_cIvalue.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 CellIdentity_template[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_CommonIE_Types.CellIdentity.");
}
}

void CellIdentity_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: {
    CellIdentity_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_CommonIE_Types.CellIdentity 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) cIvalue().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(), "cIvalue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cIvalue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.CellIdentity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CellIdentity_template* precondition = new CellIdentity_template;
    precondition->set_param(*param.get_elem(0));
    CellIdentity_template* implied_template = new CellIdentity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CellIdentity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.CellIdentity");
  }
  is_ifpresent = param.get_ifpresent();
}

void CellIdentity_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_CommonIE_Types.CellIdentity");
single_value->field_cIvalue.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.CellIdentity");
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_CommonIE_Types.CellIdentity");
}

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

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

CipheringKeySequenceNumberV::CipheringKeySequenceNumberV()
{
}

CipheringKeySequenceNumberV::CipheringKeySequenceNumberV(const BITSTRING& par_keySequence,
    const BITSTRING& par_spare)
  :   field_keySequence(par_keySequence),
  field_spare(par_spare)
{
}

CipheringKeySequenceNumberV::CipheringKeySequenceNumberV(const CipheringKeySequenceNumberV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberV.");
if (other_value.keySequence().is_bound()) field_keySequence = other_value.keySequence();
else field_keySequence.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void CipheringKeySequenceNumberV::clean_up()
{
field_keySequence.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* CipheringKeySequenceNumberV::get_descriptor() const { return &CipheringKeySequenceNumberV_descr_; }
CipheringKeySequenceNumberV& CipheringKeySequenceNumberV::operator=(const CipheringKeySequenceNumberV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberV.");
  if (other_value.keySequence().is_bound()) field_keySequence = other_value.keySequence();
  else field_keySequence.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean CipheringKeySequenceNumberV::operator==(const CipheringKeySequenceNumberV& other_value) const
{
return field_keySequence==other_value.field_keySequence
  && field_spare==other_value.field_spare;
}

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

void CipheringKeySequenceNumberV::set_implicit_omit()
{
if (keySequence().is_bound()) keySequence().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void CipheringKeySequenceNumberV::encode_text(Text_Buf& text_buf) const
{
field_keySequence.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void CipheringKeySequenceNumberV::decode_text(Text_Buf& text_buf)
{
field_keySequence.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

struct CipheringKeySequenceNumberV_template::single_value_struct {
BITSTRING_template field_keySequence;
BITSTRING_template field_spare;
};

void CipheringKeySequenceNumberV_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_keySequence = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void CipheringKeySequenceNumberV_template::copy_value(const CipheringKeySequenceNumberV& other_value)
{
single_value = new single_value_struct;
if (other_value.keySequence().is_bound()) {
  single_value->field_keySequence = other_value.keySequence();
} else {
  single_value->field_keySequence.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 CipheringKeySequenceNumberV_template::copy_template(const CipheringKeySequenceNumberV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.keySequence().get_selection()) {
single_value->field_keySequence = other_value.keySequence();
} else {
single_value->field_keySequence.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 CipheringKeySequenceNumberV_template[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 CipheringKeySequenceNumberV_template(*other_value.implication_.precondition);
implication_.implied_template = new CipheringKeySequenceNumberV_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_CommonIE_Types.CipheringKeySequenceNumberV.");
break;
}
set_selection(other_value);
}

CipheringKeySequenceNumberV_template::CipheringKeySequenceNumberV_template()
{
}

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

CipheringKeySequenceNumberV_template::CipheringKeySequenceNumberV_template(const CipheringKeySequenceNumberV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CipheringKeySequenceNumberV_template::match(const CipheringKeySequenceNumberV& 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.keySequence().is_bound()) return FALSE;
if(!single_value->field_keySequence.match(other_value.keySequence(), 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_CommonIE_Types.CipheringKeySequenceNumberV.");
}
return FALSE;
}

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

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

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

CipheringKeySequenceNumberV CipheringKeySequenceNumberV_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_CommonIE_Types.CipheringKeySequenceNumberV.");
CipheringKeySequenceNumberV ret_val;
if (single_value->field_keySequence.is_bound()) {
ret_val.keySequence() = single_value->field_keySequence.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void CipheringKeySequenceNumberV_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_CommonIE_Types.CipheringKeySequenceNumberV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CipheringKeySequenceNumberV_template[list_length];
}

CipheringKeySequenceNumberV_template& CipheringKeySequenceNumberV_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_CommonIE_Types.CipheringKeySequenceNumberV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberV.");
return value_list.list_value[list_index];
}

BITSTRING_template& CipheringKeySequenceNumberV_template::keySequence()
{
set_specific();
return single_value->field_keySequence;
}

const BITSTRING_template& CipheringKeySequenceNumberV_template::keySequence() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field keySequence of a non-specific template of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberV.");
return single_value->field_keySequence;
}

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

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

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

void CipheringKeySequenceNumberV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ keySequence := ");
single_value->field_keySequence.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 CipheringKeySequenceNumberV_template::log_match(const CipheringKeySequenceNumberV& 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_keySequence.match(match_value.keySequence(), legacy)){
TTCN_Logger::log_logmatch_info(".keySequence");
single_value->field_keySequence.log_match(match_value.keySequence(), 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("{ keySequence := ");
single_value->field_keySequence.log_match(match_value.keySequence(), 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 CipheringKeySequenceNumberV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (keySequence().is_bound()) keySequence().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void CipheringKeySequenceNumberV_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_keySequence.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 CipheringKeySequenceNumberV_template[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_CommonIE_Types.CipheringKeySequenceNumberV.");
}
}

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

void CipheringKeySequenceNumberV_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_keySequence.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberV");
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_CommonIE_Types.CipheringKeySequenceNumberV");
}

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

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

CipheringKeySequenceNumberTV::CipheringKeySequenceNumberTV()
{
}

CipheringKeySequenceNumberTV::CipheringKeySequenceNumberTV(const CipheringKeySequenceNumberV& par_keySequence,
    const BITSTRING& par_elementIdentifier)
  :   field_keySequence(par_keySequence),
  field_elementIdentifier(par_elementIdentifier)
{
}

CipheringKeySequenceNumberTV::CipheringKeySequenceNumberTV(const CipheringKeySequenceNumberTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV.");
if (other_value.keySequence().is_bound()) field_keySequence = other_value.keySequence();
else field_keySequence.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void CipheringKeySequenceNumberTV::clean_up()
{
field_keySequence.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* CipheringKeySequenceNumberTV::get_descriptor() const { return &CipheringKeySequenceNumberTV_descr_; }
CipheringKeySequenceNumberTV& CipheringKeySequenceNumberTV::operator=(const CipheringKeySequenceNumberTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV.");
  if (other_value.keySequence().is_bound()) field_keySequence = other_value.keySequence();
  else field_keySequence.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean CipheringKeySequenceNumberTV::operator==(const CipheringKeySequenceNumberTV& other_value) const
{
return field_keySequence==other_value.field_keySequence
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

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

void CipheringKeySequenceNumberTV::set_implicit_omit()
{
if (keySequence().is_bound()) keySequence().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void CipheringKeySequenceNumberTV::encode_text(Text_Buf& text_buf) const
{
field_keySequence.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void CipheringKeySequenceNumberTV::decode_text(Text_Buf& text_buf)
{
field_keySequence.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void CipheringKeySequenceNumberTV::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 CipheringKeySequenceNumberTV::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 CipheringKeySequenceNumberTV::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, CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_keySequence.RAW_decode(CipheringKeySequenceNumberV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_elementIdentifier !=  bs_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 CipheringKeySequenceNumberTV::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, CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_keySequence.RAW_encode(CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  bs_0) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.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 CipheringKeySequenceNumberTV_template::single_value_struct {
CipheringKeySequenceNumberV_template field_keySequence;
BITSTRING_template field_elementIdentifier;
};

void CipheringKeySequenceNumberTV_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_keySequence = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void CipheringKeySequenceNumberTV_template::copy_value(const CipheringKeySequenceNumberTV& other_value)
{
single_value = new single_value_struct;
if (other_value.keySequence().is_bound()) {
  single_value->field_keySequence = other_value.keySequence();
} else {
  single_value->field_keySequence.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

CipheringKeySequenceNumberTV_template::CipheringKeySequenceNumberTV_template()
{
}

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

CipheringKeySequenceNumberTV_template::CipheringKeySequenceNumberTV_template(const CipheringKeySequenceNumberTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

CipheringKeySequenceNumberTV CipheringKeySequenceNumberTV_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_CommonIE_Types.CipheringKeySequenceNumberTV.");
CipheringKeySequenceNumberTV ret_val;
if (single_value->field_keySequence.is_bound()) {
ret_val.keySequence() = single_value->field_keySequence.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void CipheringKeySequenceNumberTV_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_CommonIE_Types.CipheringKeySequenceNumberTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CipheringKeySequenceNumberTV_template[list_length];
}

CipheringKeySequenceNumberTV_template& CipheringKeySequenceNumberTV_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_CommonIE_Types.CipheringKeySequenceNumberTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV.");
return value_list.list_value[list_index];
}

CipheringKeySequenceNumberV_template& CipheringKeySequenceNumberTV_template::keySequence()
{
set_specific();
return single_value->field_keySequence;
}

const CipheringKeySequenceNumberV_template& CipheringKeySequenceNumberTV_template::keySequence() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field keySequence of a non-specific template of type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV.");
return single_value->field_keySequence;
}

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

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

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

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

void CipheringKeySequenceNumberTV_template::log_match(const CipheringKeySequenceNumberTV& 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_keySequence.match(match_value.keySequence(), legacy)){
TTCN_Logger::log_logmatch_info(".keySequence");
single_value->field_keySequence.log_match(match_value.keySequence(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ keySequence := ");
single_value->field_keySequence.log_match(match_value.keySequence(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

void CipheringKeySequenceNumberTV_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_keySequence.decode_text(text_buf);
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CipheringKeySequenceNumberTV_template[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_CommonIE_Types.CipheringKeySequenceNumberTV.");
}
}

void CipheringKeySequenceNumberTV_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: {
    CipheringKeySequenceNumberTV_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_CommonIE_Types.CipheringKeySequenceNumberTV 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) keySequence().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "keySequence")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          keySequence().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CipheringKeySequenceNumberTV_template* precondition = new CipheringKeySequenceNumberTV_template;
    precondition->set_param(*param.get_elem(0));
    CipheringKeySequenceNumberTV_template* implied_template = new CipheringKeySequenceNumberTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CipheringKeySequenceNumberTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void CipheringKeySequenceNumberTV_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_keySequence.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.CipheringKeySequenceNumberTV");
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_CommonIE_Types.CipheringKeySequenceNumberTV");
}

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

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

LocationAreaIdentification__V::LocationAreaIdentification__V()
{
}

LocationAreaIdentification__V::LocationAreaIdentification__V(const OCTETSTRING& par_mcc__mnc,
    const OCTETSTRING& par_lac)
  :   field_mcc__mnc(par_mcc__mnc),
  field_lac(par_lac)
{
}

LocationAreaIdentification__V::LocationAreaIdentification__V(const LocationAreaIdentification__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.LocationAreaIdentification_V.");
if (other_value.mcc__mnc().is_bound()) field_mcc__mnc = other_value.mcc__mnc();
else field_mcc__mnc.clean_up();
if (other_value.lac().is_bound()) field_lac = other_value.lac();
else field_lac.clean_up();
}

void LocationAreaIdentification__V::clean_up()
{
field_mcc__mnc.clean_up();
field_lac.clean_up();
}

const TTCN_Typedescriptor_t* LocationAreaIdentification__V::get_descriptor() const { return &LocationAreaIdentification__V_descr_; }
LocationAreaIdentification__V& LocationAreaIdentification__V::operator=(const LocationAreaIdentification__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.LocationAreaIdentification_V.");
  if (other_value.mcc__mnc().is_bound()) field_mcc__mnc = other_value.mcc__mnc();
  else field_mcc__mnc.clean_up();
  if (other_value.lac().is_bound()) field_lac = other_value.lac();
  else field_lac.clean_up();
}
return *this;
}

boolean LocationAreaIdentification__V::operator==(const LocationAreaIdentification__V& other_value) const
{
return field_mcc__mnc==other_value.field_mcc__mnc
  && field_lac==other_value.field_lac;
}

boolean LocationAreaIdentification__V::is_bound() const
{
return (field_mcc__mnc.is_bound())
  || (field_lac.is_bound());
}
boolean LocationAreaIdentification__V::is_value() const
{
return field_mcc__mnc.is_value()
  && field_lac.is_value();
}
void LocationAreaIdentification__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ mcc_mnc := ");
field_mcc__mnc.log();
TTCN_Logger::log_event_str(", lac := ");
field_lac.log();
TTCN_Logger::log_event_str(" }");
}

void LocationAreaIdentification__V::set_implicit_omit()
{
if (mcc__mnc().is_bound()) mcc__mnc().set_implicit_omit();
if (lac().is_bound()) lac().set_implicit_omit();
}

void LocationAreaIdentification__V::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_CommonIE_Types.LocationAreaIdentification_V 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) mcc__mnc().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lac().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(), "mcc_mnc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mcc__mnc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.LocationAreaIdentification_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.LocationAreaIdentification_V");
  }
}

void LocationAreaIdentification__V::encode_text(Text_Buf& text_buf) const
{
field_mcc__mnc.encode_text(text_buf);
field_lac.encode_text(text_buf);
}

void LocationAreaIdentification__V::decode_text(Text_Buf& text_buf)
{
field_mcc__mnc.decode_text(text_buf);
field_lac.decode_text(text_buf);
}

void LocationAreaIdentification__V::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 LocationAreaIdentification__V::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 LocationAreaIdentification__V::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::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_mcc__mnc.RAW_decode(General__Types::OCT3_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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_lac.RAW_decode(General__Types::OCT2_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 LocationAreaIdentification__V::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::OCT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT2_descr_.raw);
  encoded_length += field_mcc__mnc.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_lac.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct LocationAreaIdentification__V_template::single_value_struct {
OCTETSTRING_template field_mcc__mnc;
OCTETSTRING_template field_lac;
};

void LocationAreaIdentification__V_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_mcc__mnc = ANY_VALUE;
single_value->field_lac = ANY_VALUE;
}
}
}

void LocationAreaIdentification__V_template::copy_value(const LocationAreaIdentification__V& other_value)
{
single_value = new single_value_struct;
if (other_value.mcc__mnc().is_bound()) {
  single_value->field_mcc__mnc = other_value.mcc__mnc();
} else {
  single_value->field_mcc__mnc.clean_up();
}
if (other_value.lac().is_bound()) {
  single_value->field_lac = other_value.lac();
} else {
  single_value->field_lac.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LocationAreaIdentification__V_template::copy_template(const LocationAreaIdentification__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.mcc__mnc().get_selection()) {
single_value->field_mcc__mnc = other_value.mcc__mnc();
} else {
single_value->field_mcc__mnc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lac().get_selection()) {
single_value->field_lac = other_value.lac();
} else {
single_value->field_lac.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 LocationAreaIdentification__V_template[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 LocationAreaIdentification__V_template(*other_value.implication_.precondition);
implication_.implied_template = new LocationAreaIdentification__V_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_CommonIE_Types.LocationAreaIdentification_V.");
break;
}
set_selection(other_value);
}

LocationAreaIdentification__V_template::LocationAreaIdentification__V_template()
{
}

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

LocationAreaIdentification__V_template::LocationAreaIdentification__V_template(const LocationAreaIdentification__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LocationAreaIdentification__V_template::match(const LocationAreaIdentification__V& 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.mcc__mnc().is_bound()) return FALSE;
if(!single_value->field_mcc__mnc.match(other_value.mcc__mnc(), legacy))return FALSE;
if(!other_value.lac().is_bound()) return FALSE;
if(!single_value->field_lac.match(other_value.lac(), 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_CommonIE_Types.LocationAreaIdentification_V.");
}
return FALSE;
}

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

boolean LocationAreaIdentification__V_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_mcc__mnc.is_value()
 && single_value->field_lac.is_value();
}

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

LocationAreaIdentification__V LocationAreaIdentification__V_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_CommonIE_Types.LocationAreaIdentification_V.");
LocationAreaIdentification__V ret_val;
if (single_value->field_mcc__mnc.is_bound()) {
ret_val.mcc__mnc() = single_value->field_mcc__mnc.valueof();
}
if (single_value->field_lac.is_bound()) {
ret_val.lac() = single_value->field_lac.valueof();
}
return ret_val;
}

void LocationAreaIdentification__V_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_CommonIE_Types.LocationAreaIdentification_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LocationAreaIdentification__V_template[list_length];
}

LocationAreaIdentification__V_template& LocationAreaIdentification__V_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_CommonIE_Types.LocationAreaIdentification_V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.LocationAreaIdentification_V.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& LocationAreaIdentification__V_template::mcc__mnc()
{
set_specific();
return single_value->field_mcc__mnc;
}

const OCTETSTRING_template& LocationAreaIdentification__V_template::mcc__mnc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mcc_mnc of a non-specific template of type @MobileL3_CommonIE_Types.LocationAreaIdentification_V.");
return single_value->field_mcc__mnc;
}

OCTETSTRING_template& LocationAreaIdentification__V_template::lac()
{
set_specific();
return single_value->field_lac;
}

const OCTETSTRING_template& LocationAreaIdentification__V_template::lac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lac of a non-specific template of type @MobileL3_CommonIE_Types.LocationAreaIdentification_V.");
return single_value->field_lac;
}

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

void LocationAreaIdentification__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ mcc_mnc := ");
single_value->field_mcc__mnc.log();
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.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 LocationAreaIdentification__V_template::log_match(const LocationAreaIdentification__V& 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_mcc__mnc.match(match_value.mcc__mnc(), legacy)){
TTCN_Logger::log_logmatch_info(".mcc_mnc");
single_value->field_mcc__mnc.log_match(match_value.mcc__mnc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lac.match(match_value.lac(), legacy)){
TTCN_Logger::log_logmatch_info(".lac");
single_value->field_lac.log_match(match_value.lac(), 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("{ mcc_mnc := ");
single_value->field_mcc__mnc.log_match(match_value.mcc__mnc(), legacy);
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.log_match(match_value.lac(), 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 LocationAreaIdentification__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (mcc__mnc().is_bound()) mcc__mnc().set_implicit_omit();
if (lac().is_bound()) lac().set_implicit_omit();
}

void LocationAreaIdentification__V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_mcc__mnc.encode_text(text_buf);
single_value->field_lac.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_CommonIE_Types.LocationAreaIdentification_V.");
}
}

void LocationAreaIdentification__V_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_mcc__mnc.decode_text(text_buf);
single_value->field_lac.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 LocationAreaIdentification__V_template[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_CommonIE_Types.LocationAreaIdentification_V.");
}
}

void LocationAreaIdentification__V_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: {
    LocationAreaIdentification__V_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_CommonIE_Types.LocationAreaIdentification_V 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) mcc__mnc().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lac().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(), "mcc_mnc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mcc__mnc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.LocationAreaIdentification_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LocationAreaIdentification__V_template* precondition = new LocationAreaIdentification__V_template;
    precondition->set_param(*param.get_elem(0));
    LocationAreaIdentification__V_template* implied_template = new LocationAreaIdentification__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LocationAreaIdentification__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.LocationAreaIdentification_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void LocationAreaIdentification__V_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_mcc__mnc.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.LocationAreaIdentification_V");
single_value->field_lac.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.LocationAreaIdentification_V");
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_CommonIE_Types.LocationAreaIdentification_V");
}

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

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

LocationAreaIdentification__TV::LocationAreaIdentification__TV()
{
}

LocationAreaIdentification__TV::LocationAreaIdentification__TV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_mcc__mnc,
    const OCTETSTRING& par_lac)
  :   field_elementIdentifier(par_elementIdentifier),
  field_mcc__mnc(par_mcc__mnc),
  field_lac(par_lac)
{
}

LocationAreaIdentification__TV::LocationAreaIdentification__TV(const LocationAreaIdentification__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.LocationAreaIdentification_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.mcc__mnc().is_bound()) field_mcc__mnc = other_value.mcc__mnc();
else field_mcc__mnc.clean_up();
if (other_value.lac().is_bound()) field_lac = other_value.lac();
else field_lac.clean_up();
}

void LocationAreaIdentification__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_mcc__mnc.clean_up();
field_lac.clean_up();
}

const TTCN_Typedescriptor_t* LocationAreaIdentification__TV::get_descriptor() const { return &LocationAreaIdentification__TV_descr_; }
LocationAreaIdentification__TV& LocationAreaIdentification__TV::operator=(const LocationAreaIdentification__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.LocationAreaIdentification_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.mcc__mnc().is_bound()) field_mcc__mnc = other_value.mcc__mnc();
  else field_mcc__mnc.clean_up();
  if (other_value.lac().is_bound()) field_lac = other_value.lac();
  else field_lac.clean_up();
}
return *this;
}

boolean LocationAreaIdentification__TV::operator==(const LocationAreaIdentification__TV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_mcc__mnc==other_value.field_mcc__mnc
  && field_lac==other_value.field_lac;
}

boolean LocationAreaIdentification__TV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_mcc__mnc.is_bound())
  || (field_lac.is_bound());
}
boolean LocationAreaIdentification__TV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_mcc__mnc.is_value()
  && field_lac.is_value();
}
void LocationAreaIdentification__TV::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(", mcc_mnc := ");
field_mcc__mnc.log();
TTCN_Logger::log_event_str(", lac := ");
field_lac.log();
TTCN_Logger::log_event_str(" }");
}

void LocationAreaIdentification__TV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (mcc__mnc().is_bound()) mcc__mnc().set_implicit_omit();
if (lac().is_bound()) lac().set_implicit_omit();
}

void LocationAreaIdentification__TV::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_CommonIE_Types.LocationAreaIdentification_TV 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) mcc__mnc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lac().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(), "mcc_mnc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mcc__mnc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.LocationAreaIdentification_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV");
  }
}

void LocationAreaIdentification__TV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_mcc__mnc.encode_text(text_buf);
field_lac.encode_text(text_buf);
}

void LocationAreaIdentification__TV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_mcc__mnc.decode_text(text_buf);
field_lac.decode_text(text_buf);
}

void LocationAreaIdentification__TV::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 LocationAreaIdentification__TV::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 LocationAreaIdentification__TV::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::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_mcc__mnc.RAW_decode(General__Types::OCT3_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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_lac.RAW_decode(General__Types::OCT2_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 LocationAreaIdentification__TV::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, General__Types::OCT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT2_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mcc__mnc.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lac.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct LocationAreaIdentification__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_mcc__mnc;
OCTETSTRING_template field_lac;
};

void LocationAreaIdentification__TV_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_mcc__mnc = ANY_VALUE;
single_value->field_lac = ANY_VALUE;
}
}
}

void LocationAreaIdentification__TV_template::copy_value(const LocationAreaIdentification__TV& 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.mcc__mnc().is_bound()) {
  single_value->field_mcc__mnc = other_value.mcc__mnc();
} else {
  single_value->field_mcc__mnc.clean_up();
}
if (other_value.lac().is_bound()) {
  single_value->field_lac = other_value.lac();
} else {
  single_value->field_lac.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LocationAreaIdentification__TV_template::copy_template(const LocationAreaIdentification__TV_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.mcc__mnc().get_selection()) {
single_value->field_mcc__mnc = other_value.mcc__mnc();
} else {
single_value->field_mcc__mnc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lac().get_selection()) {
single_value->field_lac = other_value.lac();
} else {
single_value->field_lac.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 LocationAreaIdentification__TV_template[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 LocationAreaIdentification__TV_template(*other_value.implication_.precondition);
implication_.implied_template = new LocationAreaIdentification__TV_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_CommonIE_Types.LocationAreaIdentification_TV.");
break;
}
set_selection(other_value);
}

LocationAreaIdentification__TV_template::LocationAreaIdentification__TV_template()
{
}

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

LocationAreaIdentification__TV_template::LocationAreaIdentification__TV_template(const LocationAreaIdentification__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LocationAreaIdentification__TV_template::match(const LocationAreaIdentification__TV& 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.mcc__mnc().is_bound()) return FALSE;
if(!single_value->field_mcc__mnc.match(other_value.mcc__mnc(), legacy))return FALSE;
if(!other_value.lac().is_bound()) return FALSE;
if(!single_value->field_lac.match(other_value.lac(), 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_CommonIE_Types.LocationAreaIdentification_TV.");
}
return FALSE;
}

boolean LocationAreaIdentification__TV_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_mcc__mnc.is_bound()
 || single_value->field_lac.is_bound();
}

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

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

LocationAreaIdentification__TV LocationAreaIdentification__TV_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_CommonIE_Types.LocationAreaIdentification_TV.");
LocationAreaIdentification__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_mcc__mnc.is_bound()) {
ret_val.mcc__mnc() = single_value->field_mcc__mnc.valueof();
}
if (single_value->field_lac.is_bound()) {
ret_val.lac() = single_value->field_lac.valueof();
}
return ret_val;
}

void LocationAreaIdentification__TV_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_CommonIE_Types.LocationAreaIdentification_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LocationAreaIdentification__TV_template[list_length];
}

LocationAreaIdentification__TV_template& LocationAreaIdentification__TV_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_CommonIE_Types.LocationAreaIdentification_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.LocationAreaIdentification_TV.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& LocationAreaIdentification__TV_template::mcc__mnc()
{
set_specific();
return single_value->field_mcc__mnc;
}

const OCTETSTRING_template& LocationAreaIdentification__TV_template::mcc__mnc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mcc_mnc of a non-specific template of type @MobileL3_CommonIE_Types.LocationAreaIdentification_TV.");
return single_value->field_mcc__mnc;
}

OCTETSTRING_template& LocationAreaIdentification__TV_template::lac()
{
set_specific();
return single_value->field_lac;
}

const OCTETSTRING_template& LocationAreaIdentification__TV_template::lac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lac of a non-specific template of type @MobileL3_CommonIE_Types.LocationAreaIdentification_TV.");
return single_value->field_lac;
}

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

void LocationAreaIdentification__TV_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(", mcc_mnc := ");
single_value->field_mcc__mnc.log();
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.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 LocationAreaIdentification__TV_template::log_match(const LocationAreaIdentification__TV& 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_mcc__mnc.match(match_value.mcc__mnc(), legacy)){
TTCN_Logger::log_logmatch_info(".mcc_mnc");
single_value->field_mcc__mnc.log_match(match_value.mcc__mnc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lac.match(match_value.lac(), legacy)){
TTCN_Logger::log_logmatch_info(".lac");
single_value->field_lac.log_match(match_value.lac(), 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(", mcc_mnc := ");
single_value->field_mcc__mnc.log_match(match_value.mcc__mnc(), legacy);
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.log_match(match_value.lac(), 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 LocationAreaIdentification__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (mcc__mnc().is_bound()) mcc__mnc().set_implicit_omit();
if (lac().is_bound()) lac().set_implicit_omit();
}

void LocationAreaIdentification__TV_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_mcc__mnc.encode_text(text_buf);
single_value->field_lac.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_CommonIE_Types.LocationAreaIdentification_TV.");
}
}

void LocationAreaIdentification__TV_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_mcc__mnc.decode_text(text_buf);
single_value->field_lac.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 LocationAreaIdentification__TV_template[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_CommonIE_Types.LocationAreaIdentification_TV.");
}
}

void LocationAreaIdentification__TV_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: {
    LocationAreaIdentification__TV_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_CommonIE_Types.LocationAreaIdentification_TV 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) mcc__mnc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lac().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(), "mcc_mnc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mcc__mnc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.LocationAreaIdentification_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LocationAreaIdentification__TV_template* precondition = new LocationAreaIdentification__TV_template;
    precondition->set_param(*param.get_elem(0));
    LocationAreaIdentification__TV_template* implied_template = new LocationAreaIdentification__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LocationAreaIdentification__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void LocationAreaIdentification__TV_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_CommonIE_Types.LocationAreaIdentification_TV");
single_value->field_mcc__mnc.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV");
single_value->field_lac.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.LocationAreaIdentification_TV");
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_CommonIE_Types.LocationAreaIdentification_TV");
}

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

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

void OddEvenInd__Identity::copy_value(const OddEvenInd__Identity& other_value)
{
switch (other_value.union_selection) {
case ALT_imsi:
field_imsi = new IMSI__L3(*other_value.field_imsi);
break;
case ALT_imei:
field_imei = new IMEI__L3(*other_value.field_imei);
break;
case ALT_imei__sv:
field_imei__sv = new IMEI__SV(*other_value.field_imei__sv);
break;
case ALT_tmsi__ptmsi:
field_tmsi__ptmsi = new TMSI__PTMSI(*other_value.field_tmsi__ptmsi);
break;
case ALT_tmgi__and__MBMS__SessionID:
field_tmgi__and__MBMS__SessionID = new TMGI__and__MBMS__SessionID(*other_value.field_tmgi__and__MBMS__SessionID);
break;
case ALT_no__identity:
field_no__identity = new No__Identity(*other_value.field_no__identity);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean OddEvenInd__Identity::operator==(const OddEvenInd__Identity& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_imsi:
return *field_imsi == *other_value.field_imsi;
case ALT_imei:
return *field_imei == *other_value.field_imei;
case ALT_imei__sv:
return *field_imei__sv == *other_value.field_imei__sv;
case ALT_tmsi__ptmsi:
return *field_tmsi__ptmsi == *other_value.field_tmsi__ptmsi;
case ALT_tmgi__and__MBMS__SessionID:
return *field_tmgi__and__MBMS__SessionID == *other_value.field_tmgi__and__MBMS__SessionID;
case ALT_no__identity:
return *field_no__identity == *other_value.field_no__identity;
default:
return FALSE;
}
}

IMSI__L3& OddEvenInd__Identity::imsi()
{
if (union_selection != ALT_imsi) {
clean_up();
field_imsi = new IMSI__L3;
union_selection = ALT_imsi;
}
return *field_imsi;
}

const IMSI__L3& OddEvenInd__Identity::imsi() const
{
if (union_selection != ALT_imsi) TTCN_error("Using non-selected field imsi in a value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *field_imsi;
}

IMEI__L3& OddEvenInd__Identity::imei()
{
if (union_selection != ALT_imei) {
clean_up();
field_imei = new IMEI__L3;
union_selection = ALT_imei;
}
return *field_imei;
}

const IMEI__L3& OddEvenInd__Identity::imei() const
{
if (union_selection != ALT_imei) TTCN_error("Using non-selected field imei in a value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *field_imei;
}

IMEI__SV& OddEvenInd__Identity::imei__sv()
{
if (union_selection != ALT_imei__sv) {
clean_up();
field_imei__sv = new IMEI__SV;
union_selection = ALT_imei__sv;
}
return *field_imei__sv;
}

const IMEI__SV& OddEvenInd__Identity::imei__sv() const
{
if (union_selection != ALT_imei__sv) TTCN_error("Using non-selected field imei_sv in a value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *field_imei__sv;
}

TMSI__PTMSI& OddEvenInd__Identity::tmsi__ptmsi()
{
if (union_selection != ALT_tmsi__ptmsi) {
clean_up();
field_tmsi__ptmsi = new TMSI__PTMSI;
union_selection = ALT_tmsi__ptmsi;
}
return *field_tmsi__ptmsi;
}

const TMSI__PTMSI& OddEvenInd__Identity::tmsi__ptmsi() const
{
if (union_selection != ALT_tmsi__ptmsi) TTCN_error("Using non-selected field tmsi_ptmsi in a value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *field_tmsi__ptmsi;
}

TMGI__and__MBMS__SessionID& OddEvenInd__Identity::tmgi__and__MBMS__SessionID()
{
if (union_selection != ALT_tmgi__and__MBMS__SessionID) {
clean_up();
field_tmgi__and__MBMS__SessionID = new TMGI__and__MBMS__SessionID;
union_selection = ALT_tmgi__and__MBMS__SessionID;
}
return *field_tmgi__and__MBMS__SessionID;
}

const TMGI__and__MBMS__SessionID& OddEvenInd__Identity::tmgi__and__MBMS__SessionID() const
{
if (union_selection != ALT_tmgi__and__MBMS__SessionID) TTCN_error("Using non-selected field tmgi_and_MBMS_SessionID in a value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *field_tmgi__and__MBMS__SessionID;
}

No__Identity& OddEvenInd__Identity::no__identity()
{
if (union_selection != ALT_no__identity) {
clean_up();
field_no__identity = new No__Identity;
union_selection = ALT_no__identity;
}
return *field_no__identity;
}

const No__Identity& OddEvenInd__Identity::no__identity() const
{
if (union_selection != ALT_no__identity) TTCN_error("Using non-selected field no_identity in a value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *field_no__identity;
}

boolean OddEvenInd__Identity::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return union_selection == checked_selection;
}

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

boolean OddEvenInd__Identity::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_imsi: return field_imsi->is_value();
case ALT_imei: return field_imei->is_value();
case ALT_imei__sv: return field_imei__sv->is_value();
case ALT_tmsi__ptmsi: return field_tmsi__ptmsi->is_value();
case ALT_tmgi__and__MBMS__SessionID: return field_tmgi__and__MBMS__SessionID->is_value();
case ALT_no__identity: return field_no__identity->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void OddEvenInd__Identity::clean_up()
{
switch (union_selection) {
case ALT_imsi:
  delete field_imsi;
  break;
case ALT_imei:
  delete field_imei;
  break;
case ALT_imei__sv:
  delete field_imei__sv;
  break;
case ALT_tmsi__ptmsi:
  delete field_tmsi__ptmsi;
  break;
case ALT_tmgi__and__MBMS__SessionID:
  delete field_tmgi__and__MBMS__SessionID;
  break;
case ALT_no__identity:
  delete field_no__identity;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void OddEvenInd__Identity::log() const
{
switch (union_selection) {
case ALT_imsi:
TTCN_Logger::log_event_str("{ imsi := ");
field_imsi->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_imei:
TTCN_Logger::log_event_str("{ imei := ");
field_imei->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_imei__sv:
TTCN_Logger::log_event_str("{ imei_sv := ");
field_imei__sv->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_tmsi__ptmsi:
TTCN_Logger::log_event_str("{ tmsi_ptmsi := ");
field_tmsi__ptmsi->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_tmgi__and__MBMS__SessionID:
TTCN_Logger::log_event_str("{ tmgi_and_MBMS_SessionID := ");
field_tmgi__and__MBMS__SessionID->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_no__identity:
TTCN_Logger::log_event_str("{ no_identity := ");
field_no__identity->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void OddEvenInd__Identity::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "imsi")) {
    imsi().set_param(*mp_last);
    if (!imsi().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "imei")) {
    imei().set_param(*mp_last);
    if (!imei().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "imei_sv")) {
    imei__sv().set_param(*mp_last);
    if (!imei__sv().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "tmsi_ptmsi")) {
    tmsi__ptmsi().set_param(*mp_last);
    if (!tmsi__ptmsi().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "tmgi_and_MBMS_SessionID")) {
    tmgi__and__MBMS__SessionID().set_param(*mp_last);
    if (!tmgi__and__MBMS__SessionID().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "no_identity")) {
    no__identity().set_param(*mp_last);
    if (!no__identity().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_CommonIE_Types.OddEvenInd_Identity.", last_name);
}

void OddEvenInd__Identity::set_implicit_omit()
{
switch (union_selection) {
case ALT_imsi:
field_imsi->set_implicit_omit(); break;
case ALT_imei:
field_imei->set_implicit_omit(); break;
case ALT_imei__sv:
field_imei__sv->set_implicit_omit(); break;
case ALT_tmsi__ptmsi:
field_tmsi__ptmsi->set_implicit_omit(); break;
case ALT_tmgi__and__MBMS__SessionID:
field_tmgi__and__MBMS__SessionID->set_implicit_omit(); break;
case ALT_no__identity:
field_no__identity->set_implicit_omit(); break;
default: break;
}
}

void OddEvenInd__Identity::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_imsi:
field_imsi->encode_text(text_buf);
break;
case ALT_imei:
field_imei->encode_text(text_buf);
break;
case ALT_imei__sv:
field_imei__sv->encode_text(text_buf);
break;
case ALT_tmsi__ptmsi:
field_tmsi__ptmsi->encode_text(text_buf);
break;
case ALT_tmgi__and__MBMS__SessionID:
field_tmgi__and__MBMS__SessionID->encode_text(text_buf);
break;
case ALT_no__identity:
field_no__identity->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
}

void OddEvenInd__Identity::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_imsi:
imsi().decode_text(text_buf);
break;
case ALT_imei:
imei().decode_text(text_buf);
break;
case ALT_imei__sv:
imei__sv().decode_text(text_buf);
break;
case ALT_tmsi__ptmsi:
tmsi__ptmsi().decode_text(text_buf);
break;
case ALT_tmgi__and__MBMS__SessionID:
tmgi__and__MBMS__SessionID().decode_text(text_buf);
break;
case ALT_no__identity:
no__identity().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
}

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

void OddEvenInd__Identity::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 OddEvenInd__Identity::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, IMSI__L3_descr_.raw->forceomit);
      decoded_length = imsi().RAW_decode(IMSI__L3_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, IMEI__L3_descr_.raw->forceomit);
      decoded_length = imei().RAW_decode(IMEI__L3_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, IMEI__SV_descr_.raw->forceomit);
      decoded_length = imei__sv().RAW_decode(IMEI__SV_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, TMSI__PTMSI_descr_.raw->forceomit);
      decoded_length = tmsi__ptmsi().RAW_decode(TMSI__PTMSI_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, TMGI__and__MBMS__SessionID_descr_.raw->forceomit);
      decoded_length = tmgi__and__MBMS__SessionID().RAW_decode(TMGI__and__MBMS__SessionID_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, No__Identity_descr_.raw->forceomit);
      decoded_length = no__identity().RAW_decode(No__Identity_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, IMSI__L3_descr_.raw->forceomit);
      decoded_length = imsi().RAW_decode(IMSI__L3_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, IMEI__L3_descr_.raw->forceomit);
      decoded_length = imei().RAW_decode(IMEI__L3_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, IMEI__SV_descr_.raw->forceomit);
      decoded_length = imei__sv().RAW_decode(IMEI__SV_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, TMSI__PTMSI_descr_.raw->forceomit);
      decoded_length = tmsi__ptmsi().RAW_decode(TMSI__PTMSI_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_4_force_omit(4, force_omit, TMGI__and__MBMS__SessionID_descr_.raw->forceomit);
      decoded_length = tmgi__and__MBMS__SessionID().RAW_decode(TMGI__and__MBMS__SessionID_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_4_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_5_force_omit(5, force_omit, No__Identity_descr_.raw->forceomit);
      decoded_length = no__identity().RAW_decode(No__Identity_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_5_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int OddEvenInd__Identity::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  memset(myleaf.body.node.nodes, 0, 6 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_imsi:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, IMSI__L3_descr_.raw);
    encoded_length = field_imsi->RAW_encode(IMSI__L3_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &IMSI__L3_descr_;
    break;
  case ALT_imei:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, IMEI__L3_descr_.raw);
    encoded_length = field_imei->RAW_encode(IMEI__L3_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &IMEI__L3_descr_;
    break;
  case ALT_imei__sv:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, IMEI__SV_descr_.raw);
    encoded_length = field_imei__sv->RAW_encode(IMEI__SV_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &IMEI__SV_descr_;
    break;
  case ALT_tmsi__ptmsi:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, TMSI__PTMSI_descr_.raw);
    encoded_length = field_tmsi__ptmsi->RAW_encode(TMSI__PTMSI_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &TMSI__PTMSI_descr_;
    break;
  case ALT_tmgi__and__MBMS__SessionID:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, TMGI__and__MBMS__SessionID_descr_.raw);
    encoded_length = field_tmgi__and__MBMS__SessionID->RAW_encode(TMGI__and__MBMS__SessionID_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &TMGI__and__MBMS__SessionID_descr_;
    break;
  case ALT_no__identity:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, No__Identity_descr_.raw);
    encoded_length = field_no__identity->RAW_encode(No__Identity_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &No__Identity_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void OddEvenInd__Identity_template::copy_value(const OddEvenInd__Identity& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
single_value.field_imsi = new IMSI__L3_template(other_value.imsi());
break;
case OddEvenInd__Identity::ALT_imei:
single_value.field_imei = new IMEI__L3_template(other_value.imei());
break;
case OddEvenInd__Identity::ALT_imei__sv:
single_value.field_imei__sv = new IMEI__SV_template(other_value.imei__sv());
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
single_value.field_tmsi__ptmsi = new TMSI__PTMSI_template(other_value.tmsi__ptmsi());
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
single_value.field_tmgi__and__MBMS__SessionID = new TMGI__and__MBMS__SessionID_template(other_value.tmgi__and__MBMS__SessionID());
break;
case OddEvenInd__Identity::ALT_no__identity:
single_value.field_no__identity = new No__Identity_template(other_value.no__identity());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
set_selection(SPECIFIC_VALUE);
}

void OddEvenInd__Identity_template::copy_template(const OddEvenInd__Identity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
single_value.field_imsi = new IMSI__L3_template(*other_value.single_value.field_imsi);
break;
case OddEvenInd__Identity::ALT_imei:
single_value.field_imei = new IMEI__L3_template(*other_value.single_value.field_imei);
break;
case OddEvenInd__Identity::ALT_imei__sv:
single_value.field_imei__sv = new IMEI__SV_template(*other_value.single_value.field_imei__sv);
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
single_value.field_tmsi__ptmsi = new TMSI__PTMSI_template(*other_value.single_value.field_tmsi__ptmsi);
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
single_value.field_tmgi__and__MBMS__SessionID = new TMGI__and__MBMS__SessionID_template(*other_value.single_value.field_tmgi__and__MBMS__SessionID);
break;
case OddEvenInd__Identity::ALT_no__identity:
single_value.field_no__identity = new No__Identity_template(*other_value.single_value.field_no__identity);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
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 OddEvenInd__Identity_template[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 OddEvenInd__Identity_template(*other_value.implication_.precondition);
implication_.implied_template = new OddEvenInd__Identity_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
set_selection(other_value);
}

OddEvenInd__Identity_template::OddEvenInd__Identity_template()
{
}

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

OddEvenInd__Identity_template::OddEvenInd__Identity_template(const OddEvenInd__Identity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void OddEvenInd__Identity_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
delete single_value.field_imsi;
break;
case OddEvenInd__Identity::ALT_imei:
delete single_value.field_imei;
break;
case OddEvenInd__Identity::ALT_imei__sv:
delete single_value.field_imei__sv;
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
delete single_value.field_tmsi__ptmsi;
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
delete single_value.field_tmgi__and__MBMS__SessionID;
break;
case OddEvenInd__Identity::ALT_no__identity:
delete single_value.field_no__identity;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

boolean OddEvenInd__Identity_template::match(const OddEvenInd__Identity& 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:
{
OddEvenInd__Identity::union_selection_type value_selection = other_value.get_selection();
if (value_selection == OddEvenInd__Identity::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case OddEvenInd__Identity::ALT_imsi:
return single_value.field_imsi->match(other_value.imsi(), legacy);
case OddEvenInd__Identity::ALT_imei:
return single_value.field_imei->match(other_value.imei(), legacy);
case OddEvenInd__Identity::ALT_imei__sv:
return single_value.field_imei__sv->match(other_value.imei__sv(), legacy);
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
return single_value.field_tmsi__ptmsi->match(other_value.tmsi__ptmsi(), legacy);
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
return single_value.field_tmgi__and__MBMS__SessionID->match(other_value.tmgi__and__MBMS__SessionID(), legacy);
case OddEvenInd__Identity::ALT_no__identity:
return single_value.field_no__identity->match(other_value.no__identity(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
return FALSE;
}

boolean OddEvenInd__Identity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
return single_value.field_imsi->is_value();
case OddEvenInd__Identity::ALT_imei:
return single_value.field_imei->is_value();
case OddEvenInd__Identity::ALT_imei__sv:
return single_value.field_imei__sv->is_value();
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
return single_value.field_tmsi__ptmsi->is_value();
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
return single_value.field_tmgi__and__MBMS__SessionID->is_value();
case OddEvenInd__Identity::ALT_no__identity:
return single_value.field_no__identity->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
}

OddEvenInd__Identity OddEvenInd__Identity_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
OddEvenInd__Identity ret_val;
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
ret_val.imsi() = single_value.field_imsi->valueof();
break;
case OddEvenInd__Identity::ALT_imei:
ret_val.imei() = single_value.field_imei->valueof();
break;
case OddEvenInd__Identity::ALT_imei__sv:
ret_val.imei__sv() = single_value.field_imei__sv->valueof();
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
ret_val.tmsi__ptmsi() = single_value.field_tmsi__ptmsi->valueof();
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
ret_val.tmgi__and__MBMS__SessionID() = single_value.field_tmgi__and__MBMS__SessionID->valueof();
break;
case OddEvenInd__Identity::ALT_no__identity:
ret_val.no__identity() = single_value.field_no__identity->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
return ret_val;
}

OddEvenInd__Identity_template& OddEvenInd__Identity_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return value_list.list_value[list_index];
}
void OddEvenInd__Identity_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new OddEvenInd__Identity_template[list_length];
}

IMSI__L3_template& OddEvenInd__Identity_template::imsi()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OddEvenInd__Identity::ALT_imsi) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_imsi = new IMSI__L3_template(ANY_VALUE);
else single_value.field_imsi = new IMSI__L3_template;
single_value.union_selection = OddEvenInd__Identity::ALT_imsi;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_imsi;
}

const IMSI__L3_template& OddEvenInd__Identity_template::imsi() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field imsi in a non-specific template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (single_value.union_selection != OddEvenInd__Identity::ALT_imsi) TTCN_error("Accessing non-selected field imsi in a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *single_value.field_imsi;
}

IMEI__L3_template& OddEvenInd__Identity_template::imei()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OddEvenInd__Identity::ALT_imei) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_imei = new IMEI__L3_template(ANY_VALUE);
else single_value.field_imei = new IMEI__L3_template;
single_value.union_selection = OddEvenInd__Identity::ALT_imei;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_imei;
}

const IMEI__L3_template& OddEvenInd__Identity_template::imei() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field imei in a non-specific template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (single_value.union_selection != OddEvenInd__Identity::ALT_imei) TTCN_error("Accessing non-selected field imei in a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *single_value.field_imei;
}

IMEI__SV_template& OddEvenInd__Identity_template::imei__sv()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OddEvenInd__Identity::ALT_imei__sv) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_imei__sv = new IMEI__SV_template(ANY_VALUE);
else single_value.field_imei__sv = new IMEI__SV_template;
single_value.union_selection = OddEvenInd__Identity::ALT_imei__sv;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_imei__sv;
}

const IMEI__SV_template& OddEvenInd__Identity_template::imei__sv() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field imei_sv in a non-specific template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (single_value.union_selection != OddEvenInd__Identity::ALT_imei__sv) TTCN_error("Accessing non-selected field imei_sv in a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *single_value.field_imei__sv;
}

TMSI__PTMSI_template& OddEvenInd__Identity_template::tmsi__ptmsi()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OddEvenInd__Identity::ALT_tmsi__ptmsi) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tmsi__ptmsi = new TMSI__PTMSI_template(ANY_VALUE);
else single_value.field_tmsi__ptmsi = new TMSI__PTMSI_template;
single_value.union_selection = OddEvenInd__Identity::ALT_tmsi__ptmsi;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_tmsi__ptmsi;
}

const TMSI__PTMSI_template& OddEvenInd__Identity_template::tmsi__ptmsi() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tmsi_ptmsi in a non-specific template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (single_value.union_selection != OddEvenInd__Identity::ALT_tmsi__ptmsi) TTCN_error("Accessing non-selected field tmsi_ptmsi in a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *single_value.field_tmsi__ptmsi;
}

TMGI__and__MBMS__SessionID_template& OddEvenInd__Identity_template::tmgi__and__MBMS__SessionID()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tmgi__and__MBMS__SessionID = new TMGI__and__MBMS__SessionID_template(ANY_VALUE);
else single_value.field_tmgi__and__MBMS__SessionID = new TMGI__and__MBMS__SessionID_template;
single_value.union_selection = OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_tmgi__and__MBMS__SessionID;
}

const TMGI__and__MBMS__SessionID_template& OddEvenInd__Identity_template::tmgi__and__MBMS__SessionID() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tmgi_and_MBMS_SessionID in a non-specific template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (single_value.union_selection != OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID) TTCN_error("Accessing non-selected field tmgi_and_MBMS_SessionID in a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *single_value.field_tmgi__and__MBMS__SessionID;
}

No__Identity_template& OddEvenInd__Identity_template::no__identity()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OddEvenInd__Identity::ALT_no__identity) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_no__identity = new No__Identity_template(ANY_VALUE);
else single_value.field_no__identity = new No__Identity_template;
single_value.union_selection = OddEvenInd__Identity::ALT_no__identity;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_no__identity;
}

const No__Identity_template& OddEvenInd__Identity_template::no__identity() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field no_identity in a non-specific template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
if (single_value.union_selection != OddEvenInd__Identity::ALT_no__identity) TTCN_error("Accessing non-selected field no_identity in a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return *single_value.field_no__identity;
}

boolean OddEvenInd__Identity_template::ischosen(OddEvenInd__Identity::union_selection_type checked_selection) const
{
if (checked_selection == OddEvenInd__Identity::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == OddEvenInd__Identity::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void OddEvenInd__Identity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
TTCN_Logger::log_event_str("{ imsi := ");
single_value.field_imsi->log();
TTCN_Logger::log_event_str(" }");
break;
case OddEvenInd__Identity::ALT_imei:
TTCN_Logger::log_event_str("{ imei := ");
single_value.field_imei->log();
TTCN_Logger::log_event_str(" }");
break;
case OddEvenInd__Identity::ALT_imei__sv:
TTCN_Logger::log_event_str("{ imei_sv := ");
single_value.field_imei__sv->log();
TTCN_Logger::log_event_str(" }");
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
TTCN_Logger::log_event_str("{ tmsi_ptmsi := ");
single_value.field_tmsi__ptmsi->log();
TTCN_Logger::log_event_str(" }");
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
TTCN_Logger::log_event_str("{ tmgi_and_MBMS_SessionID := ");
single_value.field_tmgi__and__MBMS__SessionID->log();
TTCN_Logger::log_event_str(" }");
break;
case OddEvenInd__Identity::ALT_no__identity:
TTCN_Logger::log_event_str("{ no_identity := ");
single_value.field_no__identity->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void OddEvenInd__Identity_template::log_match(const OddEvenInd__Identity& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".imsi");
single_value.field_imsi->log_match(match_value.imsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ imsi := ");
single_value.field_imsi->log_match(match_value.imsi(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case OddEvenInd__Identity::ALT_imei:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".imei");
single_value.field_imei->log_match(match_value.imei(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ imei := ");
single_value.field_imei->log_match(match_value.imei(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case OddEvenInd__Identity::ALT_imei__sv:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".imei_sv");
single_value.field_imei__sv->log_match(match_value.imei__sv(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ imei_sv := ");
single_value.field_imei__sv->log_match(match_value.imei__sv(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".tmsi_ptmsi");
single_value.field_tmsi__ptmsi->log_match(match_value.tmsi__ptmsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ tmsi_ptmsi := ");
single_value.field_tmsi__ptmsi->log_match(match_value.tmsi__ptmsi(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".tmgi_and_MBMS_SessionID");
single_value.field_tmgi__and__MBMS__SessionID->log_match(match_value.tmgi__and__MBMS__SessionID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ tmgi_and_MBMS_SessionID := ");
single_value.field_tmgi__and__MBMS__SessionID->log_match(match_value.tmgi__and__MBMS__SessionID(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case OddEvenInd__Identity::ALT_no__identity:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".no_identity");
single_value.field_no__identity->log_match(match_value.no__identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ no_identity := ");
single_value.field_no__identity->log_match(match_value.no__identity(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void OddEvenInd__Identity_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
single_value.field_imsi->set_implicit_omit(); break;
case OddEvenInd__Identity::ALT_imei:
single_value.field_imei->set_implicit_omit(); break;
case OddEvenInd__Identity::ALT_imei__sv:
single_value.field_imei__sv->set_implicit_omit(); break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
single_value.field_tmsi__ptmsi->set_implicit_omit(); break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
single_value.field_tmgi__and__MBMS__SessionID->set_implicit_omit(); break;
case OddEvenInd__Identity::ALT_no__identity:
single_value.field_no__identity->set_implicit_omit(); break;
default: break;
}
}

void OddEvenInd__Identity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
single_value.field_imsi->encode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_imei:
single_value.field_imei->encode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_imei__sv:
single_value.field_imei__sv->encode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
single_value.field_tmsi__ptmsi->encode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
single_value.field_tmgi__and__MBMS__SessionID->encode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_no__identity:
single_value.field_no__identity->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
}

void OddEvenInd__Identity_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = OddEvenInd__Identity::UNBOUND_VALUE;
OddEvenInd__Identity::union_selection_type new_selection = (OddEvenInd__Identity::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case OddEvenInd__Identity::ALT_imsi:
single_value.field_imsi = new IMSI__L3_template;
single_value.field_imsi->decode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_imei:
single_value.field_imei = new IMEI__L3_template;
single_value.field_imei->decode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_imei__sv:
single_value.field_imei__sv = new IMEI__SV_template;
single_value.field_imei__sv->decode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
single_value.field_tmsi__ptmsi = new TMSI__PTMSI_template;
single_value.field_tmsi__ptmsi->decode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
single_value.field_tmgi__and__MBMS__SessionID = new TMGI__and__MBMS__SessionID_template;
single_value.field_tmgi__and__MBMS__SessionID->decode_text(text_buf);
break;
case OddEvenInd__Identity::ALT_no__identity:
single_value.field_no__identity = new No__Identity_template;
single_value.field_no__identity->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new OddEvenInd__Identity_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
}

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

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

void OddEvenInd__Identity_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_CommonIE_Types.OddEvenInd_Identity'");
    }
    if (strcmp("imsi", param_field) == 0) {
      imsi().set_param(param);
      return;
    } else if (strcmp("imei", param_field) == 0) {
      imei().set_param(param);
      return;
    } else if (strcmp("imei_sv", param_field) == 0) {
      imei__sv().set_param(param);
      return;
    } else if (strcmp("tmsi_ptmsi", param_field) == 0) {
      tmsi__ptmsi().set_param(param);
      return;
    } else if (strcmp("tmgi_and_MBMS_SessionID", param_field) == 0) {
      tmgi__and__MBMS__SessionID().set_param(param);
      return;
    } else if (strcmp("no_identity", param_field) == 0) {
      no__identity().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_CommonIE_Types.OddEvenInd_Identity'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    OddEvenInd__Identity_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "imsi")) {
      imsi().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "imei")) {
      imei().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "imei_sv")) {
      imei__sv().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "tmsi_ptmsi")) {
      tmsi__ptmsi().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "tmgi_and_MBMS_SessionID")) {
      tmgi__and__MBMS__SessionID().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "no_identity")) {
      no__identity().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_CommonIE_Types.OddEvenInd_Identity.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    OddEvenInd__Identity_template* precondition = new OddEvenInd__Identity_template;
    precondition->set_param(*m_p->get_elem(0));
    OddEvenInd__Identity_template* implied_template = new OddEvenInd__Identity_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = OddEvenInd__Identity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
  }
  is_ifpresent = param.get_ifpresent();
}

void OddEvenInd__Identity_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case OddEvenInd__Identity::ALT_imsi:
single_value.field_imsi->check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
return;
case OddEvenInd__Identity::ALT_imei:
single_value.field_imei->check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
return;
case OddEvenInd__Identity::ALT_imei__sv:
single_value.field_imei__sv->check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
return;
case OddEvenInd__Identity::ALT_tmsi__ptmsi:
single_value.field_tmsi__ptmsi->check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
return;
case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
single_value.field_tmgi__and__MBMS__SessionID->check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
return;
case OddEvenInd__Identity::ALT_no__identity:
single_value.field_no__identity->check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.OddEvenInd_Identity");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_CommonIE_Types.OddEvenInd_Identity.");
}
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_CommonIE_Types.OddEvenInd_Identity");
}

IMSI__L3::IMSI__L3()
{
}

IMSI__L3::IMSI__L3(const BITSTRING& par_oddevenIndicator,
    const HEXSTRING& par_digits,
    const OPTIONAL< BITSTRING >& par_fillerDigit)
  :   field_oddevenIndicator(par_oddevenIndicator),
  field_digits(par_digits),
  field_fillerDigit(par_fillerDigit)
{
}

IMSI__L3::IMSI__L3(const IMSI__L3& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.IMSI_L3.");
if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
else field_oddevenIndicator.clean_up();
if (other_value.digits().is_bound()) field_digits = other_value.digits();
else field_digits.clean_up();
if (other_value.fillerDigit().is_bound()) field_fillerDigit = other_value.fillerDigit();
else field_fillerDigit.clean_up();
}

void IMSI__L3::clean_up()
{
field_oddevenIndicator.clean_up();
field_digits.clean_up();
field_fillerDigit.clean_up();
}

const TTCN_Typedescriptor_t* IMSI__L3::get_descriptor() const { return &IMSI__L3_descr_; }
IMSI__L3& IMSI__L3::operator=(const IMSI__L3& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.IMSI_L3.");
  if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
  else field_oddevenIndicator.clean_up();
  if (other_value.digits().is_bound()) field_digits = other_value.digits();
  else field_digits.clean_up();
  if (other_value.fillerDigit().is_bound()) field_fillerDigit = other_value.fillerDigit();
  else field_fillerDigit.clean_up();
}
return *this;
}

boolean IMSI__L3::operator==(const IMSI__L3& other_value) const
{
return field_oddevenIndicator==other_value.field_oddevenIndicator
  && field_digits==other_value.field_digits
  && field_fillerDigit==other_value.field_fillerDigit;
}

boolean IMSI__L3::is_bound() const
{
return (field_oddevenIndicator.is_bound())
  || (field_digits.is_bound())
  || (OPTIONAL_OMIT == field_fillerDigit.get_selection() || field_fillerDigit.is_bound());
}
boolean IMSI__L3::is_value() const
{
return field_oddevenIndicator.is_value()
  && field_digits.is_value()
  && (OPTIONAL_OMIT == field_fillerDigit.get_selection() || field_fillerDigit.is_value());
}
int IMSI__L3::size_of() const
{
  int ret_val = 2;
  if (field_fillerDigit.ispresent()) ret_val++;
  return ret_val;
}

void IMSI__L3::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
field_digits.log();
TTCN_Logger::log_event_str(", fillerDigit := ");
field_fillerDigit.log();
TTCN_Logger::log_event_str(" }");
}

void IMSI__L3::set_implicit_omit()
{
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (digits().is_bound()) digits().set_implicit_omit();
if (!fillerDigit().is_bound()) fillerDigit() = OMIT_VALUE;
else fillerDigit().set_implicit_omit();
}

void IMSI__L3::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_CommonIE_Types.IMSI_L3 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) digits().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fillerDigit().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.IMSI_L3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.IMSI_L3");
  }
}

void IMSI__L3::encode_text(Text_Buf& text_buf) const
{
field_oddevenIndicator.encode_text(text_buf);
field_digits.encode_text(text_buf);
field_fillerDigit.encode_text(text_buf);
}

void IMSI__L3::decode_text(Text_Buf& text_buf)
{
field_oddevenIndicator.decode_text(text_buf);
field_digits.decode_text(text_buf);
field_fillerDigit.decode_text(text_buf);
}

void IMSI__L3::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 IMSI__L3::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 IMSI__L3::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oddevenIndicator.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_digits.RAW_decode(HEXSTRING_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 (limit > 0 && field_oddevenIndicator ==  bs_1){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_fillerDigit = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, IMSI__L3_fillerDigit_descr_.raw->forceomit);
  decoded_field_length = field_fillerDigit().RAW_decode(IMSI__L3_fillerDigit_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_fillerDigit = 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_fillerDigit=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int IMSI__L3::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, HEXSTRING_descr_.raw);
  if (field_fillerDigit.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMSI__L3_fillerDigit_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_oddevenIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_digits.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[1]);
  if (field_fillerDigit.ispresent()) {
  encoded_length += field_fillerDigit().RAW_encode(IMSI__L3_fillerDigit_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_fillerDigit.ispresent() && (field_oddevenIndicator !=  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::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct IMSI__L3_template::single_value_struct {
BITSTRING_template field_oddevenIndicator;
HEXSTRING_template field_digits;
BITSTRING_template field_fillerDigit;
};

void IMSI__L3_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_oddevenIndicator = ANY_VALUE;
single_value->field_digits = ANY_VALUE;
single_value->field_fillerDigit = ANY_OR_OMIT;
}
}
}

void IMSI__L3_template::copy_value(const IMSI__L3& other_value)
{
single_value = new single_value_struct;
if (other_value.oddevenIndicator().is_bound()) {
  single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
  single_value->field_oddevenIndicator.clean_up();
}
if (other_value.digits().is_bound()) {
  single_value->field_digits = other_value.digits();
} else {
  single_value->field_digits.clean_up();
}
if (other_value.fillerDigit().is_bound()) {
  if (other_value.fillerDigit().ispresent()) single_value->field_fillerDigit = other_value.fillerDigit()();
  else single_value->field_fillerDigit = OMIT_VALUE;
} else {
  single_value->field_fillerDigit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void IMSI__L3_template::copy_template(const IMSI__L3_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.oddevenIndicator().get_selection()) {
single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
single_value->field_oddevenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.digits().get_selection()) {
single_value->field_digits = other_value.digits();
} else {
single_value->field_digits.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fillerDigit().get_selection()) {
single_value->field_fillerDigit = other_value.fillerDigit();
} else {
single_value->field_fillerDigit.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 IMSI__L3_template[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 IMSI__L3_template(*other_value.implication_.precondition);
implication_.implied_template = new IMSI__L3_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_CommonIE_Types.IMSI_L3.");
break;
}
set_selection(other_value);
}

IMSI__L3_template::IMSI__L3_template()
{
}

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

IMSI__L3_template::IMSI__L3_template(const IMSI__L3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean IMSI__L3_template::match(const IMSI__L3& 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.oddevenIndicator().is_bound()) return FALSE;
if(!single_value->field_oddevenIndicator.match(other_value.oddevenIndicator(), legacy))return FALSE;
if(!other_value.digits().is_bound()) return FALSE;
if(!single_value->field_digits.match(other_value.digits(), legacy))return FALSE;
if(!other_value.fillerDigit().is_bound()) return FALSE;
if((other_value.fillerDigit().ispresent() ? !single_value->field_fillerDigit.match((const BITSTRING&)other_value.fillerDigit(), legacy) : !single_value->field_fillerDigit.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_CommonIE_Types.IMSI_L3.");
}
return FALSE;
}

boolean IMSI__L3_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_oddevenIndicator.is_bound()
 || single_value->field_digits.is_bound()
 || (single_value->field_fillerDigit.is_omit() || single_value->field_fillerDigit.is_bound());
}

boolean IMSI__L3_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_oddevenIndicator.is_value()
 && single_value->field_digits.is_value()
 && (single_value->field_fillerDigit.is_omit() || single_value->field_fillerDigit.is_value());
}

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

IMSI__L3 IMSI__L3_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_CommonIE_Types.IMSI_L3.");
IMSI__L3 ret_val;
if (single_value->field_oddevenIndicator.is_bound()) {
ret_val.oddevenIndicator() = single_value->field_oddevenIndicator.valueof();
}
if (single_value->field_digits.is_bound()) {
ret_val.digits() = single_value->field_digits.valueof();
}
if (single_value->field_fillerDigit.is_omit()) ret_val.fillerDigit() = OMIT_VALUE;
else if (single_value->field_fillerDigit.is_bound()) {
ret_val.fillerDigit() = single_value->field_fillerDigit.valueof();
}
return ret_val;
}

void IMSI__L3_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_CommonIE_Types.IMSI_L3.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new IMSI__L3_template[list_length];
}

IMSI__L3_template& IMSI__L3_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_CommonIE_Types.IMSI_L3.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.IMSI_L3.");
return value_list.list_value[list_index];
}

BITSTRING_template& IMSI__L3_template::oddevenIndicator()
{
set_specific();
return single_value->field_oddevenIndicator;
}

const BITSTRING_template& IMSI__L3_template::oddevenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddevenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.IMSI_L3.");
return single_value->field_oddevenIndicator;
}

HEXSTRING_template& IMSI__L3_template::digits()
{
set_specific();
return single_value->field_digits;
}

const HEXSTRING_template& IMSI__L3_template::digits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field digits of a non-specific template of type @MobileL3_CommonIE_Types.IMSI_L3.");
return single_value->field_digits;
}

BITSTRING_template& IMSI__L3_template::fillerDigit()
{
set_specific();
return single_value->field_fillerDigit;
}

const BITSTRING_template& IMSI__L3_template::fillerDigit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fillerDigit of a non-specific template of type @MobileL3_CommonIE_Types.IMSI_L3.");
return single_value->field_fillerDigit;
}

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

void IMSI__L3_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.log();
TTCN_Logger::log_event_str(", fillerDigit := ");
single_value->field_fillerDigit.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 IMSI__L3_template::log_match(const IMSI__L3& 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_oddevenIndicator.match(match_value.oddevenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".oddevenIndicator");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_digits.match(match_value.digits(), legacy)){
TTCN_Logger::log_logmatch_info(".digits");
single_value->field_digits.log_match(match_value.digits(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.fillerDigit().ispresent()){
if(!single_value->field_fillerDigit.match(match_value.fillerDigit(), legacy)){
TTCN_Logger::log_logmatch_info(".fillerDigit");
single_value->field_fillerDigit.log_match(match_value.fillerDigit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_fillerDigit.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".fillerDigit := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_fillerDigit.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("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.log_match(match_value.digits(), legacy);
TTCN_Logger::log_event_str(", fillerDigit := ");
if (match_value.fillerDigit().ispresent()) {
single_value->field_fillerDigit.log_match(match_value.fillerDigit(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_fillerDigit.log();
if (single_value->field_fillerDigit.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 IMSI__L3_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (digits().is_bound()) digits().set_implicit_omit();
if (!fillerDigit().is_bound()) fillerDigit() = OMIT_VALUE;
else fillerDigit().set_implicit_omit();
}

void IMSI__L3_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_oddevenIndicator.encode_text(text_buf);
single_value->field_digits.encode_text(text_buf);
single_value->field_fillerDigit.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_CommonIE_Types.IMSI_L3.");
}
}

void IMSI__L3_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_oddevenIndicator.decode_text(text_buf);
single_value->field_digits.decode_text(text_buf);
single_value->field_fillerDigit.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 IMSI__L3_template[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_CommonIE_Types.IMSI_L3.");
}
}

void IMSI__L3_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: {
    IMSI__L3_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_CommonIE_Types.IMSI_L3 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) digits().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fillerDigit().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.IMSI_L3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    IMSI__L3_template* precondition = new IMSI__L3_template;
    precondition->set_param(*param.get_elem(0));
    IMSI__L3_template* implied_template = new IMSI__L3_template;
    implied_template->set_param(*param.get_elem(1));
    *this = IMSI__L3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.IMSI_L3");
  }
  is_ifpresent = param.get_ifpresent();
}

void IMSI__L3_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_oddevenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMSI_L3");
single_value->field_digits.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMSI_L3");
single_value->field_fillerDigit.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMSI_L3");
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_CommonIE_Types.IMSI_L3");
}

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

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

IMEI__L3::IMEI__L3()
{
}

IMEI__L3::IMEI__L3(const BITSTRING& par_oddevenIndicator,
    const HEXSTRING& par_digits)
  :   field_oddevenIndicator(par_oddevenIndicator),
  field_digits(par_digits)
{
}

IMEI__L3::IMEI__L3(const IMEI__L3& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.IMEI_L3.");
if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
else field_oddevenIndicator.clean_up();
if (other_value.digits().is_bound()) field_digits = other_value.digits();
else field_digits.clean_up();
}

void IMEI__L3::clean_up()
{
field_oddevenIndicator.clean_up();
field_digits.clean_up();
}

const TTCN_Typedescriptor_t* IMEI__L3::get_descriptor() const { return &IMEI__L3_descr_; }
IMEI__L3& IMEI__L3::operator=(const IMEI__L3& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.IMEI_L3.");
  if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
  else field_oddevenIndicator.clean_up();
  if (other_value.digits().is_bound()) field_digits = other_value.digits();
  else field_digits.clean_up();
}
return *this;
}

boolean IMEI__L3::operator==(const IMEI__L3& other_value) const
{
return field_oddevenIndicator==other_value.field_oddevenIndicator
  && field_digits==other_value.field_digits;
}

boolean IMEI__L3::is_bound() const
{
return (field_oddevenIndicator.is_bound())
  || (field_digits.is_bound());
}
boolean IMEI__L3::is_value() const
{
return field_oddevenIndicator.is_value()
  && field_digits.is_value();
}
void IMEI__L3::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
field_digits.log();
TTCN_Logger::log_event_str(" }");
}

void IMEI__L3::set_implicit_omit()
{
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (digits().is_bound()) digits().set_implicit_omit();
}

void IMEI__L3::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_CommonIE_Types.IMEI_L3 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) digits().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.IMEI_L3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.IMEI_L3");
  }
}

void IMEI__L3::encode_text(Text_Buf& text_buf) const
{
field_oddevenIndicator.encode_text(text_buf);
field_digits.encode_text(text_buf);
}

void IMEI__L3::decode_text(Text_Buf& text_buf)
{
field_oddevenIndicator.decode_text(text_buf);
field_digits.decode_text(text_buf);
}

void IMEI__L3::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 IMEI__L3::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 IMEI__L3::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oddevenIndicator.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, IMEI__L3_digits_descr_.raw->forceomit);
  decoded_field_length = field_digits.RAW_decode(IMEI__L3_digits_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 IMEI__L3::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IMEI__L3_digits_descr_.raw);
  encoded_length += field_oddevenIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_digits.RAW_encode(IMEI__L3_digits_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct IMEI__L3_template::single_value_struct {
BITSTRING_template field_oddevenIndicator;
HEXSTRING_template field_digits;
};

void IMEI__L3_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_oddevenIndicator = ANY_VALUE;
single_value->field_digits = ANY_VALUE;
}
}
}

void IMEI__L3_template::copy_value(const IMEI__L3& other_value)
{
single_value = new single_value_struct;
if (other_value.oddevenIndicator().is_bound()) {
  single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
  single_value->field_oddevenIndicator.clean_up();
}
if (other_value.digits().is_bound()) {
  single_value->field_digits = other_value.digits();
} else {
  single_value->field_digits.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void IMEI__L3_template::copy_template(const IMEI__L3_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.oddevenIndicator().get_selection()) {
single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
single_value->field_oddevenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.digits().get_selection()) {
single_value->field_digits = other_value.digits();
} else {
single_value->field_digits.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 IMEI__L3_template[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 IMEI__L3_template(*other_value.implication_.precondition);
implication_.implied_template = new IMEI__L3_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_CommonIE_Types.IMEI_L3.");
break;
}
set_selection(other_value);
}

IMEI__L3_template::IMEI__L3_template()
{
}

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

IMEI__L3_template::IMEI__L3_template(const IMEI__L3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean IMEI__L3_template::match(const IMEI__L3& 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.oddevenIndicator().is_bound()) return FALSE;
if(!single_value->field_oddevenIndicator.match(other_value.oddevenIndicator(), legacy))return FALSE;
if(!other_value.digits().is_bound()) return FALSE;
if(!single_value->field_digits.match(other_value.digits(), 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_CommonIE_Types.IMEI_L3.");
}
return FALSE;
}

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

boolean IMEI__L3_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_oddevenIndicator.is_value()
 && single_value->field_digits.is_value();
}

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

IMEI__L3 IMEI__L3_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_CommonIE_Types.IMEI_L3.");
IMEI__L3 ret_val;
if (single_value->field_oddevenIndicator.is_bound()) {
ret_val.oddevenIndicator() = single_value->field_oddevenIndicator.valueof();
}
if (single_value->field_digits.is_bound()) {
ret_val.digits() = single_value->field_digits.valueof();
}
return ret_val;
}

void IMEI__L3_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_CommonIE_Types.IMEI_L3.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new IMEI__L3_template[list_length];
}

IMEI__L3_template& IMEI__L3_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_CommonIE_Types.IMEI_L3.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.IMEI_L3.");
return value_list.list_value[list_index];
}

BITSTRING_template& IMEI__L3_template::oddevenIndicator()
{
set_specific();
return single_value->field_oddevenIndicator;
}

const BITSTRING_template& IMEI__L3_template::oddevenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddevenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.IMEI_L3.");
return single_value->field_oddevenIndicator;
}

HEXSTRING_template& IMEI__L3_template::digits()
{
set_specific();
return single_value->field_digits;
}

const HEXSTRING_template& IMEI__L3_template::digits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field digits of a non-specific template of type @MobileL3_CommonIE_Types.IMEI_L3.");
return single_value->field_digits;
}

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

void IMEI__L3_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.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 IMEI__L3_template::log_match(const IMEI__L3& 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_oddevenIndicator.match(match_value.oddevenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".oddevenIndicator");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_digits.match(match_value.digits(), legacy)){
TTCN_Logger::log_logmatch_info(".digits");
single_value->field_digits.log_match(match_value.digits(), 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("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.log_match(match_value.digits(), 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 IMEI__L3_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (digits().is_bound()) digits().set_implicit_omit();
}

void IMEI__L3_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_oddevenIndicator.encode_text(text_buf);
single_value->field_digits.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_CommonIE_Types.IMEI_L3.");
}
}

void IMEI__L3_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_oddevenIndicator.decode_text(text_buf);
single_value->field_digits.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 IMEI__L3_template[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_CommonIE_Types.IMEI_L3.");
}
}

void IMEI__L3_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: {
    IMEI__L3_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_CommonIE_Types.IMEI_L3 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) digits().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.IMEI_L3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    IMEI__L3_template* precondition = new IMEI__L3_template;
    precondition->set_param(*param.get_elem(0));
    IMEI__L3_template* implied_template = new IMEI__L3_template;
    implied_template->set_param(*param.get_elem(1));
    *this = IMEI__L3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.IMEI_L3");
  }
  is_ifpresent = param.get_ifpresent();
}

void IMEI__L3_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_oddevenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMEI_L3");
single_value->field_digits.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMEI_L3");
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_CommonIE_Types.IMEI_L3");
}

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

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

IMEI__SV::IMEI__SV()
{
}

IMEI__SV::IMEI__SV(const BITSTRING& par_oddevenIndicator,
    const HEXSTRING& par_digits,
    const BITSTRING& par_fillerDigit)
  :   field_oddevenIndicator(par_oddevenIndicator),
  field_digits(par_digits),
  field_fillerDigit(par_fillerDigit)
{
}

IMEI__SV::IMEI__SV(const IMEI__SV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.IMEI_SV.");
if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
else field_oddevenIndicator.clean_up();
if (other_value.digits().is_bound()) field_digits = other_value.digits();
else field_digits.clean_up();
if (other_value.fillerDigit().is_bound()) field_fillerDigit = other_value.fillerDigit();
else field_fillerDigit.clean_up();
}

void IMEI__SV::clean_up()
{
field_oddevenIndicator.clean_up();
field_digits.clean_up();
field_fillerDigit.clean_up();
}

const TTCN_Typedescriptor_t* IMEI__SV::get_descriptor() const { return &IMEI__SV_descr_; }
IMEI__SV& IMEI__SV::operator=(const IMEI__SV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.IMEI_SV.");
  if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
  else field_oddevenIndicator.clean_up();
  if (other_value.digits().is_bound()) field_digits = other_value.digits();
  else field_digits.clean_up();
  if (other_value.fillerDigit().is_bound()) field_fillerDigit = other_value.fillerDigit();
  else field_fillerDigit.clean_up();
}
return *this;
}

boolean IMEI__SV::operator==(const IMEI__SV& other_value) const
{
return field_oddevenIndicator==other_value.field_oddevenIndicator
  && field_digits==other_value.field_digits
  && field_fillerDigit==other_value.field_fillerDigit;
}

boolean IMEI__SV::is_bound() const
{
return (field_oddevenIndicator.is_bound())
  || (field_digits.is_bound())
  || (field_fillerDigit.is_bound());
}
boolean IMEI__SV::is_value() const
{
return field_oddevenIndicator.is_value()
  && field_digits.is_value()
  && field_fillerDigit.is_value();
}
void IMEI__SV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
field_digits.log();
TTCN_Logger::log_event_str(", fillerDigit := ");
field_fillerDigit.log();
TTCN_Logger::log_event_str(" }");
}

void IMEI__SV::set_implicit_omit()
{
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (digits().is_bound()) digits().set_implicit_omit();
if (fillerDigit().is_bound()) fillerDigit().set_implicit_omit();
}

void IMEI__SV::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_CommonIE_Types.IMEI_SV 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) digits().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fillerDigit().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.IMEI_SV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.IMEI_SV");
  }
}

void IMEI__SV::encode_text(Text_Buf& text_buf) const
{
field_oddevenIndicator.encode_text(text_buf);
field_digits.encode_text(text_buf);
field_fillerDigit.encode_text(text_buf);
}

void IMEI__SV::decode_text(Text_Buf& text_buf)
{
field_oddevenIndicator.decode_text(text_buf);
field_digits.decode_text(text_buf);
field_fillerDigit.decode_text(text_buf);
}

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

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

struct IMEI__SV_template::single_value_struct {
BITSTRING_template field_oddevenIndicator;
HEXSTRING_template field_digits;
BITSTRING_template field_fillerDigit;
};

void IMEI__SV_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_oddevenIndicator = ANY_VALUE;
single_value->field_digits = ANY_VALUE;
single_value->field_fillerDigit = ANY_VALUE;
}
}
}

void IMEI__SV_template::copy_value(const IMEI__SV& other_value)
{
single_value = new single_value_struct;
if (other_value.oddevenIndicator().is_bound()) {
  single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
  single_value->field_oddevenIndicator.clean_up();
}
if (other_value.digits().is_bound()) {
  single_value->field_digits = other_value.digits();
} else {
  single_value->field_digits.clean_up();
}
if (other_value.fillerDigit().is_bound()) {
  single_value->field_fillerDigit = other_value.fillerDigit();
} else {
  single_value->field_fillerDigit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void IMEI__SV_template::copy_template(const IMEI__SV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.oddevenIndicator().get_selection()) {
single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
single_value->field_oddevenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.digits().get_selection()) {
single_value->field_digits = other_value.digits();
} else {
single_value->field_digits.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fillerDigit().get_selection()) {
single_value->field_fillerDigit = other_value.fillerDigit();
} else {
single_value->field_fillerDigit.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 IMEI__SV_template[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 IMEI__SV_template(*other_value.implication_.precondition);
implication_.implied_template = new IMEI__SV_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_CommonIE_Types.IMEI_SV.");
break;
}
set_selection(other_value);
}

IMEI__SV_template::IMEI__SV_template()
{
}

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

IMEI__SV_template::IMEI__SV_template(const IMEI__SV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean IMEI__SV_template::match(const IMEI__SV& 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.oddevenIndicator().is_bound()) return FALSE;
if(!single_value->field_oddevenIndicator.match(other_value.oddevenIndicator(), legacy))return FALSE;
if(!other_value.digits().is_bound()) return FALSE;
if(!single_value->field_digits.match(other_value.digits(), legacy))return FALSE;
if(!other_value.fillerDigit().is_bound()) return FALSE;
if(!single_value->field_fillerDigit.match(other_value.fillerDigit(), 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_CommonIE_Types.IMEI_SV.");
}
return FALSE;
}

boolean IMEI__SV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_oddevenIndicator.is_bound()
 || single_value->field_digits.is_bound()
 || single_value->field_fillerDigit.is_bound();
}

boolean IMEI__SV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_oddevenIndicator.is_value()
 && single_value->field_digits.is_value()
 && single_value->field_fillerDigit.is_value();
}

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

IMEI__SV IMEI__SV_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_CommonIE_Types.IMEI_SV.");
IMEI__SV ret_val;
if (single_value->field_oddevenIndicator.is_bound()) {
ret_val.oddevenIndicator() = single_value->field_oddevenIndicator.valueof();
}
if (single_value->field_digits.is_bound()) {
ret_val.digits() = single_value->field_digits.valueof();
}
if (single_value->field_fillerDigit.is_bound()) {
ret_val.fillerDigit() = single_value->field_fillerDigit.valueof();
}
return ret_val;
}

void IMEI__SV_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_CommonIE_Types.IMEI_SV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new IMEI__SV_template[list_length];
}

IMEI__SV_template& IMEI__SV_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_CommonIE_Types.IMEI_SV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.IMEI_SV.");
return value_list.list_value[list_index];
}

BITSTRING_template& IMEI__SV_template::oddevenIndicator()
{
set_specific();
return single_value->field_oddevenIndicator;
}

const BITSTRING_template& IMEI__SV_template::oddevenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddevenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.IMEI_SV.");
return single_value->field_oddevenIndicator;
}

HEXSTRING_template& IMEI__SV_template::digits()
{
set_specific();
return single_value->field_digits;
}

const HEXSTRING_template& IMEI__SV_template::digits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field digits of a non-specific template of type @MobileL3_CommonIE_Types.IMEI_SV.");
return single_value->field_digits;
}

BITSTRING_template& IMEI__SV_template::fillerDigit()
{
set_specific();
return single_value->field_fillerDigit;
}

const BITSTRING_template& IMEI__SV_template::fillerDigit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fillerDigit of a non-specific template of type @MobileL3_CommonIE_Types.IMEI_SV.");
return single_value->field_fillerDigit;
}

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

void IMEI__SV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.log();
TTCN_Logger::log_event_str(", fillerDigit := ");
single_value->field_fillerDigit.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 IMEI__SV_template::log_match(const IMEI__SV& 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_oddevenIndicator.match(match_value.oddevenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".oddevenIndicator");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_digits.match(match_value.digits(), legacy)){
TTCN_Logger::log_logmatch_info(".digits");
single_value->field_digits.log_match(match_value.digits(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fillerDigit.match(match_value.fillerDigit(), legacy)){
TTCN_Logger::log_logmatch_info(".fillerDigit");
single_value->field_fillerDigit.log_match(match_value.fillerDigit(), 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("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.log_match(match_value.digits(), legacy);
TTCN_Logger::log_event_str(", fillerDigit := ");
single_value->field_fillerDigit.log_match(match_value.fillerDigit(), 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 IMEI__SV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (digits().is_bound()) digits().set_implicit_omit();
if (fillerDigit().is_bound()) fillerDigit().set_implicit_omit();
}

void IMEI__SV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_oddevenIndicator.encode_text(text_buf);
single_value->field_digits.encode_text(text_buf);
single_value->field_fillerDigit.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_CommonIE_Types.IMEI_SV.");
}
}

void IMEI__SV_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_oddevenIndicator.decode_text(text_buf);
single_value->field_digits.decode_text(text_buf);
single_value->field_fillerDigit.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 IMEI__SV_template[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_CommonIE_Types.IMEI_SV.");
}
}

void IMEI__SV_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: {
    IMEI__SV_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_CommonIE_Types.IMEI_SV 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) digits().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fillerDigit().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.IMEI_SV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    IMEI__SV_template* precondition = new IMEI__SV_template;
    precondition->set_param(*param.get_elem(0));
    IMEI__SV_template* implied_template = new IMEI__SV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = IMEI__SV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.IMEI_SV");
  }
  is_ifpresent = param.get_ifpresent();
}

void IMEI__SV_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_oddevenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMEI_SV");
single_value->field_digits.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMEI_SV");
single_value->field_fillerDigit.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.IMEI_SV");
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_CommonIE_Types.IMEI_SV");
}

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

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

TMSI__PTMSI::TMSI__PTMSI()
{
}

TMSI__PTMSI::TMSI__PTMSI(const BITSTRING& par_oddevenIndicator,
    const BITSTRING& par_fillerDigit,
    const OCTETSTRING& par_octets)
  :   field_oddevenIndicator(par_oddevenIndicator),
  field_fillerDigit(par_fillerDigit),
  field_octets(par_octets)
{
}

TMSI__PTMSI::TMSI__PTMSI(const TMSI__PTMSI& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.TMSI_PTMSI.");
if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
else field_oddevenIndicator.clean_up();
if (other_value.fillerDigit().is_bound()) field_fillerDigit = other_value.fillerDigit();
else field_fillerDigit.clean_up();
if (other_value.octets().is_bound()) field_octets = other_value.octets();
else field_octets.clean_up();
}

void TMSI__PTMSI::clean_up()
{
field_oddevenIndicator.clean_up();
field_fillerDigit.clean_up();
field_octets.clean_up();
}

const TTCN_Typedescriptor_t* TMSI__PTMSI::get_descriptor() const { return &TMSI__PTMSI_descr_; }
TMSI__PTMSI& TMSI__PTMSI::operator=(const TMSI__PTMSI& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.TMSI_PTMSI.");
  if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
  else field_oddevenIndicator.clean_up();
  if (other_value.fillerDigit().is_bound()) field_fillerDigit = other_value.fillerDigit();
  else field_fillerDigit.clean_up();
  if (other_value.octets().is_bound()) field_octets = other_value.octets();
  else field_octets.clean_up();
}
return *this;
}

boolean TMSI__PTMSI::operator==(const TMSI__PTMSI& other_value) const
{
return field_oddevenIndicator==other_value.field_oddevenIndicator
  && field_fillerDigit==other_value.field_fillerDigit
  && field_octets==other_value.field_octets;
}

boolean TMSI__PTMSI::is_bound() const
{
return (field_oddevenIndicator.is_bound())
  || (field_fillerDigit.is_bound())
  || (field_octets.is_bound());
}
boolean TMSI__PTMSI::is_value() const
{
return field_oddevenIndicator.is_value()
  && field_fillerDigit.is_value()
  && field_octets.is_value();
}
void TMSI__PTMSI::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", fillerDigit := ");
field_fillerDigit.log();
TTCN_Logger::log_event_str(", octets := ");
field_octets.log();
TTCN_Logger::log_event_str(" }");
}

void TMSI__PTMSI::set_implicit_omit()
{
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (fillerDigit().is_bound()) fillerDigit().set_implicit_omit();
if (octets().is_bound()) octets().set_implicit_omit();
}

void TMSI__PTMSI::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_CommonIE_Types.TMSI_PTMSI 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fillerDigit().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) octets().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.TMSI_PTMSI: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.TMSI_PTMSI");
  }
}

void TMSI__PTMSI::encode_text(Text_Buf& text_buf) const
{
field_oddevenIndicator.encode_text(text_buf);
field_fillerDigit.encode_text(text_buf);
field_octets.encode_text(text_buf);
}

void TMSI__PTMSI::decode_text(Text_Buf& text_buf)
{
field_oddevenIndicator.decode_text(text_buf);
field_fillerDigit.decode_text(text_buf);
field_octets.decode_text(text_buf);
}

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

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

struct TMSI__PTMSI_template::single_value_struct {
BITSTRING_template field_oddevenIndicator;
BITSTRING_template field_fillerDigit;
OCTETSTRING_template field_octets;
};

void TMSI__PTMSI_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_oddevenIndicator = ANY_VALUE;
single_value->field_fillerDigit = ANY_VALUE;
single_value->field_octets = ANY_VALUE;
}
}
}

void TMSI__PTMSI_template::copy_value(const TMSI__PTMSI& other_value)
{
single_value = new single_value_struct;
if (other_value.oddevenIndicator().is_bound()) {
  single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
  single_value->field_oddevenIndicator.clean_up();
}
if (other_value.fillerDigit().is_bound()) {
  single_value->field_fillerDigit = other_value.fillerDigit();
} else {
  single_value->field_fillerDigit.clean_up();
}
if (other_value.octets().is_bound()) {
  single_value->field_octets = other_value.octets();
} else {
  single_value->field_octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TMSI__PTMSI_template::copy_template(const TMSI__PTMSI_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.oddevenIndicator().get_selection()) {
single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
single_value->field_oddevenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fillerDigit().get_selection()) {
single_value->field_fillerDigit = other_value.fillerDigit();
} else {
single_value->field_fillerDigit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.octets().get_selection()) {
single_value->field_octets = other_value.octets();
} else {
single_value->field_octets.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 TMSI__PTMSI_template[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 TMSI__PTMSI_template(*other_value.implication_.precondition);
implication_.implied_template = new TMSI__PTMSI_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_CommonIE_Types.TMSI_PTMSI.");
break;
}
set_selection(other_value);
}

TMSI__PTMSI_template::TMSI__PTMSI_template()
{
}

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

TMSI__PTMSI_template::TMSI__PTMSI_template(const TMSI__PTMSI& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TMSI__PTMSI_template::match(const TMSI__PTMSI& 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.oddevenIndicator().is_bound()) return FALSE;
if(!single_value->field_oddevenIndicator.match(other_value.oddevenIndicator(), legacy))return FALSE;
if(!other_value.fillerDigit().is_bound()) return FALSE;
if(!single_value->field_fillerDigit.match(other_value.fillerDigit(), legacy))return FALSE;
if(!other_value.octets().is_bound()) return FALSE;
if(!single_value->field_octets.match(other_value.octets(), 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_CommonIE_Types.TMSI_PTMSI.");
}
return FALSE;
}

boolean TMSI__PTMSI_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_oddevenIndicator.is_bound()
 || single_value->field_fillerDigit.is_bound()
 || single_value->field_octets.is_bound();
}

boolean TMSI__PTMSI_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_oddevenIndicator.is_value()
 && single_value->field_fillerDigit.is_value()
 && single_value->field_octets.is_value();
}

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

TMSI__PTMSI TMSI__PTMSI_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_CommonIE_Types.TMSI_PTMSI.");
TMSI__PTMSI ret_val;
if (single_value->field_oddevenIndicator.is_bound()) {
ret_val.oddevenIndicator() = single_value->field_oddevenIndicator.valueof();
}
if (single_value->field_fillerDigit.is_bound()) {
ret_val.fillerDigit() = single_value->field_fillerDigit.valueof();
}
if (single_value->field_octets.is_bound()) {
ret_val.octets() = single_value->field_octets.valueof();
}
return ret_val;
}

void TMSI__PTMSI_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_CommonIE_Types.TMSI_PTMSI.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TMSI__PTMSI_template[list_length];
}

TMSI__PTMSI_template& TMSI__PTMSI_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_CommonIE_Types.TMSI_PTMSI.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.TMSI_PTMSI.");
return value_list.list_value[list_index];
}

BITSTRING_template& TMSI__PTMSI_template::oddevenIndicator()
{
set_specific();
return single_value->field_oddevenIndicator;
}

const BITSTRING_template& TMSI__PTMSI_template::oddevenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddevenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.TMSI_PTMSI.");
return single_value->field_oddevenIndicator;
}

BITSTRING_template& TMSI__PTMSI_template::fillerDigit()
{
set_specific();
return single_value->field_fillerDigit;
}

const BITSTRING_template& TMSI__PTMSI_template::fillerDigit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fillerDigit of a non-specific template of type @MobileL3_CommonIE_Types.TMSI_PTMSI.");
return single_value->field_fillerDigit;
}

OCTETSTRING_template& TMSI__PTMSI_template::octets()
{
set_specific();
return single_value->field_octets;
}

const OCTETSTRING_template& TMSI__PTMSI_template::octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field octets of a non-specific template of type @MobileL3_CommonIE_Types.TMSI_PTMSI.");
return single_value->field_octets;
}

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

void TMSI__PTMSI_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", fillerDigit := ");
single_value->field_fillerDigit.log();
TTCN_Logger::log_event_str(", octets := ");
single_value->field_octets.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 TMSI__PTMSI_template::log_match(const TMSI__PTMSI& 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_oddevenIndicator.match(match_value.oddevenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".oddevenIndicator");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fillerDigit.match(match_value.fillerDigit(), legacy)){
TTCN_Logger::log_logmatch_info(".fillerDigit");
single_value->field_fillerDigit.log_match(match_value.fillerDigit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_octets.match(match_value.octets(), legacy)){
TTCN_Logger::log_logmatch_info(".octets");
single_value->field_octets.log_match(match_value.octets(), 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("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::log_event_str(", fillerDigit := ");
single_value->field_fillerDigit.log_match(match_value.fillerDigit(), legacy);
TTCN_Logger::log_event_str(", octets := ");
single_value->field_octets.log_match(match_value.octets(), 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 TMSI__PTMSI_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (fillerDigit().is_bound()) fillerDigit().set_implicit_omit();
if (octets().is_bound()) octets().set_implicit_omit();
}

void TMSI__PTMSI_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_oddevenIndicator.encode_text(text_buf);
single_value->field_fillerDigit.encode_text(text_buf);
single_value->field_octets.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_CommonIE_Types.TMSI_PTMSI.");
}
}

void TMSI__PTMSI_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_oddevenIndicator.decode_text(text_buf);
single_value->field_fillerDigit.decode_text(text_buf);
single_value->field_octets.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 TMSI__PTMSI_template[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_CommonIE_Types.TMSI_PTMSI.");
}
}

void TMSI__PTMSI_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: {
    TMSI__PTMSI_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_CommonIE_Types.TMSI_PTMSI 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fillerDigit().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) octets().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.TMSI_PTMSI: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TMSI__PTMSI_template* precondition = new TMSI__PTMSI_template;
    precondition->set_param(*param.get_elem(0));
    TMSI__PTMSI_template* implied_template = new TMSI__PTMSI_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TMSI__PTMSI_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.TMSI_PTMSI");
  }
  is_ifpresent = param.get_ifpresent();
}

void TMSI__PTMSI_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_oddevenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMSI_PTMSI");
single_value->field_fillerDigit.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMSI_PTMSI");
single_value->field_octets.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMSI_PTMSI");
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_CommonIE_Types.TMSI_PTMSI");
}

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

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

TMGI__and__MBMS__SessionID::TMGI__and__MBMS__SessionID()
{
}

TMGI__and__MBMS__SessionID::TMGI__and__MBMS__SessionID(const BITSTRING& par_oddevenIndicator,
    const BITSTRING& par_mCC__MNCIndicator,
    const BITSTRING& par_mBMS__SessionIdentityIndicator,
    const BITSTRING& par_spare,
    const OCTETSTRING& par_mBMS__ServiceID,
    const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2,
    const OCTETSTRING& par_mBMS__SessionIdentity)
  :   field_oddevenIndicator(par_oddevenIndicator),
  field_mCC__MNCIndicator(par_mCC__MNCIndicator),
  field_mBMS__SessionIdentityIndicator(par_mBMS__SessionIdentityIndicator),
  field_spare(par_spare),
  field_mBMS__ServiceID(par_mBMS__ServiceID),
  field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2),
  field_mBMS__SessionIdentity(par_mBMS__SessionIdentity)
{
}

TMGI__and__MBMS__SessionID::TMGI__and__MBMS__SessionID(const TMGI__and__MBMS__SessionID& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
else field_oddevenIndicator.clean_up();
if (other_value.mCC__MNCIndicator().is_bound()) field_mCC__MNCIndicator = other_value.mCC__MNCIndicator();
else field_mCC__MNCIndicator.clean_up();
if (other_value.mBMS__SessionIdentityIndicator().is_bound()) field_mBMS__SessionIdentityIndicator = other_value.mBMS__SessionIdentityIndicator();
else field_mBMS__SessionIdentityIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.mBMS__ServiceID().is_bound()) field_mBMS__ServiceID = other_value.mBMS__ServiceID();
else field_mBMS__ServiceID.clean_up();
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
if (other_value.mBMS__SessionIdentity().is_bound()) field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity();
else field_mBMS__SessionIdentity.clean_up();
}

void TMGI__and__MBMS__SessionID::clean_up()
{
field_oddevenIndicator.clean_up();
field_mCC__MNCIndicator.clean_up();
field_mBMS__SessionIdentityIndicator.clean_up();
field_spare.clean_up();
field_mBMS__ServiceID.clean_up();
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
field_mBMS__SessionIdentity.clean_up();
}

const TTCN_Typedescriptor_t* TMGI__and__MBMS__SessionID::get_descriptor() const { return &TMGI__and__MBMS__SessionID_descr_; }
TMGI__and__MBMS__SessionID& TMGI__and__MBMS__SessionID::operator=(const TMGI__and__MBMS__SessionID& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
  if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
  else field_oddevenIndicator.clean_up();
  if (other_value.mCC__MNCIndicator().is_bound()) field_mCC__MNCIndicator = other_value.mCC__MNCIndicator();
  else field_mCC__MNCIndicator.clean_up();
  if (other_value.mBMS__SessionIdentityIndicator().is_bound()) field_mBMS__SessionIdentityIndicator = other_value.mBMS__SessionIdentityIndicator();
  else field_mBMS__SessionIdentityIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.mBMS__ServiceID().is_bound()) field_mBMS__ServiceID = other_value.mBMS__ServiceID();
  else field_mBMS__ServiceID.clean_up();
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
  if (other_value.mBMS__SessionIdentity().is_bound()) field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity();
  else field_mBMS__SessionIdentity.clean_up();
}
return *this;
}

boolean TMGI__and__MBMS__SessionID::operator==(const TMGI__and__MBMS__SessionID& other_value) const
{
return field_oddevenIndicator==other_value.field_oddevenIndicator
  && field_mCC__MNCIndicator==other_value.field_mCC__MNCIndicator
  && field_mBMS__SessionIdentityIndicator==other_value.field_mBMS__SessionIdentityIndicator
  && field_spare==other_value.field_spare
  && field_mBMS__ServiceID==other_value.field_mBMS__ServiceID
  && field_mccDigit1==other_value.field_mccDigit1
  && field_mccDigit2==other_value.field_mccDigit2
  && field_mccDigit3==other_value.field_mccDigit3
  && field_mncDigit3==other_value.field_mncDigit3
  && field_mncDigit1==other_value.field_mncDigit1
  && field_mncDigit2==other_value.field_mncDigit2
  && field_mBMS__SessionIdentity==other_value.field_mBMS__SessionIdentity;
}

boolean TMGI__and__MBMS__SessionID::is_bound() const
{
return (field_oddevenIndicator.is_bound())
  || (field_mCC__MNCIndicator.is_bound())
  || (field_mBMS__SessionIdentityIndicator.is_bound())
  || (field_spare.is_bound())
  || (field_mBMS__ServiceID.is_bound())
  || (field_mccDigit1.is_bound())
  || (field_mccDigit2.is_bound())
  || (field_mccDigit3.is_bound())
  || (field_mncDigit3.is_bound())
  || (field_mncDigit1.is_bound())
  || (field_mncDigit2.is_bound())
  || (field_mBMS__SessionIdentity.is_bound());
}
boolean TMGI__and__MBMS__SessionID::is_value() const
{
return field_oddevenIndicator.is_value()
  && field_mCC__MNCIndicator.is_value()
  && field_mBMS__SessionIdentityIndicator.is_value()
  && field_spare.is_value()
  && field_mBMS__ServiceID.is_value()
  && field_mccDigit1.is_value()
  && field_mccDigit2.is_value()
  && field_mccDigit3.is_value()
  && field_mncDigit3.is_value()
  && field_mncDigit1.is_value()
  && field_mncDigit2.is_value()
  && field_mBMS__SessionIdentity.is_value();
}
void TMGI__and__MBMS__SessionID::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", mCC_MNCIndicator := ");
field_mCC__MNCIndicator.log();
TTCN_Logger::log_event_str(", mBMS_SessionIdentityIndicator := ");
field_mBMS__SessionIdentityIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", mBMS_ServiceID := ");
field_mBMS__ServiceID.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
field_mncDigit2.log();
TTCN_Logger::log_event_str(", mBMS_SessionIdentity := ");
field_mBMS__SessionIdentity.log();
TTCN_Logger::log_event_str(" }");
}

void TMGI__and__MBMS__SessionID::set_implicit_omit()
{
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (mCC__MNCIndicator().is_bound()) mCC__MNCIndicator().set_implicit_omit();
if (mBMS__SessionIdentityIndicator().is_bound()) mBMS__SessionIdentityIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (mBMS__ServiceID().is_bound()) mBMS__ServiceID().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
if (mBMS__SessionIdentity().is_bound()) mBMS__SessionIdentity().set_implicit_omit();
}

void TMGI__and__MBMS__SessionID::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record value of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mCC__MNCIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionIdentityIndicator().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) mBMS__ServiceID().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionIdentity().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mCC_MNCIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mCC__MNCIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_SessionIdentityIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionIdentityIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "mBMS_ServiceID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ServiceID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_SessionIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
  }
}

void TMGI__and__MBMS__SessionID::encode_text(Text_Buf& text_buf) const
{
field_oddevenIndicator.encode_text(text_buf);
field_mCC__MNCIndicator.encode_text(text_buf);
field_mBMS__SessionIdentityIndicator.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_mBMS__ServiceID.encode_text(text_buf);
field_mccDigit1.encode_text(text_buf);
field_mccDigit2.encode_text(text_buf);
field_mccDigit3.encode_text(text_buf);
field_mncDigit3.encode_text(text_buf);
field_mncDigit1.encode_text(text_buf);
field_mncDigit2.encode_text(text_buf);
field_mBMS__SessionIdentity.encode_text(text_buf);
}

void TMGI__and__MBMS__SessionID::decode_text(Text_Buf& text_buf)
{
field_oddevenIndicator.decode_text(text_buf);
field_mCC__MNCIndicator.decode_text(text_buf);
field_mBMS__SessionIdentityIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_mBMS__ServiceID.decode_text(text_buf);
field_mccDigit1.decode_text(text_buf);
field_mccDigit2.decode_text(text_buf);
field_mccDigit3.decode_text(text_buf);
field_mncDigit3.decode_text(text_buf);
field_mncDigit1.decode_text(text_buf);
field_mncDigit2.decode_text(text_buf);
field_mBMS__SessionIdentity.decode_text(text_buf);
}

void TMGI__and__MBMS__SessionID::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 TMGI__and__MBMS__SessionID::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 TMGI__and__MBMS__SessionID::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oddevenIndicator.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_mCC__MNCIndicator.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_mBMS__SessionIdentityIndicator.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ServiceID.RAW_decode(General__Types::OCT3_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::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_9_force_omit(9, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_10_force_omit(10, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_11_force_omit(11, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__SessionIdentity.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TMGI__and__MBMS__SessionID::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 12;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::OCT3_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, General__Types::OCT1_descr_.raw);
  encoded_length += field_oddevenIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mCC__MNCIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mBMS__SessionIdentityIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mBMS__ServiceID.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[10]);
  encoded_length += field_mBMS__SessionIdentity.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[11]);
  return myleaf.length = encoded_length;
}

struct TMGI__and__MBMS__SessionID_template::single_value_struct {
BITSTRING_template field_oddevenIndicator;
BITSTRING_template field_mCC__MNCIndicator;
BITSTRING_template field_mBMS__SessionIdentityIndicator;
BITSTRING_template field_spare;
OCTETSTRING_template field_mBMS__ServiceID;
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
OCTETSTRING_template field_mBMS__SessionIdentity;
};

void TMGI__and__MBMS__SessionID_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_oddevenIndicator = ANY_VALUE;
single_value->field_mCC__MNCIndicator = ANY_VALUE;
single_value->field_mBMS__SessionIdentityIndicator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_mBMS__ServiceID = ANY_VALUE;
single_value->field_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
single_value->field_mBMS__SessionIdentity = ANY_VALUE;
}
}
}

void TMGI__and__MBMS__SessionID_template::copy_value(const TMGI__and__MBMS__SessionID& other_value)
{
single_value = new single_value_struct;
if (other_value.oddevenIndicator().is_bound()) {
  single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
  single_value->field_oddevenIndicator.clean_up();
}
if (other_value.mCC__MNCIndicator().is_bound()) {
  single_value->field_mCC__MNCIndicator = other_value.mCC__MNCIndicator();
} else {
  single_value->field_mCC__MNCIndicator.clean_up();
}
if (other_value.mBMS__SessionIdentityIndicator().is_bound()) {
  single_value->field_mBMS__SessionIdentityIndicator = other_value.mBMS__SessionIdentityIndicator();
} else {
  single_value->field_mBMS__SessionIdentityIndicator.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.mBMS__ServiceID().is_bound()) {
  single_value->field_mBMS__ServiceID = other_value.mBMS__ServiceID();
} else {
  single_value->field_mBMS__ServiceID.clean_up();
}
if (other_value.mccDigit1().is_bound()) {
  single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
  single_value->field_mccDigit1.clean_up();
}
if (other_value.mccDigit2().is_bound()) {
  single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
  single_value->field_mccDigit2.clean_up();
}
if (other_value.mccDigit3().is_bound()) {
  single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
  single_value->field_mccDigit3.clean_up();
}
if (other_value.mncDigit3().is_bound()) {
  single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
  single_value->field_mncDigit3.clean_up();
}
if (other_value.mncDigit1().is_bound()) {
  single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
  single_value->field_mncDigit1.clean_up();
}
if (other_value.mncDigit2().is_bound()) {
  single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
  single_value->field_mncDigit2.clean_up();
}
if (other_value.mBMS__SessionIdentity().is_bound()) {
  single_value->field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity();
} else {
  single_value->field_mBMS__SessionIdentity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TMGI__and__MBMS__SessionID_template::copy_template(const TMGI__and__MBMS__SessionID_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.oddevenIndicator().get_selection()) {
single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
single_value->field_oddevenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mCC__MNCIndicator().get_selection()) {
single_value->field_mCC__MNCIndicator = other_value.mCC__MNCIndicator();
} else {
single_value->field_mCC__MNCIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__SessionIdentityIndicator().get_selection()) {
single_value->field_mBMS__SessionIdentityIndicator = other_value.mBMS__SessionIdentityIndicator();
} else {
single_value->field_mBMS__SessionIdentityIndicator.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.mBMS__ServiceID().get_selection()) {
single_value->field_mBMS__ServiceID = other_value.mBMS__ServiceID();
} else {
single_value->field_mBMS__ServiceID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit1().get_selection()) {
single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
single_value->field_mccDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit2().get_selection()) {
single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
single_value->field_mccDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit3().get_selection()) {
single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
single_value->field_mccDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit3().get_selection()) {
single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
single_value->field_mncDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit1().get_selection()) {
single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
single_value->field_mncDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit2().get_selection()) {
single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
single_value->field_mncDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__SessionIdentity().get_selection()) {
single_value->field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity();
} else {
single_value->field_mBMS__SessionIdentity.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 TMGI__and__MBMS__SessionID_template[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 TMGI__and__MBMS__SessionID_template(*other_value.implication_.precondition);
implication_.implied_template = new TMGI__and__MBMS__SessionID_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_CommonIE_Types.TMGI_and_MBMS_SessionID.");
break;
}
set_selection(other_value);
}

TMGI__and__MBMS__SessionID_template::TMGI__and__MBMS__SessionID_template()
{
}

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

TMGI__and__MBMS__SessionID_template::TMGI__and__MBMS__SessionID_template(const TMGI__and__MBMS__SessionID& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TMGI__and__MBMS__SessionID_template::match(const TMGI__and__MBMS__SessionID& 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.oddevenIndicator().is_bound()) return FALSE;
if(!single_value->field_oddevenIndicator.match(other_value.oddevenIndicator(), legacy))return FALSE;
if(!other_value.mCC__MNCIndicator().is_bound()) return FALSE;
if(!single_value->field_mCC__MNCIndicator.match(other_value.mCC__MNCIndicator(), legacy))return FALSE;
if(!other_value.mBMS__SessionIdentityIndicator().is_bound()) return FALSE;
if(!single_value->field_mBMS__SessionIdentityIndicator.match(other_value.mBMS__SessionIdentityIndicator(), 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.mBMS__ServiceID().is_bound()) return FALSE;
if(!single_value->field_mBMS__ServiceID.match(other_value.mBMS__ServiceID(), legacy))return FALSE;
if(!other_value.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), legacy))return FALSE;
if(!other_value.mBMS__SessionIdentity().is_bound()) return FALSE;
if(!single_value->field_mBMS__SessionIdentity.match(other_value.mBMS__SessionIdentity(), 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_CommonIE_Types.TMGI_and_MBMS_SessionID.");
}
return FALSE;
}

boolean TMGI__and__MBMS__SessionID_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_oddevenIndicator.is_bound()
 || single_value->field_mCC__MNCIndicator.is_bound()
 || single_value->field_mBMS__SessionIdentityIndicator.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_mBMS__ServiceID.is_bound()
 || single_value->field_mccDigit1.is_bound()
 || single_value->field_mccDigit2.is_bound()
 || single_value->field_mccDigit3.is_bound()
 || single_value->field_mncDigit3.is_bound()
 || single_value->field_mncDigit1.is_bound()
 || single_value->field_mncDigit2.is_bound()
 || single_value->field_mBMS__SessionIdentity.is_bound();
}

boolean TMGI__and__MBMS__SessionID_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_oddevenIndicator.is_value()
 && single_value->field_mCC__MNCIndicator.is_value()
 && single_value->field_mBMS__SessionIdentityIndicator.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_mBMS__ServiceID.is_value()
 && single_value->field_mccDigit1.is_value()
 && single_value->field_mccDigit2.is_value()
 && single_value->field_mccDigit3.is_value()
 && single_value->field_mncDigit3.is_value()
 && single_value->field_mncDigit1.is_value()
 && single_value->field_mncDigit2.is_value()
 && single_value->field_mBMS__SessionIdentity.is_value();
}

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

TMGI__and__MBMS__SessionID TMGI__and__MBMS__SessionID_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_CommonIE_Types.TMGI_and_MBMS_SessionID.");
TMGI__and__MBMS__SessionID ret_val;
if (single_value->field_oddevenIndicator.is_bound()) {
ret_val.oddevenIndicator() = single_value->field_oddevenIndicator.valueof();
}
if (single_value->field_mCC__MNCIndicator.is_bound()) {
ret_val.mCC__MNCIndicator() = single_value->field_mCC__MNCIndicator.valueof();
}
if (single_value->field_mBMS__SessionIdentityIndicator.is_bound()) {
ret_val.mBMS__SessionIdentityIndicator() = single_value->field_mBMS__SessionIdentityIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_mBMS__ServiceID.is_bound()) {
ret_val.mBMS__ServiceID() = single_value->field_mBMS__ServiceID.valueof();
}
if (single_value->field_mccDigit1.is_bound()) {
ret_val.mccDigit1() = single_value->field_mccDigit1.valueof();
}
if (single_value->field_mccDigit2.is_bound()) {
ret_val.mccDigit2() = single_value->field_mccDigit2.valueof();
}
if (single_value->field_mccDigit3.is_bound()) {
ret_val.mccDigit3() = single_value->field_mccDigit3.valueof();
}
if (single_value->field_mncDigit3.is_bound()) {
ret_val.mncDigit3() = single_value->field_mncDigit3.valueof();
}
if (single_value->field_mncDigit1.is_bound()) {
ret_val.mncDigit1() = single_value->field_mncDigit1.valueof();
}
if (single_value->field_mncDigit2.is_bound()) {
ret_val.mncDigit2() = single_value->field_mncDigit2.valueof();
}
if (single_value->field_mBMS__SessionIdentity.is_bound()) {
ret_val.mBMS__SessionIdentity() = single_value->field_mBMS__SessionIdentity.valueof();
}
return ret_val;
}

void TMGI__and__MBMS__SessionID_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_CommonIE_Types.TMGI_and_MBMS_SessionID.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TMGI__and__MBMS__SessionID_template[list_length];
}

TMGI__and__MBMS__SessionID_template& TMGI__and__MBMS__SessionID_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_CommonIE_Types.TMGI_and_MBMS_SessionID.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
return value_list.list_value[list_index];
}

BITSTRING_template& TMGI__and__MBMS__SessionID_template::oddevenIndicator()
{
set_specific();
return single_value->field_oddevenIndicator;
}

const BITSTRING_template& TMGI__and__MBMS__SessionID_template::oddevenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddevenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
return single_value->field_oddevenIndicator;
}

BITSTRING_template& TMGI__and__MBMS__SessionID_template::mCC__MNCIndicator()
{
set_specific();
return single_value->field_mCC__MNCIndicator;
}

const BITSTRING_template& TMGI__and__MBMS__SessionID_template::mCC__MNCIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mCC_MNCIndicator of a non-specific template of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
return single_value->field_mCC__MNCIndicator;
}

BITSTRING_template& TMGI__and__MBMS__SessionID_template::mBMS__SessionIdentityIndicator()
{
set_specific();
return single_value->field_mBMS__SessionIdentityIndicator;
}

const BITSTRING_template& TMGI__and__MBMS__SessionID_template::mBMS__SessionIdentityIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_SessionIdentityIndicator of a non-specific template of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
return single_value->field_mBMS__SessionIdentityIndicator;
}

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

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

OCTETSTRING_template& TMGI__and__MBMS__SessionID_template::mBMS__ServiceID()
{
set_specific();
return single_value->field_mBMS__ServiceID;
}

const OCTETSTRING_template& TMGI__and__MBMS__SessionID_template::mBMS__ServiceID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ServiceID of a non-specific template of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
return single_value->field_mBMS__ServiceID;
}

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

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

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

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

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

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

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

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

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

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

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

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

OCTETSTRING_template& TMGI__and__MBMS__SessionID_template::mBMS__SessionIdentity()
{
set_specific();
return single_value->field_mBMS__SessionIdentity;
}

const OCTETSTRING_template& TMGI__and__MBMS__SessionID_template::mBMS__SessionIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_SessionIdentity of a non-specific template of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID.");
return single_value->field_mBMS__SessionIdentity;
}

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

void TMGI__and__MBMS__SessionID_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", mCC_MNCIndicator := ");
single_value->field_mCC__MNCIndicator.log();
TTCN_Logger::log_event_str(", mBMS_SessionIdentityIndicator := ");
single_value->field_mBMS__SessionIdentityIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", mBMS_ServiceID := ");
single_value->field_mBMS__ServiceID.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log();
TTCN_Logger::log_event_str(", mBMS_SessionIdentity := ");
single_value->field_mBMS__SessionIdentity.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 TMGI__and__MBMS__SessionID_template::log_match(const TMGI__and__MBMS__SessionID& 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_oddevenIndicator.match(match_value.oddevenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".oddevenIndicator");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mCC__MNCIndicator.match(match_value.mCC__MNCIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".mCC_MNCIndicator");
single_value->field_mCC__MNCIndicator.log_match(match_value.mCC__MNCIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS__SessionIdentityIndicator.match(match_value.mBMS__SessionIdentityIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_SessionIdentityIndicator");
single_value->field_mBMS__SessionIdentityIndicator.log_match(match_value.mBMS__SessionIdentityIndicator(), 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_mBMS__ServiceID.match(match_value.mBMS__ServiceID(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ServiceID");
single_value->field_mBMS__ServiceID.log_match(match_value.mBMS__ServiceID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS__SessionIdentity.match(match_value.mBMS__SessionIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_SessionIdentity");
single_value->field_mBMS__SessionIdentity.log_match(match_value.mBMS__SessionIdentity(), 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("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::log_event_str(", mCC_MNCIndicator := ");
single_value->field_mCC__MNCIndicator.log_match(match_value.mCC__MNCIndicator(), legacy);
TTCN_Logger::log_event_str(", mBMS_SessionIdentityIndicator := ");
single_value->field_mBMS__SessionIdentityIndicator.log_match(match_value.mBMS__SessionIdentityIndicator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", mBMS_ServiceID := ");
single_value->field_mBMS__ServiceID.log_match(match_value.mBMS__ServiceID(), legacy);
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::log_event_str(", mBMS_SessionIdentity := ");
single_value->field_mBMS__SessionIdentity.log_match(match_value.mBMS__SessionIdentity(), 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 TMGI__and__MBMS__SessionID_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (mCC__MNCIndicator().is_bound()) mCC__MNCIndicator().set_implicit_omit();
if (mBMS__SessionIdentityIndicator().is_bound()) mBMS__SessionIdentityIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (mBMS__ServiceID().is_bound()) mBMS__ServiceID().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
if (mBMS__SessionIdentity().is_bound()) mBMS__SessionIdentity().set_implicit_omit();
}

void TMGI__and__MBMS__SessionID_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_oddevenIndicator.encode_text(text_buf);
single_value->field_mCC__MNCIndicator.encode_text(text_buf);
single_value->field_mBMS__SessionIdentityIndicator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_mBMS__ServiceID.encode_text(text_buf);
single_value->field_mccDigit1.encode_text(text_buf);
single_value->field_mccDigit2.encode_text(text_buf);
single_value->field_mccDigit3.encode_text(text_buf);
single_value->field_mncDigit3.encode_text(text_buf);
single_value->field_mncDigit1.encode_text(text_buf);
single_value->field_mncDigit2.encode_text(text_buf);
single_value->field_mBMS__SessionIdentity.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_CommonIE_Types.TMGI_and_MBMS_SessionID.");
}
}

void TMGI__and__MBMS__SessionID_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_oddevenIndicator.decode_text(text_buf);
single_value->field_mCC__MNCIndicator.decode_text(text_buf);
single_value->field_mBMS__SessionIdentityIndicator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_mBMS__ServiceID.decode_text(text_buf);
single_value->field_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.decode_text(text_buf);
single_value->field_mBMS__SessionIdentity.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 TMGI__and__MBMS__SessionID_template[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_CommonIE_Types.TMGI_and_MBMS_SessionID.");
}
}

void TMGI__and__MBMS__SessionID_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: {
    TMGI__and__MBMS__SessionID_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record template of type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mCC__MNCIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionIdentityIndicator().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) mBMS__ServiceID().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionIdentity().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mCC_MNCIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mCC__MNCIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_SessionIdentityIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionIdentityIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "mBMS_ServiceID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ServiceID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_SessionIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TMGI__and__MBMS__SessionID_template* precondition = new TMGI__and__MBMS__SessionID_template;
    precondition->set_param(*param.get_elem(0));
    TMGI__and__MBMS__SessionID_template* implied_template = new TMGI__and__MBMS__SessionID_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TMGI__and__MBMS__SessionID_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
  }
  is_ifpresent = param.get_ifpresent();
}

void TMGI__and__MBMS__SessionID_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_oddevenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mCC__MNCIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mBMS__SessionIdentityIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mBMS__ServiceID.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
single_value->field_mBMS__SessionIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.TMGI_and_MBMS_SessionID");
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_CommonIE_Types.TMGI_and_MBMS_SessionID");
}

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

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

No__Identity::No__Identity()
{
}

No__Identity::No__Identity(const BITSTRING& par_oddevenIndicator,
    const HEXSTRING& par_fillerDigits)
  :   field_oddevenIndicator(par_oddevenIndicator),
  field_fillerDigits(par_fillerDigits)
{
}

No__Identity::No__Identity(const No__Identity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.No_Identity.");
if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
else field_oddevenIndicator.clean_up();
if (other_value.fillerDigits().is_bound()) field_fillerDigits = other_value.fillerDigits();
else field_fillerDigits.clean_up();
}

void No__Identity::clean_up()
{
field_oddevenIndicator.clean_up();
field_fillerDigits.clean_up();
}

const TTCN_Typedescriptor_t* No__Identity::get_descriptor() const { return &No__Identity_descr_; }
No__Identity& No__Identity::operator=(const No__Identity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.No_Identity.");
  if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
  else field_oddevenIndicator.clean_up();
  if (other_value.fillerDigits().is_bound()) field_fillerDigits = other_value.fillerDigits();
  else field_fillerDigits.clean_up();
}
return *this;
}

boolean No__Identity::operator==(const No__Identity& other_value) const
{
return field_oddevenIndicator==other_value.field_oddevenIndicator
  && field_fillerDigits==other_value.field_fillerDigits;
}

boolean No__Identity::is_bound() const
{
return (field_oddevenIndicator.is_bound())
  || (field_fillerDigits.is_bound());
}
boolean No__Identity::is_value() const
{
return field_oddevenIndicator.is_value()
  && field_fillerDigits.is_value();
}
void No__Identity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", fillerDigits := ");
field_fillerDigits.log();
TTCN_Logger::log_event_str(" }");
}

void No__Identity::set_implicit_omit()
{
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (fillerDigits().is_bound()) fillerDigits().set_implicit_omit();
}

void No__Identity::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_CommonIE_Types.No_Identity 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fillerDigits().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.No_Identity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.No_Identity");
  }
}

void No__Identity::encode_text(Text_Buf& text_buf) const
{
field_oddevenIndicator.encode_text(text_buf);
field_fillerDigits.encode_text(text_buf);
}

void No__Identity::decode_text(Text_Buf& text_buf)
{
field_oddevenIndicator.decode_text(text_buf);
field_fillerDigits.decode_text(text_buf);
}

void No__Identity::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 No__Identity::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 No__Identity::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oddevenIndicator.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_fillerDigits.RAW_decode(HEXSTRING_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 No__Identity::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, HEXSTRING_descr_.raw);
  encoded_length += field_oddevenIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_fillerDigits.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct No__Identity_template::single_value_struct {
BITSTRING_template field_oddevenIndicator;
HEXSTRING_template field_fillerDigits;
};

void No__Identity_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_oddevenIndicator = ANY_VALUE;
single_value->field_fillerDigits = ANY_VALUE;
}
}
}

void No__Identity_template::copy_value(const No__Identity& other_value)
{
single_value = new single_value_struct;
if (other_value.oddevenIndicator().is_bound()) {
  single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
  single_value->field_oddevenIndicator.clean_up();
}
if (other_value.fillerDigits().is_bound()) {
  single_value->field_fillerDigits = other_value.fillerDigits();
} else {
  single_value->field_fillerDigits.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void No__Identity_template::copy_template(const No__Identity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.oddevenIndicator().get_selection()) {
single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
single_value->field_oddevenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fillerDigits().get_selection()) {
single_value->field_fillerDigits = other_value.fillerDigits();
} else {
single_value->field_fillerDigits.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 No__Identity_template[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 No__Identity_template(*other_value.implication_.precondition);
implication_.implied_template = new No__Identity_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_CommonIE_Types.No_Identity.");
break;
}
set_selection(other_value);
}

No__Identity_template::No__Identity_template()
{
}

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

No__Identity_template::No__Identity_template(const No__Identity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean No__Identity_template::match(const No__Identity& 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.oddevenIndicator().is_bound()) return FALSE;
if(!single_value->field_oddevenIndicator.match(other_value.oddevenIndicator(), legacy))return FALSE;
if(!other_value.fillerDigits().is_bound()) return FALSE;
if(!single_value->field_fillerDigits.match(other_value.fillerDigits(), 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_CommonIE_Types.No_Identity.");
}
return FALSE;
}

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

boolean No__Identity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_oddevenIndicator.is_value()
 && single_value->field_fillerDigits.is_value();
}

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

No__Identity No__Identity_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_CommonIE_Types.No_Identity.");
No__Identity ret_val;
if (single_value->field_oddevenIndicator.is_bound()) {
ret_val.oddevenIndicator() = single_value->field_oddevenIndicator.valueof();
}
if (single_value->field_fillerDigits.is_bound()) {
ret_val.fillerDigits() = single_value->field_fillerDigits.valueof();
}
return ret_val;
}

void No__Identity_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_CommonIE_Types.No_Identity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new No__Identity_template[list_length];
}

No__Identity_template& No__Identity_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_CommonIE_Types.No_Identity.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.No_Identity.");
return value_list.list_value[list_index];
}

BITSTRING_template& No__Identity_template::oddevenIndicator()
{
set_specific();
return single_value->field_oddevenIndicator;
}

const BITSTRING_template& No__Identity_template::oddevenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddevenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.No_Identity.");
return single_value->field_oddevenIndicator;
}

HEXSTRING_template& No__Identity_template::fillerDigits()
{
set_specific();
return single_value->field_fillerDigits;
}

const HEXSTRING_template& No__Identity_template::fillerDigits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fillerDigits of a non-specific template of type @MobileL3_CommonIE_Types.No_Identity.");
return single_value->field_fillerDigits;
}

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

void No__Identity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", fillerDigits := ");
single_value->field_fillerDigits.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 No__Identity_template::log_match(const No__Identity& 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_oddevenIndicator.match(match_value.oddevenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".oddevenIndicator");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fillerDigits.match(match_value.fillerDigits(), legacy)){
TTCN_Logger::log_logmatch_info(".fillerDigits");
single_value->field_fillerDigits.log_match(match_value.fillerDigits(), 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("{ oddevenIndicator := ");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::log_event_str(", fillerDigits := ");
single_value->field_fillerDigits.log_match(match_value.fillerDigits(), 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 No__Identity_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (fillerDigits().is_bound()) fillerDigits().set_implicit_omit();
}

void No__Identity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_oddevenIndicator.encode_text(text_buf);
single_value->field_fillerDigits.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_CommonIE_Types.No_Identity.");
}
}

void No__Identity_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_oddevenIndicator.decode_text(text_buf);
single_value->field_fillerDigits.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 No__Identity_template[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_CommonIE_Types.No_Identity.");
}
}

void No__Identity_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: {
    No__Identity_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_CommonIE_Types.No_Identity 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) oddevenIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fillerDigits().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(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerDigits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerDigits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.No_Identity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    No__Identity_template* precondition = new No__Identity_template;
    precondition->set_param(*param.get_elem(0));
    No__Identity_template* implied_template = new No__Identity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = No__Identity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.No_Identity");
  }
  is_ifpresent = param.get_ifpresent();
}

void No__Identity_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_oddevenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.No_Identity");
single_value->field_fillerDigits.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.No_Identity");
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_CommonIE_Types.No_Identity");
}

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

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

MobileIdentityV::MobileIdentityV()
{
}

MobileIdentityV::MobileIdentityV(const BITSTRING& par_typeOfIdentity,
    const OddEvenInd__Identity& par_oddEvenInd__identity)
  :   field_typeOfIdentity(par_typeOfIdentity),
  field_oddEvenInd__identity(par_oddEvenInd__identity)
{
}

MobileIdentityV::MobileIdentityV(const MobileIdentityV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileIdentityV.");
if (other_value.typeOfIdentity().is_bound()) field_typeOfIdentity = other_value.typeOfIdentity();
else field_typeOfIdentity.clean_up();
if (other_value.oddEvenInd__identity().is_bound()) field_oddEvenInd__identity = other_value.oddEvenInd__identity();
else field_oddEvenInd__identity.clean_up();
}

void MobileIdentityV::clean_up()
{
field_typeOfIdentity.clean_up();
field_oddEvenInd__identity.clean_up();
}

const TTCN_Typedescriptor_t* MobileIdentityV::get_descriptor() const { return &MobileIdentityV_descr_; }
MobileIdentityV& MobileIdentityV::operator=(const MobileIdentityV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileIdentityV.");
  if (other_value.typeOfIdentity().is_bound()) field_typeOfIdentity = other_value.typeOfIdentity();
  else field_typeOfIdentity.clean_up();
  if (other_value.oddEvenInd__identity().is_bound()) field_oddEvenInd__identity = other_value.oddEvenInd__identity();
  else field_oddEvenInd__identity.clean_up();
}
return *this;
}

boolean MobileIdentityV::operator==(const MobileIdentityV& other_value) const
{
return field_typeOfIdentity==other_value.field_typeOfIdentity
  && field_oddEvenInd__identity==other_value.field_oddEvenInd__identity;
}

boolean MobileIdentityV::is_bound() const
{
return (field_typeOfIdentity.is_bound())
  || (field_oddEvenInd__identity.is_bound());
}
boolean MobileIdentityV::is_value() const
{
return field_typeOfIdentity.is_value()
  && field_oddEvenInd__identity.is_value();
}
void MobileIdentityV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ typeOfIdentity := ");
field_typeOfIdentity.log();
TTCN_Logger::log_event_str(", oddEvenInd_identity := ");
field_oddEvenInd__identity.log();
TTCN_Logger::log_event_str(" }");
}

void MobileIdentityV::set_implicit_omit()
{
if (typeOfIdentity().is_bound()) typeOfIdentity().set_implicit_omit();
if (oddEvenInd__identity().is_bound()) oddEvenInd__identity().set_implicit_omit();
}

void MobileIdentityV::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_CommonIE_Types.MobileIdentityV 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) typeOfIdentity().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) oddEvenInd__identity().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(), "typeOfIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oddEvenInd_identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddEvenInd__identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileIdentityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileIdentityV");
  }
}

void MobileIdentityV::encode_text(Text_Buf& text_buf) const
{
field_typeOfIdentity.encode_text(text_buf);
field_oddEvenInd__identity.encode_text(text_buf);
}

void MobileIdentityV::decode_text(Text_Buf& text_buf)
{
field_typeOfIdentity.decode_text(text_buf);
field_oddEvenInd__identity.decode_text(text_buf);
}

void MobileIdentityV::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 MobileIdentityV::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 MobileIdentityV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_typeOfIdentity.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());
  if (field_typeOfIdentity ==  bs_2) selected_field = 1;
  else if (field_typeOfIdentity ==  bs_3) selected_field = 0;
  else if (field_typeOfIdentity ==  bs_4) selected_field = 2;
  else if (field_typeOfIdentity ==  bs_5) selected_field = 3;
  else if (field_typeOfIdentity ==  bs_6) selected_field = 4;
  else if (field_typeOfIdentity ==  bs_7) selected_field = 5;
  else selected_field = -1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, MobileIdentityV_oddEvenInd__identity_descr_.raw->forceomit);
  decoded_field_length = field_oddEvenInd__identity.RAW_decode(MobileIdentityV_oddEvenInd__identity_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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 MobileIdentityV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileIdentityV_oddEvenInd__identity_descr_.raw);
  encoded_length += field_typeOfIdentity.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_oddEvenInd__identity.RAW_encode(MobileIdentityV_oddEvenInd__identity_descr_, *myleaf.body.node.nodes[1]);
  switch (field_oddEvenInd__identity.get_selection()) {
  case OddEvenInd__Identity::ALT_imei:
  if (field_typeOfIdentity !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case OddEvenInd__Identity::ALT_imsi:
  if (field_typeOfIdentity !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case OddEvenInd__Identity::ALT_imei__sv:
  if (field_typeOfIdentity !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case OddEvenInd__Identity::ALT_tmsi__ptmsi:
  if (field_typeOfIdentity !=  bs_5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_5.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case OddEvenInd__Identity::ALT_tmgi__and__MBMS__SessionID:
  if (field_typeOfIdentity !=  bs_6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_6.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case OddEvenInd__Identity::ALT_no__identity:
  if (field_typeOfIdentity !=  bs_7) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_7.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct MobileIdentityV_template::single_value_struct {
BITSTRING_template field_typeOfIdentity;
OddEvenInd__Identity_template field_oddEvenInd__identity;
};

void MobileIdentityV_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_typeOfIdentity = ANY_VALUE;
single_value->field_oddEvenInd__identity = ANY_VALUE;
}
}
}

void MobileIdentityV_template::copy_value(const MobileIdentityV& other_value)
{
single_value = new single_value_struct;
if (other_value.typeOfIdentity().is_bound()) {
  single_value->field_typeOfIdentity = other_value.typeOfIdentity();
} else {
  single_value->field_typeOfIdentity.clean_up();
}
if (other_value.oddEvenInd__identity().is_bound()) {
  single_value->field_oddEvenInd__identity = other_value.oddEvenInd__identity();
} else {
  single_value->field_oddEvenInd__identity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileIdentityV_template::copy_template(const MobileIdentityV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.typeOfIdentity().get_selection()) {
single_value->field_typeOfIdentity = other_value.typeOfIdentity();
} else {
single_value->field_typeOfIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oddEvenInd__identity().get_selection()) {
single_value->field_oddEvenInd__identity = other_value.oddEvenInd__identity();
} else {
single_value->field_oddEvenInd__identity.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 MobileIdentityV_template[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 MobileIdentityV_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileIdentityV_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_CommonIE_Types.MobileIdentityV.");
break;
}
set_selection(other_value);
}

MobileIdentityV_template::MobileIdentityV_template()
{
}

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

MobileIdentityV_template::MobileIdentityV_template(const MobileIdentityV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileIdentityV_template::match(const MobileIdentityV& 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.typeOfIdentity().is_bound()) return FALSE;
if(!single_value->field_typeOfIdentity.match(other_value.typeOfIdentity(), legacy))return FALSE;
if(!other_value.oddEvenInd__identity().is_bound()) return FALSE;
if(!single_value->field_oddEvenInd__identity.match(other_value.oddEvenInd__identity(), 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_CommonIE_Types.MobileIdentityV.");
}
return FALSE;
}

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

boolean MobileIdentityV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_typeOfIdentity.is_value()
 && single_value->field_oddEvenInd__identity.is_value();
}

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

MobileIdentityV MobileIdentityV_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_CommonIE_Types.MobileIdentityV.");
MobileIdentityV ret_val;
if (single_value->field_typeOfIdentity.is_bound()) {
ret_val.typeOfIdentity() = single_value->field_typeOfIdentity.valueof();
}
if (single_value->field_oddEvenInd__identity.is_bound()) {
ret_val.oddEvenInd__identity() = single_value->field_oddEvenInd__identity.valueof();
}
return ret_val;
}

void MobileIdentityV_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_CommonIE_Types.MobileIdentityV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileIdentityV_template[list_length];
}

MobileIdentityV_template& MobileIdentityV_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_CommonIE_Types.MobileIdentityV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileIdentityV.");
return value_list.list_value[list_index];
}

BITSTRING_template& MobileIdentityV_template::typeOfIdentity()
{
set_specific();
return single_value->field_typeOfIdentity;
}

const BITSTRING_template& MobileIdentityV_template::typeOfIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field typeOfIdentity of a non-specific template of type @MobileL3_CommonIE_Types.MobileIdentityV.");
return single_value->field_typeOfIdentity;
}

OddEvenInd__Identity_template& MobileIdentityV_template::oddEvenInd__identity()
{
set_specific();
return single_value->field_oddEvenInd__identity;
}

const OddEvenInd__Identity_template& MobileIdentityV_template::oddEvenInd__identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddEvenInd_identity of a non-specific template of type @MobileL3_CommonIE_Types.MobileIdentityV.");
return single_value->field_oddEvenInd__identity;
}

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

void MobileIdentityV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ typeOfIdentity := ");
single_value->field_typeOfIdentity.log();
TTCN_Logger::log_event_str(", oddEvenInd_identity := ");
single_value->field_oddEvenInd__identity.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 MobileIdentityV_template::log_match(const MobileIdentityV& 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_typeOfIdentity.match(match_value.typeOfIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".typeOfIdentity");
single_value->field_typeOfIdentity.log_match(match_value.typeOfIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oddEvenInd__identity.match(match_value.oddEvenInd__identity(), legacy)){
TTCN_Logger::log_logmatch_info(".oddEvenInd_identity");
single_value->field_oddEvenInd__identity.log_match(match_value.oddEvenInd__identity(), 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("{ typeOfIdentity := ");
single_value->field_typeOfIdentity.log_match(match_value.typeOfIdentity(), legacy);
TTCN_Logger::log_event_str(", oddEvenInd_identity := ");
single_value->field_oddEvenInd__identity.log_match(match_value.oddEvenInd__identity(), 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 MobileIdentityV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (typeOfIdentity().is_bound()) typeOfIdentity().set_implicit_omit();
if (oddEvenInd__identity().is_bound()) oddEvenInd__identity().set_implicit_omit();
}

void MobileIdentityV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_typeOfIdentity.encode_text(text_buf);
single_value->field_oddEvenInd__identity.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_CommonIE_Types.MobileIdentityV.");
}
}

void MobileIdentityV_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_typeOfIdentity.decode_text(text_buf);
single_value->field_oddEvenInd__identity.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 MobileIdentityV_template[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_CommonIE_Types.MobileIdentityV.");
}
}

void MobileIdentityV_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: {
    MobileIdentityV_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_CommonIE_Types.MobileIdentityV 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) typeOfIdentity().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) oddEvenInd__identity().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(), "typeOfIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oddEvenInd_identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddEvenInd__identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileIdentityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileIdentityV_template* precondition = new MobileIdentityV_template;
    precondition->set_param(*param.get_elem(0));
    MobileIdentityV_template* implied_template = new MobileIdentityV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileIdentityV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileIdentityV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileIdentityV_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_typeOfIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileIdentityV");
single_value->field_oddEvenInd__identity.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileIdentityV");
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_CommonIE_Types.MobileIdentityV");
}

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

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

MobileIdentityLV::MobileIdentityLV()
{
}

MobileIdentityLV::MobileIdentityLV(const INTEGER& par_lengthIndicator,
    const MobileIdentityV& par_mobileIdentityV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_mobileIdentityV(par_mobileIdentityV)
{
}

MobileIdentityLV::MobileIdentityLV(const MobileIdentityLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileIdentityLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mobileIdentityV().is_bound()) field_mobileIdentityV = other_value.mobileIdentityV();
else field_mobileIdentityV.clean_up();
}

void MobileIdentityLV::clean_up()
{
field_lengthIndicator.clean_up();
field_mobileIdentityV.clean_up();
}

const TTCN_Typedescriptor_t* MobileIdentityLV::get_descriptor() const { return &MobileIdentityLV_descr_; }
MobileIdentityLV& MobileIdentityLV::operator=(const MobileIdentityLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileIdentityLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mobileIdentityV().is_bound()) field_mobileIdentityV = other_value.mobileIdentityV();
  else field_mobileIdentityV.clean_up();
}
return *this;
}

boolean MobileIdentityLV::operator==(const MobileIdentityLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_mobileIdentityV==other_value.field_mobileIdentityV;
}

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

void MobileIdentityLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mobileIdentityV().is_bound()) mobileIdentityV().set_implicit_omit();
}

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

void MobileIdentityLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_mobileIdentityV.encode_text(text_buf);
}

void MobileIdentityLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_mobileIdentityV.decode_text(text_buf);
}

void MobileIdentityLV::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 MobileIdentityLV::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 MobileIdentityLV::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, MobileIdentityLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MobileIdentityLV_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(MobileIdentityLV_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, MobileIdentityV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentityV.RAW_decode(MobileIdentityV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct MobileIdentityLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
MobileIdentityV_template field_mobileIdentityV;
};

void MobileIdentityLV_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_mobileIdentityV = ANY_VALUE;
}
}
}

void MobileIdentityLV_template::copy_value(const MobileIdentityLV& 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.mobileIdentityV().is_bound()) {
  single_value->field_mobileIdentityV = other_value.mobileIdentityV();
} else {
  single_value->field_mobileIdentityV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileIdentityLV_template::copy_template(const MobileIdentityLV_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.mobileIdentityV().get_selection()) {
single_value->field_mobileIdentityV = other_value.mobileIdentityV();
} else {
single_value->field_mobileIdentityV.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 MobileIdentityLV_template[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 MobileIdentityLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileIdentityLV_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_CommonIE_Types.MobileIdentityLV.");
break;
}
set_selection(other_value);
}

MobileIdentityLV_template::MobileIdentityLV_template()
{
}

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

MobileIdentityLV_template::MobileIdentityLV_template(const MobileIdentityLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileIdentityLV_template::match(const MobileIdentityLV& 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.mobileIdentityV().is_bound()) return FALSE;
if(!single_value->field_mobileIdentityV.match(other_value.mobileIdentityV(), 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_CommonIE_Types.MobileIdentityLV.");
}
return FALSE;
}

boolean MobileIdentityLV_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_mobileIdentityV.is_bound();
}

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

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

MobileIdentityLV MobileIdentityLV_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_CommonIE_Types.MobileIdentityLV.");
MobileIdentityLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mobileIdentityV.is_bound()) {
ret_val.mobileIdentityV() = single_value->field_mobileIdentityV.valueof();
}
return ret_val;
}

void MobileIdentityLV_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_CommonIE_Types.MobileIdentityLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileIdentityLV_template[list_length];
}

MobileIdentityLV_template& MobileIdentityLV_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_CommonIE_Types.MobileIdentityLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileIdentityLV.");
return value_list.list_value[list_index];
}

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

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

MobileIdentityV_template& MobileIdentityLV_template::mobileIdentityV()
{
set_specific();
return single_value->field_mobileIdentityV;
}

const MobileIdentityV_template& MobileIdentityLV_template::mobileIdentityV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentityV of a non-specific template of type @MobileL3_CommonIE_Types.MobileIdentityLV.");
return single_value->field_mobileIdentityV;
}

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

void MobileIdentityLV_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(", mobileIdentityV := ");
single_value->field_mobileIdentityV.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 MobileIdentityLV_template::log_match(const MobileIdentityLV& 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_mobileIdentityV.match(match_value.mobileIdentityV(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentityV");
single_value->field_mobileIdentityV.log_match(match_value.mobileIdentityV(), 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(", mobileIdentityV := ");
single_value->field_mobileIdentityV.log_match(match_value.mobileIdentityV(), 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 MobileIdentityLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mobileIdentityV().is_bound()) mobileIdentityV().set_implicit_omit();
}

void MobileIdentityLV_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_mobileIdentityV.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_CommonIE_Types.MobileIdentityLV.");
}
}

void MobileIdentityLV_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_mobileIdentityV.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 MobileIdentityLV_template[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_CommonIE_Types.MobileIdentityLV.");
}
}

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

void MobileIdentityLV_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_CommonIE_Types.MobileIdentityLV");
single_value->field_mobileIdentityV.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileIdentityLV");
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_CommonIE_Types.MobileIdentityLV");
}

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

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

MobileIdentityTLV::MobileIdentityTLV()
{
}

MobileIdentityTLV::MobileIdentityTLV(const BITSTRING& par_elementIdentifier,
    const BITSTRING& par_spare1,
    const MobileIdentityLV& par_mobileIdentityLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_spare1(par_spare1),
  field_mobileIdentityLV(par_mobileIdentityLV)
{
}

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

void MobileIdentityTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_spare1.clean_up();
field_mobileIdentityLV.clean_up();
}

const TTCN_Typedescriptor_t* MobileIdentityTLV::get_descriptor() const { return &MobileIdentityTLV_descr_; }
MobileIdentityTLV& MobileIdentityTLV::operator=(const MobileIdentityTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileIdentityTLV.");
  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.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
  else field_mobileIdentityLV.clean_up();
}
return *this;
}

boolean MobileIdentityTLV::operator==(const MobileIdentityTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_spare1==other_value.field_spare1
  && field_mobileIdentityLV==other_value.field_mobileIdentityLV;
}

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

void MobileIdentityTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (spare1().is_bound()) spare1().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
}

void MobileIdentityTLV::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_CommonIE_Types.MobileIdentityTLV 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) spare1().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));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileIdentityTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileIdentityTLV");
  }
}

void MobileIdentityTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_spare1.encode_text(text_buf);
field_mobileIdentityLV.encode_text(text_buf);
}

void MobileIdentityTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_spare1.decode_text(text_buf);
field_mobileIdentityLV.decode_text(text_buf);
}

void MobileIdentityTLV::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 MobileIdentityTLV::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 MobileIdentityTLV::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_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, MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentityLV.RAW_decode(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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MobileIdentityTLV::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, MobileIdentityLV_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 += field_mobileIdentityLV.RAW_encode(MobileIdentityLV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct MobileIdentityTLV_template::single_value_struct {
BITSTRING_template field_elementIdentifier;
BITSTRING_template field_spare1;
MobileIdentityLV_template field_mobileIdentityLV;
};

void MobileIdentityTLV_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_mobileIdentityLV = ANY_VALUE;
}
}
}

void MobileIdentityTLV_template::copy_value(const MobileIdentityTLV& 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.mobileIdentityLV().is_bound()) {
  single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
  single_value->field_mobileIdentityLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileIdentityTLV_template::copy_template(const MobileIdentityTLV_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.mobileIdentityLV().get_selection()) {
single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
single_value->field_mobileIdentityLV.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 MobileIdentityTLV_template[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 MobileIdentityTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileIdentityTLV_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_CommonIE_Types.MobileIdentityTLV.");
break;
}
set_selection(other_value);
}

MobileIdentityTLV_template::MobileIdentityTLV_template()
{
}

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

MobileIdentityTLV_template::MobileIdentityTLV_template(const MobileIdentityTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileIdentityTLV_template::match(const MobileIdentityTLV& 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.mobileIdentityLV().is_bound()) return FALSE;
if(!single_value->field_mobileIdentityLV.match(other_value.mobileIdentityLV(), 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_CommonIE_Types.MobileIdentityTLV.");
}
return FALSE;
}

boolean MobileIdentityTLV_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_mobileIdentityLV.is_bound();
}

boolean MobileIdentityTLV_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_mobileIdentityLV.is_value();
}

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

MobileIdentityTLV MobileIdentityTLV_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_CommonIE_Types.MobileIdentityTLV.");
MobileIdentityTLV 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_mobileIdentityLV.is_bound()) {
ret_val.mobileIdentityLV() = single_value->field_mobileIdentityLV.valueof();
}
return ret_val;
}

void MobileIdentityTLV_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_CommonIE_Types.MobileIdentityTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileIdentityTLV_template[list_length];
}

MobileIdentityTLV_template& MobileIdentityTLV_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_CommonIE_Types.MobileIdentityTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileIdentityTLV.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileIdentityLV_template& MobileIdentityTLV_template::mobileIdentityLV()
{
set_specific();
return single_value->field_mobileIdentityLV;
}

const MobileIdentityLV_template& MobileIdentityTLV_template::mobileIdentityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentityLV of a non-specific template of type @MobileL3_CommonIE_Types.MobileIdentityTLV.");
return single_value->field_mobileIdentityLV;
}

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

void MobileIdentityTLV_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(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.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 MobileIdentityTLV_template::log_match(const MobileIdentityTLV& 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_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);
}
}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(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), 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 MobileIdentityTLV_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 (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
}

void MobileIdentityTLV_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_mobileIdentityLV.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_CommonIE_Types.MobileIdentityTLV.");
}
}

void MobileIdentityTLV_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_mobileIdentityLV.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 MobileIdentityTLV_template[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_CommonIE_Types.MobileIdentityTLV.");
}
}

void MobileIdentityTLV_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: {
    MobileIdentityTLV_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_CommonIE_Types.MobileIdentityTLV 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) spare1().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));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileIdentityTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileIdentityTLV_template* precondition = new MobileIdentityTLV_template;
    precondition->set_param(*param.get_elem(0));
    MobileIdentityTLV_template* implied_template = new MobileIdentityTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileIdentityTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileIdentityTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileIdentityTLV_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_CommonIE_Types.MobileIdentityTLV");
single_value->field_spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileIdentityTLV");
single_value->field_mobileIdentityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileIdentityTLV");
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_CommonIE_Types.MobileIdentityTLV");
}

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

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

MobileStationClassmark1__TV::MobileStationClassmark1__TV()
{
}

MobileStationClassmark1__TV::MobileStationClassmark1__TV(const OCTETSTRING& par_elementIdentifier,
    const BITSTRING& par_rf__PowerCapability,
    const BITSTRING& par_a5__1,
    const BITSTRING& par_esind,
    const BITSTRING& par_revisionLevel,
    const BITSTRING& par_spare1__1)
  :   field_elementIdentifier(par_elementIdentifier),
  field_rf__PowerCapability(par_rf__PowerCapability),
  field_a5__1(par_a5__1),
  field_esind(par_esind),
  field_revisionLevel(par_revisionLevel),
  field_spare1__1(par_spare1__1)
{
}

MobileStationClassmark1__TV::MobileStationClassmark1__TV(const MobileStationClassmark1__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
else field_rf__PowerCapability.clean_up();
if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
else field_a5__1.clean_up();
if (other_value.esind().is_bound()) field_esind = other_value.esind();
else field_esind.clean_up();
if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
else field_revisionLevel.clean_up();
if (other_value.spare1__1().is_bound()) field_spare1__1 = other_value.spare1__1();
else field_spare1__1.clean_up();
}

void MobileStationClassmark1__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_rf__PowerCapability.clean_up();
field_a5__1.clean_up();
field_esind.clean_up();
field_revisionLevel.clean_up();
field_spare1__1.clean_up();
}

const TTCN_Typedescriptor_t* MobileStationClassmark1__TV::get_descriptor() const { return &MobileStationClassmark1__TV_descr_; }
MobileStationClassmark1__TV& MobileStationClassmark1__TV::operator=(const MobileStationClassmark1__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
  else field_rf__PowerCapability.clean_up();
  if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
  else field_a5__1.clean_up();
  if (other_value.esind().is_bound()) field_esind = other_value.esind();
  else field_esind.clean_up();
  if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
  else field_revisionLevel.clean_up();
  if (other_value.spare1__1().is_bound()) field_spare1__1 = other_value.spare1__1();
  else field_spare1__1.clean_up();
}
return *this;
}

boolean MobileStationClassmark1__TV::operator==(const MobileStationClassmark1__TV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_rf__PowerCapability==other_value.field_rf__PowerCapability
  && field_a5__1==other_value.field_a5__1
  && field_esind==other_value.field_esind
  && field_revisionLevel==other_value.field_revisionLevel
  && field_spare1__1==other_value.field_spare1__1;
}

boolean MobileStationClassmark1__TV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_rf__PowerCapability.is_bound())
  || (field_a5__1.is_bound())
  || (field_esind.is_bound())
  || (field_revisionLevel.is_bound())
  || (field_spare1__1.is_bound());
}
boolean MobileStationClassmark1__TV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_rf__PowerCapability.is_value()
  && field_a5__1.is_value()
  && field_esind.is_value()
  && field_revisionLevel.is_value()
  && field_spare1__1.is_value();
}
void MobileStationClassmark1__TV::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(", rf_PowerCapability := ");
field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
field_spare1__1.log();
TTCN_Logger::log_event_str(" }");
}

void MobileStationClassmark1__TV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
}

void MobileStationClassmark1__TV::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_CommonIE_Types.MobileStationClassmark1_TV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rf__PowerCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare1__1().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(), "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(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV");
  }
}

void MobileStationClassmark1__TV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_rf__PowerCapability.encode_text(text_buf);
field_a5__1.encode_text(text_buf);
field_esind.encode_text(text_buf);
field_revisionLevel.encode_text(text_buf);
field_spare1__1.encode_text(text_buf);
}

void MobileStationClassmark1__TV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_rf__PowerCapability.decode_text(text_buf);
field_a5__1.decode_text(text_buf);
field_esind.decode_text(text_buf);
field_revisionLevel.decode_text(text_buf);
field_spare1__1.decode_text(text_buf);
}

void MobileStationClassmark1__TV::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 MobileStationClassmark1__TV::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 MobileStationClassmark1__TV::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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_rf__PowerCapability.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_a5__1.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_esind.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_revisionLevel.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare1__1.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MobileStationClassmark1__TV::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::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rf__PowerCapability.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_a5__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_esind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_revisionLevel.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare1__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  return myleaf.length = encoded_length;
}

struct MobileStationClassmark1__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
BITSTRING_template field_rf__PowerCapability;
BITSTRING_template field_a5__1;
BITSTRING_template field_esind;
BITSTRING_template field_revisionLevel;
BITSTRING_template field_spare1__1;
};

void MobileStationClassmark1__TV_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_rf__PowerCapability = ANY_VALUE;
single_value->field_a5__1 = ANY_VALUE;
single_value->field_esind = ANY_VALUE;
single_value->field_revisionLevel = ANY_VALUE;
single_value->field_spare1__1 = ANY_VALUE;
}
}
}

void MobileStationClassmark1__TV_template::copy_value(const MobileStationClassmark1__TV& 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.rf__PowerCapability().is_bound()) {
  single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
  single_value->field_rf__PowerCapability.clean_up();
}
if (other_value.a5__1().is_bound()) {
  single_value->field_a5__1 = other_value.a5__1();
} else {
  single_value->field_a5__1.clean_up();
}
if (other_value.esind().is_bound()) {
  single_value->field_esind = other_value.esind();
} else {
  single_value->field_esind.clean_up();
}
if (other_value.revisionLevel().is_bound()) {
  single_value->field_revisionLevel = other_value.revisionLevel();
} else {
  single_value->field_revisionLevel.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();
}
set_selection(SPECIFIC_VALUE);
}

void MobileStationClassmark1__TV_template::copy_template(const MobileStationClassmark1__TV_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.rf__PowerCapability().get_selection()) {
single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
single_value->field_rf__PowerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5__1().get_selection()) {
single_value->field_a5__1 = other_value.a5__1();
} else {
single_value->field_a5__1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.esind().get_selection()) {
single_value->field_esind = other_value.esind();
} else {
single_value->field_esind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.revisionLevel().get_selection()) {
single_value->field_revisionLevel = other_value.revisionLevel();
} else {
single_value->field_revisionLevel.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();
}
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 MobileStationClassmark1__TV_template[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 MobileStationClassmark1__TV_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileStationClassmark1__TV_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_CommonIE_Types.MobileStationClassmark1_TV.");
break;
}
set_selection(other_value);
}

MobileStationClassmark1__TV_template::MobileStationClassmark1__TV_template()
{
}

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

MobileStationClassmark1__TV_template::MobileStationClassmark1__TV_template(const MobileStationClassmark1__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileStationClassmark1__TV_template::match(const MobileStationClassmark1__TV& 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.rf__PowerCapability().is_bound()) return FALSE;
if(!single_value->field_rf__PowerCapability.match(other_value.rf__PowerCapability(), legacy))return FALSE;
if(!other_value.a5__1().is_bound()) return FALSE;
if(!single_value->field_a5__1.match(other_value.a5__1(), legacy))return FALSE;
if(!other_value.esind().is_bound()) return FALSE;
if(!single_value->field_esind.match(other_value.esind(), legacy))return FALSE;
if(!other_value.revisionLevel().is_bound()) return FALSE;
if(!single_value->field_revisionLevel.match(other_value.revisionLevel(), 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;
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_CommonIE_Types.MobileStationClassmark1_TV.");
}
return FALSE;
}

boolean MobileStationClassmark1__TV_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_rf__PowerCapability.is_bound()
 || single_value->field_a5__1.is_bound()
 || single_value->field_esind.is_bound()
 || single_value->field_revisionLevel.is_bound()
 || single_value->field_spare1__1.is_bound();
}

boolean MobileStationClassmark1__TV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_rf__PowerCapability.is_value()
 && single_value->field_a5__1.is_value()
 && single_value->field_esind.is_value()
 && single_value->field_revisionLevel.is_value()
 && single_value->field_spare1__1.is_value();
}

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

MobileStationClassmark1__TV MobileStationClassmark1__TV_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_CommonIE_Types.MobileStationClassmark1_TV.");
MobileStationClassmark1__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_rf__PowerCapability.is_bound()) {
ret_val.rf__PowerCapability() = single_value->field_rf__PowerCapability.valueof();
}
if (single_value->field_a5__1.is_bound()) {
ret_val.a5__1() = single_value->field_a5__1.valueof();
}
if (single_value->field_esind.is_bound()) {
ret_val.esind() = single_value->field_esind.valueof();
}
if (single_value->field_revisionLevel.is_bound()) {
ret_val.revisionLevel() = single_value->field_revisionLevel.valueof();
}
if (single_value->field_spare1__1.is_bound()) {
ret_val.spare1__1() = single_value->field_spare1__1.valueof();
}
return ret_val;
}

void MobileStationClassmark1__TV_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_CommonIE_Types.MobileStationClassmark1_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileStationClassmark1__TV_template[list_length];
}

MobileStationClassmark1__TV_template& MobileStationClassmark1__TV_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_CommonIE_Types.MobileStationClassmark1_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& MobileStationClassmark1__TV_template::rf__PowerCapability()
{
set_specific();
return single_value->field_rf__PowerCapability;
}

const BITSTRING_template& MobileStationClassmark1__TV_template::rf__PowerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rf_PowerCapability of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV.");
return single_value->field_rf__PowerCapability;
}

BITSTRING_template& MobileStationClassmark1__TV_template::a5__1()
{
set_specific();
return single_value->field_a5__1;
}

const BITSTRING_template& MobileStationClassmark1__TV_template::a5__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_1 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV.");
return single_value->field_a5__1;
}

BITSTRING_template& MobileStationClassmark1__TV_template::esind()
{
set_specific();
return single_value->field_esind;
}

const BITSTRING_template& MobileStationClassmark1__TV_template::esind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field esind of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV.");
return single_value->field_esind;
}

BITSTRING_template& MobileStationClassmark1__TV_template::revisionLevel()
{
set_specific();
return single_value->field_revisionLevel;
}

const BITSTRING_template& MobileStationClassmark1__TV_template::revisionLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field revisionLevel of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV.");
return single_value->field_revisionLevel;
}

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

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

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

void MobileStationClassmark1__TV_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(", rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
single_value->field_spare1__1.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 MobileStationClassmark1__TV_template::log_match(const MobileStationClassmark1__TV& 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_rf__PowerCapability.match(match_value.rf__PowerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".rf_PowerCapability");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a5__1.match(match_value.a5__1(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_1");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_esind.match(match_value.esind(), legacy)){
TTCN_Logger::log_logmatch_info(".esind");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_revisionLevel.match(match_value.revisionLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".revisionLevel");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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);
}
}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(", rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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(" }");
} 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 MobileStationClassmark1__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
}

void MobileStationClassmark1__TV_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_rf__PowerCapability.encode_text(text_buf);
single_value->field_a5__1.encode_text(text_buf);
single_value->field_esind.encode_text(text_buf);
single_value->field_revisionLevel.encode_text(text_buf);
single_value->field_spare1__1.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_CommonIE_Types.MobileStationClassmark1_TV.");
}
}

void MobileStationClassmark1__TV_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_rf__PowerCapability.decode_text(text_buf);
single_value->field_a5__1.decode_text(text_buf);
single_value->field_esind.decode_text(text_buf);
single_value->field_revisionLevel.decode_text(text_buf);
single_value->field_spare1__1.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 MobileStationClassmark1__TV_template[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_CommonIE_Types.MobileStationClassmark1_TV.");
}
}

void MobileStationClassmark1__TV_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: {
    MobileStationClassmark1__TV_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_CommonIE_Types.MobileStationClassmark1_TV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rf__PowerCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare1__1().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(), "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(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark1_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileStationClassmark1__TV_template* precondition = new MobileStationClassmark1__TV_template;
    precondition->set_param(*param.get_elem(0));
    MobileStationClassmark1__TV_template* implied_template = new MobileStationClassmark1__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileStationClassmark1__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileStationClassmark1__TV_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_CommonIE_Types.MobileStationClassmark1_TV");
single_value->field_rf__PowerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV");
single_value->field_a5__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV");
single_value->field_esind.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV");
single_value->field_revisionLevel.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV");
single_value->field_spare1__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_TV");
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_CommonIE_Types.MobileStationClassmark1_TV");
}

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

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

MobileStationClassmark1__V::MobileStationClassmark1__V()
{
}

MobileStationClassmark1__V::MobileStationClassmark1__V(const BITSTRING& par_rf__PowerCapability,
    const BITSTRING& par_a5__1,
    const BITSTRING& par_esind,
    const BITSTRING& par_revisionLevel,
    const BITSTRING& par_spare1__1)
  :   field_rf__PowerCapability(par_rf__PowerCapability),
  field_a5__1(par_a5__1),
  field_esind(par_esind),
  field_revisionLevel(par_revisionLevel),
  field_spare1__1(par_spare1__1)
{
}

MobileStationClassmark1__V::MobileStationClassmark1__V(const MobileStationClassmark1__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark1_V.");
if (other_value.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
else field_rf__PowerCapability.clean_up();
if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
else field_a5__1.clean_up();
if (other_value.esind().is_bound()) field_esind = other_value.esind();
else field_esind.clean_up();
if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
else field_revisionLevel.clean_up();
if (other_value.spare1__1().is_bound()) field_spare1__1 = other_value.spare1__1();
else field_spare1__1.clean_up();
}

void MobileStationClassmark1__V::clean_up()
{
field_rf__PowerCapability.clean_up();
field_a5__1.clean_up();
field_esind.clean_up();
field_revisionLevel.clean_up();
field_spare1__1.clean_up();
}

const TTCN_Typedescriptor_t* MobileStationClassmark1__V::get_descriptor() const { return &MobileStationClassmark1__V_descr_; }
MobileStationClassmark1__V& MobileStationClassmark1__V::operator=(const MobileStationClassmark1__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark1_V.");
  if (other_value.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
  else field_rf__PowerCapability.clean_up();
  if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
  else field_a5__1.clean_up();
  if (other_value.esind().is_bound()) field_esind = other_value.esind();
  else field_esind.clean_up();
  if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
  else field_revisionLevel.clean_up();
  if (other_value.spare1__1().is_bound()) field_spare1__1 = other_value.spare1__1();
  else field_spare1__1.clean_up();
}
return *this;
}

boolean MobileStationClassmark1__V::operator==(const MobileStationClassmark1__V& other_value) const
{
return field_rf__PowerCapability==other_value.field_rf__PowerCapability
  && field_a5__1==other_value.field_a5__1
  && field_esind==other_value.field_esind
  && field_revisionLevel==other_value.field_revisionLevel
  && field_spare1__1==other_value.field_spare1__1;
}

boolean MobileStationClassmark1__V::is_bound() const
{
return (field_rf__PowerCapability.is_bound())
  || (field_a5__1.is_bound())
  || (field_esind.is_bound())
  || (field_revisionLevel.is_bound())
  || (field_spare1__1.is_bound());
}
boolean MobileStationClassmark1__V::is_value() const
{
return field_rf__PowerCapability.is_value()
  && field_a5__1.is_value()
  && field_esind.is_value()
  && field_revisionLevel.is_value()
  && field_spare1__1.is_value();
}
void MobileStationClassmark1__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rf_PowerCapability := ");
field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
field_spare1__1.log();
TTCN_Logger::log_event_str(" }");
}

void MobileStationClassmark1__V::set_implicit_omit()
{
if (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
}

void MobileStationClassmark1__V::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_CommonIE_Types.MobileStationClassmark1_V 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) rf__PowerCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare1__1().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(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark1_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileStationClassmark1_V");
  }
}

void MobileStationClassmark1__V::encode_text(Text_Buf& text_buf) const
{
field_rf__PowerCapability.encode_text(text_buf);
field_a5__1.encode_text(text_buf);
field_esind.encode_text(text_buf);
field_revisionLevel.encode_text(text_buf);
field_spare1__1.encode_text(text_buf);
}

void MobileStationClassmark1__V::decode_text(Text_Buf& text_buf)
{
field_rf__PowerCapability.decode_text(text_buf);
field_a5__1.decode_text(text_buf);
field_esind.decode_text(text_buf);
field_revisionLevel.decode_text(text_buf);
field_spare1__1.decode_text(text_buf);
}

void MobileStationClassmark1__V::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 MobileStationClassmark1__V::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 MobileStationClassmark1__V::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_rf__PowerCapability.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_a5__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_esind.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_revisionLevel.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare1__1.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MobileStationClassmark1__V::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  encoded_length += field_rf__PowerCapability.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_a5__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_esind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_revisionLevel.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare1__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct MobileStationClassmark1__V_template::single_value_struct {
BITSTRING_template field_rf__PowerCapability;
BITSTRING_template field_a5__1;
BITSTRING_template field_esind;
BITSTRING_template field_revisionLevel;
BITSTRING_template field_spare1__1;
};

void MobileStationClassmark1__V_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_rf__PowerCapability = ANY_VALUE;
single_value->field_a5__1 = ANY_VALUE;
single_value->field_esind = ANY_VALUE;
single_value->field_revisionLevel = ANY_VALUE;
single_value->field_spare1__1 = ANY_VALUE;
}
}
}

void MobileStationClassmark1__V_template::copy_value(const MobileStationClassmark1__V& other_value)
{
single_value = new single_value_struct;
if (other_value.rf__PowerCapability().is_bound()) {
  single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
  single_value->field_rf__PowerCapability.clean_up();
}
if (other_value.a5__1().is_bound()) {
  single_value->field_a5__1 = other_value.a5__1();
} else {
  single_value->field_a5__1.clean_up();
}
if (other_value.esind().is_bound()) {
  single_value->field_esind = other_value.esind();
} else {
  single_value->field_esind.clean_up();
}
if (other_value.revisionLevel().is_bound()) {
  single_value->field_revisionLevel = other_value.revisionLevel();
} else {
  single_value->field_revisionLevel.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();
}
set_selection(SPECIFIC_VALUE);
}

void MobileStationClassmark1__V_template::copy_template(const MobileStationClassmark1__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rf__PowerCapability().get_selection()) {
single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
single_value->field_rf__PowerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5__1().get_selection()) {
single_value->field_a5__1 = other_value.a5__1();
} else {
single_value->field_a5__1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.esind().get_selection()) {
single_value->field_esind = other_value.esind();
} else {
single_value->field_esind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.revisionLevel().get_selection()) {
single_value->field_revisionLevel = other_value.revisionLevel();
} else {
single_value->field_revisionLevel.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();
}
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 MobileStationClassmark1__V_template[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 MobileStationClassmark1__V_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileStationClassmark1__V_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_CommonIE_Types.MobileStationClassmark1_V.");
break;
}
set_selection(other_value);
}

MobileStationClassmark1__V_template::MobileStationClassmark1__V_template()
{
}

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

MobileStationClassmark1__V_template::MobileStationClassmark1__V_template(const MobileStationClassmark1__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileStationClassmark1__V_template::match(const MobileStationClassmark1__V& 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.rf__PowerCapability().is_bound()) return FALSE;
if(!single_value->field_rf__PowerCapability.match(other_value.rf__PowerCapability(), legacy))return FALSE;
if(!other_value.a5__1().is_bound()) return FALSE;
if(!single_value->field_a5__1.match(other_value.a5__1(), legacy))return FALSE;
if(!other_value.esind().is_bound()) return FALSE;
if(!single_value->field_esind.match(other_value.esind(), legacy))return FALSE;
if(!other_value.revisionLevel().is_bound()) return FALSE;
if(!single_value->field_revisionLevel.match(other_value.revisionLevel(), 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;
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_CommonIE_Types.MobileStationClassmark1_V.");
}
return FALSE;
}

boolean MobileStationClassmark1__V_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rf__PowerCapability.is_bound()
 || single_value->field_a5__1.is_bound()
 || single_value->field_esind.is_bound()
 || single_value->field_revisionLevel.is_bound()
 || single_value->field_spare1__1.is_bound();
}

boolean MobileStationClassmark1__V_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rf__PowerCapability.is_value()
 && single_value->field_a5__1.is_value()
 && single_value->field_esind.is_value()
 && single_value->field_revisionLevel.is_value()
 && single_value->field_spare1__1.is_value();
}

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

MobileStationClassmark1__V MobileStationClassmark1__V_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_CommonIE_Types.MobileStationClassmark1_V.");
MobileStationClassmark1__V ret_val;
if (single_value->field_rf__PowerCapability.is_bound()) {
ret_val.rf__PowerCapability() = single_value->field_rf__PowerCapability.valueof();
}
if (single_value->field_a5__1.is_bound()) {
ret_val.a5__1() = single_value->field_a5__1.valueof();
}
if (single_value->field_esind.is_bound()) {
ret_val.esind() = single_value->field_esind.valueof();
}
if (single_value->field_revisionLevel.is_bound()) {
ret_val.revisionLevel() = single_value->field_revisionLevel.valueof();
}
if (single_value->field_spare1__1.is_bound()) {
ret_val.spare1__1() = single_value->field_spare1__1.valueof();
}
return ret_val;
}

void MobileStationClassmark1__V_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_CommonIE_Types.MobileStationClassmark1_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileStationClassmark1__V_template[list_length];
}

MobileStationClassmark1__V_template& MobileStationClassmark1__V_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_CommonIE_Types.MobileStationClassmark1_V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_V.");
return value_list.list_value[list_index];
}

BITSTRING_template& MobileStationClassmark1__V_template::rf__PowerCapability()
{
set_specific();
return single_value->field_rf__PowerCapability;
}

const BITSTRING_template& MobileStationClassmark1__V_template::rf__PowerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rf_PowerCapability of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_V.");
return single_value->field_rf__PowerCapability;
}

BITSTRING_template& MobileStationClassmark1__V_template::a5__1()
{
set_specific();
return single_value->field_a5__1;
}

const BITSTRING_template& MobileStationClassmark1__V_template::a5__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_1 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_V.");
return single_value->field_a5__1;
}

BITSTRING_template& MobileStationClassmark1__V_template::esind()
{
set_specific();
return single_value->field_esind;
}

const BITSTRING_template& MobileStationClassmark1__V_template::esind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field esind of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_V.");
return single_value->field_esind;
}

BITSTRING_template& MobileStationClassmark1__V_template::revisionLevel()
{
set_specific();
return single_value->field_revisionLevel;
}

const BITSTRING_template& MobileStationClassmark1__V_template::revisionLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field revisionLevel of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark1_V.");
return single_value->field_revisionLevel;
}

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

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

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

void MobileStationClassmark1__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
single_value->field_spare1__1.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 MobileStationClassmark1__V_template::log_match(const MobileStationClassmark1__V& 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_rf__PowerCapability.match(match_value.rf__PowerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".rf_PowerCapability");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a5__1.match(match_value.a5__1(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_1");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_esind.match(match_value.esind(), legacy)){
TTCN_Logger::log_logmatch_info(".esind");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_revisionLevel.match(match_value.revisionLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".revisionLevel");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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);
}
}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("{ rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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(" }");
} 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 MobileStationClassmark1__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
}

void MobileStationClassmark1__V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rf__PowerCapability.encode_text(text_buf);
single_value->field_a5__1.encode_text(text_buf);
single_value->field_esind.encode_text(text_buf);
single_value->field_revisionLevel.encode_text(text_buf);
single_value->field_spare1__1.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_CommonIE_Types.MobileStationClassmark1_V.");
}
}

void MobileStationClassmark1__V_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_rf__PowerCapability.decode_text(text_buf);
single_value->field_a5__1.decode_text(text_buf);
single_value->field_esind.decode_text(text_buf);
single_value->field_revisionLevel.decode_text(text_buf);
single_value->field_spare1__1.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 MobileStationClassmark1__V_template[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_CommonIE_Types.MobileStationClassmark1_V.");
}
}

void MobileStationClassmark1__V_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: {
    MobileStationClassmark1__V_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_CommonIE_Types.MobileStationClassmark1_V 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) rf__PowerCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare1__1().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(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark1_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileStationClassmark1__V_template* precondition = new MobileStationClassmark1__V_template;
    precondition->set_param(*param.get_elem(0));
    MobileStationClassmark1__V_template* implied_template = new MobileStationClassmark1__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileStationClassmark1__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileStationClassmark1_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileStationClassmark1__V_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_rf__PowerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_V");
single_value->field_a5__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_V");
single_value->field_esind.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_V");
single_value->field_revisionLevel.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_V");
single_value->field_spare1__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark1_V");
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_CommonIE_Types.MobileStationClassmark1_V");
}

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

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

MobileStationClassmark2__oct4::MobileStationClassmark2__oct4()
{
}

MobileStationClassmark2__oct4::MobileStationClassmark2__oct4(const BITSTRING& par_fc,
    const BITSTRING& par_vgcs,
    const BITSTRING& par_vbs,
    const BITSTRING& par_sm__Capability,
    const BITSTRING& par_ss__ScreenIndicator,
    const BITSTRING& par_ps__Capability,
    const BITSTRING& par_spare2__1)
  :   field_fc(par_fc),
  field_vgcs(par_vgcs),
  field_vbs(par_vbs),
  field_sm__Capability(par_sm__Capability),
  field_ss__ScreenIndicator(par_ss__ScreenIndicator),
  field_ps__Capability(par_ps__Capability),
  field_spare2__1(par_spare2__1)
{
}

MobileStationClassmark2__oct4::MobileStationClassmark2__oct4(const MobileStationClassmark2__oct4& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
if (other_value.fc().is_bound()) field_fc = other_value.fc();
else field_fc.clean_up();
if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs();
else field_vgcs.clean_up();
if (other_value.vbs().is_bound()) field_vbs = other_value.vbs();
else field_vbs.clean_up();
if (other_value.sm__Capability().is_bound()) field_sm__Capability = other_value.sm__Capability();
else field_sm__Capability.clean_up();
if (other_value.ss__ScreenIndicator().is_bound()) field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
else field_ss__ScreenIndicator.clean_up();
if (other_value.ps__Capability().is_bound()) field_ps__Capability = other_value.ps__Capability();
else field_ps__Capability.clean_up();
if (other_value.spare2__1().is_bound()) field_spare2__1 = other_value.spare2__1();
else field_spare2__1.clean_up();
}

void MobileStationClassmark2__oct4::clean_up()
{
field_fc.clean_up();
field_vgcs.clean_up();
field_vbs.clean_up();
field_sm__Capability.clean_up();
field_ss__ScreenIndicator.clean_up();
field_ps__Capability.clean_up();
field_spare2__1.clean_up();
}

const TTCN_Typedescriptor_t* MobileStationClassmark2__oct4::get_descriptor() const { return &MobileStationClassmark2__oct4_descr_; }
MobileStationClassmark2__oct4& MobileStationClassmark2__oct4::operator=(const MobileStationClassmark2__oct4& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
  if (other_value.fc().is_bound()) field_fc = other_value.fc();
  else field_fc.clean_up();
  if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs();
  else field_vgcs.clean_up();
  if (other_value.vbs().is_bound()) field_vbs = other_value.vbs();
  else field_vbs.clean_up();
  if (other_value.sm__Capability().is_bound()) field_sm__Capability = other_value.sm__Capability();
  else field_sm__Capability.clean_up();
  if (other_value.ss__ScreenIndicator().is_bound()) field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
  else field_ss__ScreenIndicator.clean_up();
  if (other_value.ps__Capability().is_bound()) field_ps__Capability = other_value.ps__Capability();
  else field_ps__Capability.clean_up();
  if (other_value.spare2__1().is_bound()) field_spare2__1 = other_value.spare2__1();
  else field_spare2__1.clean_up();
}
return *this;
}

boolean MobileStationClassmark2__oct4::operator==(const MobileStationClassmark2__oct4& other_value) const
{
return field_fc==other_value.field_fc
  && field_vgcs==other_value.field_vgcs
  && field_vbs==other_value.field_vbs
  && field_sm__Capability==other_value.field_sm__Capability
  && field_ss__ScreenIndicator==other_value.field_ss__ScreenIndicator
  && field_ps__Capability==other_value.field_ps__Capability
  && field_spare2__1==other_value.field_spare2__1;
}

boolean MobileStationClassmark2__oct4::is_bound() const
{
return (field_fc.is_bound())
  || (field_vgcs.is_bound())
  || (field_vbs.is_bound())
  || (field_sm__Capability.is_bound())
  || (field_ss__ScreenIndicator.is_bound())
  || (field_ps__Capability.is_bound())
  || (field_spare2__1.is_bound());
}
boolean MobileStationClassmark2__oct4::is_value() const
{
return field_fc.is_value()
  && field_vgcs.is_value()
  && field_vbs.is_value()
  && field_sm__Capability.is_value()
  && field_ss__ScreenIndicator.is_value()
  && field_ps__Capability.is_value()
  && field_spare2__1.is_value();
}
void MobileStationClassmark2__oct4::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ fc := ");
field_fc.log();
TTCN_Logger::log_event_str(", vgcs := ");
field_vgcs.log();
TTCN_Logger::log_event_str(", vbs := ");
field_vbs.log();
TTCN_Logger::log_event_str(", sm_Capability := ");
field_sm__Capability.log();
TTCN_Logger::log_event_str(", ss_ScreenIndicator := ");
field_ss__ScreenIndicator.log();
TTCN_Logger::log_event_str(", ps_Capability := ");
field_ps__Capability.log();
TTCN_Logger::log_event_str(", spare2_1 := ");
field_spare2__1.log();
TTCN_Logger::log_event_str(" }");
}

void MobileStationClassmark2__oct4::set_implicit_omit()
{
if (fc().is_bound()) fc().set_implicit_omit();
if (vgcs().is_bound()) vgcs().set_implicit_omit();
if (vbs().is_bound()) vbs().set_implicit_omit();
if (sm__Capability().is_bound()) sm__Capability().set_implicit_omit();
if (ss__ScreenIndicator().is_bound()) ss__ScreenIndicator().set_implicit_omit();
if (ps__Capability().is_bound()) ps__Capability().set_implicit_omit();
if (spare2__1().is_bound()) spare2__1().set_implicit_omit();
}

void MobileStationClassmark2__oct4::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_CommonIE_Types.MobileStationClassmark2_oct4 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) fc().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) sm__Capability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ss__ScreenIndicator().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ps__Capability().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare2__1().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(), "fc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vgcs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vgcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vbs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vbs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sm_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sm__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_ScreenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__ScreenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2__1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
  }
}

void MobileStationClassmark2__oct4::encode_text(Text_Buf& text_buf) const
{
field_fc.encode_text(text_buf);
field_vgcs.encode_text(text_buf);
field_vbs.encode_text(text_buf);
field_sm__Capability.encode_text(text_buf);
field_ss__ScreenIndicator.encode_text(text_buf);
field_ps__Capability.encode_text(text_buf);
field_spare2__1.encode_text(text_buf);
}

void MobileStationClassmark2__oct4::decode_text(Text_Buf& text_buf)
{
field_fc.decode_text(text_buf);
field_vgcs.decode_text(text_buf);
field_vbs.decode_text(text_buf);
field_sm__Capability.decode_text(text_buf);
field_ss__ScreenIndicator.decode_text(text_buf);
field_ps__Capability.decode_text(text_buf);
field_spare2__1.decode_text(text_buf);
}

void MobileStationClassmark2__oct4::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 MobileStationClassmark2__oct4::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 MobileStationClassmark2__oct4::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_fc.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_vgcs.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_vbs.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_sm__Capability.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_ss__ScreenIndicator.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_ps__Capability.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare2__1.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MobileStationClassmark2__oct4::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  encoded_length += field_fc.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_vgcs.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_vbs.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_sm__Capability.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_ss__ScreenIndicator.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_ps__Capability.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare2__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct MobileStationClassmark2__oct4_template::single_value_struct {
BITSTRING_template field_fc;
BITSTRING_template field_vgcs;
BITSTRING_template field_vbs;
BITSTRING_template field_sm__Capability;
BITSTRING_template field_ss__ScreenIndicator;
BITSTRING_template field_ps__Capability;
BITSTRING_template field_spare2__1;
};

void MobileStationClassmark2__oct4_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_fc = ANY_VALUE;
single_value->field_vgcs = ANY_VALUE;
single_value->field_vbs = ANY_VALUE;
single_value->field_sm__Capability = ANY_VALUE;
single_value->field_ss__ScreenIndicator = ANY_VALUE;
single_value->field_ps__Capability = ANY_VALUE;
single_value->field_spare2__1 = ANY_VALUE;
}
}
}

void MobileStationClassmark2__oct4_template::copy_value(const MobileStationClassmark2__oct4& other_value)
{
single_value = new single_value_struct;
if (other_value.fc().is_bound()) {
  single_value->field_fc = other_value.fc();
} else {
  single_value->field_fc.clean_up();
}
if (other_value.vgcs().is_bound()) {
  single_value->field_vgcs = other_value.vgcs();
} else {
  single_value->field_vgcs.clean_up();
}
if (other_value.vbs().is_bound()) {
  single_value->field_vbs = other_value.vbs();
} else {
  single_value->field_vbs.clean_up();
}
if (other_value.sm__Capability().is_bound()) {
  single_value->field_sm__Capability = other_value.sm__Capability();
} else {
  single_value->field_sm__Capability.clean_up();
}
if (other_value.ss__ScreenIndicator().is_bound()) {
  single_value->field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
} else {
  single_value->field_ss__ScreenIndicator.clean_up();
}
if (other_value.ps__Capability().is_bound()) {
  single_value->field_ps__Capability = other_value.ps__Capability();
} else {
  single_value->field_ps__Capability.clean_up();
}
if (other_value.spare2__1().is_bound()) {
  single_value->field_spare2__1 = other_value.spare2__1();
} else {
  single_value->field_spare2__1.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileStationClassmark2__oct4_template::copy_template(const MobileStationClassmark2__oct4_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.fc().get_selection()) {
single_value->field_fc = other_value.fc();
} else {
single_value->field_fc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vgcs().get_selection()) {
single_value->field_vgcs = other_value.vgcs();
} else {
single_value->field_vgcs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vbs().get_selection()) {
single_value->field_vbs = other_value.vbs();
} else {
single_value->field_vbs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sm__Capability().get_selection()) {
single_value->field_sm__Capability = other_value.sm__Capability();
} else {
single_value->field_sm__Capability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__ScreenIndicator().get_selection()) {
single_value->field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
} else {
single_value->field_ss__ScreenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ps__Capability().get_selection()) {
single_value->field_ps__Capability = other_value.ps__Capability();
} else {
single_value->field_ps__Capability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2__1().get_selection()) {
single_value->field_spare2__1 = other_value.spare2__1();
} else {
single_value->field_spare2__1.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 MobileStationClassmark2__oct4_template[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 MobileStationClassmark2__oct4_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileStationClassmark2__oct4_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_CommonIE_Types.MobileStationClassmark2_oct4.");
break;
}
set_selection(other_value);
}

MobileStationClassmark2__oct4_template::MobileStationClassmark2__oct4_template()
{
}

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

MobileStationClassmark2__oct4_template::MobileStationClassmark2__oct4_template(const MobileStationClassmark2__oct4& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileStationClassmark2__oct4_template::match(const MobileStationClassmark2__oct4& 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.fc().is_bound()) return FALSE;
if(!single_value->field_fc.match(other_value.fc(), legacy))return FALSE;
if(!other_value.vgcs().is_bound()) return FALSE;
if(!single_value->field_vgcs.match(other_value.vgcs(), legacy))return FALSE;
if(!other_value.vbs().is_bound()) return FALSE;
if(!single_value->field_vbs.match(other_value.vbs(), legacy))return FALSE;
if(!other_value.sm__Capability().is_bound()) return FALSE;
if(!single_value->field_sm__Capability.match(other_value.sm__Capability(), legacy))return FALSE;
if(!other_value.ss__ScreenIndicator().is_bound()) return FALSE;
if(!single_value->field_ss__ScreenIndicator.match(other_value.ss__ScreenIndicator(), legacy))return FALSE;
if(!other_value.ps__Capability().is_bound()) return FALSE;
if(!single_value->field_ps__Capability.match(other_value.ps__Capability(), legacy))return FALSE;
if(!other_value.spare2__1().is_bound()) return FALSE;
if(!single_value->field_spare2__1.match(other_value.spare2__1(), 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_CommonIE_Types.MobileStationClassmark2_oct4.");
}
return FALSE;
}

boolean MobileStationClassmark2__oct4_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_fc.is_bound()
 || single_value->field_vgcs.is_bound()
 || single_value->field_vbs.is_bound()
 || single_value->field_sm__Capability.is_bound()
 || single_value->field_ss__ScreenIndicator.is_bound()
 || single_value->field_ps__Capability.is_bound()
 || single_value->field_spare2__1.is_bound();
}

boolean MobileStationClassmark2__oct4_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_fc.is_value()
 && single_value->field_vgcs.is_value()
 && single_value->field_vbs.is_value()
 && single_value->field_sm__Capability.is_value()
 && single_value->field_ss__ScreenIndicator.is_value()
 && single_value->field_ps__Capability.is_value()
 && single_value->field_spare2__1.is_value();
}

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

MobileStationClassmark2__oct4 MobileStationClassmark2__oct4_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_CommonIE_Types.MobileStationClassmark2_oct4.");
MobileStationClassmark2__oct4 ret_val;
if (single_value->field_fc.is_bound()) {
ret_val.fc() = single_value->field_fc.valueof();
}
if (single_value->field_vgcs.is_bound()) {
ret_val.vgcs() = single_value->field_vgcs.valueof();
}
if (single_value->field_vbs.is_bound()) {
ret_val.vbs() = single_value->field_vbs.valueof();
}
if (single_value->field_sm__Capability.is_bound()) {
ret_val.sm__Capability() = single_value->field_sm__Capability.valueof();
}
if (single_value->field_ss__ScreenIndicator.is_bound()) {
ret_val.ss__ScreenIndicator() = single_value->field_ss__ScreenIndicator.valueof();
}
if (single_value->field_ps__Capability.is_bound()) {
ret_val.ps__Capability() = single_value->field_ps__Capability.valueof();
}
if (single_value->field_spare2__1.is_bound()) {
ret_val.spare2__1() = single_value->field_spare2__1.valueof();
}
return ret_val;
}

void MobileStationClassmark2__oct4_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_CommonIE_Types.MobileStationClassmark2_oct4.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileStationClassmark2__oct4_template[list_length];
}

MobileStationClassmark2__oct4_template& MobileStationClassmark2__oct4_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_CommonIE_Types.MobileStationClassmark2_oct4.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return value_list.list_value[list_index];
}

BITSTRING_template& MobileStationClassmark2__oct4_template::fc()
{
set_specific();
return single_value->field_fc;
}

const BITSTRING_template& MobileStationClassmark2__oct4_template::fc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fc of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return single_value->field_fc;
}

BITSTRING_template& MobileStationClassmark2__oct4_template::vgcs()
{
set_specific();
return single_value->field_vgcs;
}

const BITSTRING_template& MobileStationClassmark2__oct4_template::vgcs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vgcs of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return single_value->field_vgcs;
}

BITSTRING_template& MobileStationClassmark2__oct4_template::vbs()
{
set_specific();
return single_value->field_vbs;
}

const BITSTRING_template& MobileStationClassmark2__oct4_template::vbs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vbs of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return single_value->field_vbs;
}

BITSTRING_template& MobileStationClassmark2__oct4_template::sm__Capability()
{
set_specific();
return single_value->field_sm__Capability;
}

const BITSTRING_template& MobileStationClassmark2__oct4_template::sm__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sm_Capability of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return single_value->field_sm__Capability;
}

BITSTRING_template& MobileStationClassmark2__oct4_template::ss__ScreenIndicator()
{
set_specific();
return single_value->field_ss__ScreenIndicator;
}

const BITSTRING_template& MobileStationClassmark2__oct4_template::ss__ScreenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_ScreenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return single_value->field_ss__ScreenIndicator;
}

BITSTRING_template& MobileStationClassmark2__oct4_template::ps__Capability()
{
set_specific();
return single_value->field_ps__Capability;
}

const BITSTRING_template& MobileStationClassmark2__oct4_template::ps__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ps_Capability of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return single_value->field_ps__Capability;
}

BITSTRING_template& MobileStationClassmark2__oct4_template::spare2__1()
{
set_specific();
return single_value->field_spare2__1;
}

const BITSTRING_template& MobileStationClassmark2__oct4_template::spare2__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare2_1 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4.");
return single_value->field_spare2__1;
}

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

void MobileStationClassmark2__oct4_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ fc := ");
single_value->field_fc.log();
TTCN_Logger::log_event_str(", vgcs := ");
single_value->field_vgcs.log();
TTCN_Logger::log_event_str(", vbs := ");
single_value->field_vbs.log();
TTCN_Logger::log_event_str(", sm_Capability := ");
single_value->field_sm__Capability.log();
TTCN_Logger::log_event_str(", ss_ScreenIndicator := ");
single_value->field_ss__ScreenIndicator.log();
TTCN_Logger::log_event_str(", ps_Capability := ");
single_value->field_ps__Capability.log();
TTCN_Logger::log_event_str(", spare2_1 := ");
single_value->field_spare2__1.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 MobileStationClassmark2__oct4_template::log_match(const MobileStationClassmark2__oct4& 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_fc.match(match_value.fc(), legacy)){
TTCN_Logger::log_logmatch_info(".fc");
single_value->field_fc.log_match(match_value.fc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vgcs.match(match_value.vgcs(), legacy)){
TTCN_Logger::log_logmatch_info(".vgcs");
single_value->field_vgcs.log_match(match_value.vgcs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vbs.match(match_value.vbs(), legacy)){
TTCN_Logger::log_logmatch_info(".vbs");
single_value->field_vbs.log_match(match_value.vbs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sm__Capability.match(match_value.sm__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".sm_Capability");
single_value->field_sm__Capability.log_match(match_value.sm__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ss__ScreenIndicator.match(match_value.ss__ScreenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_ScreenIndicator");
single_value->field_ss__ScreenIndicator.log_match(match_value.ss__ScreenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ps__Capability.match(match_value.ps__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".ps_Capability");
single_value->field_ps__Capability.log_match(match_value.ps__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare2__1.match(match_value.spare2__1(), legacy)){
TTCN_Logger::log_logmatch_info(".spare2_1");
single_value->field_spare2__1.log_match(match_value.spare2__1(), 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("{ fc := ");
single_value->field_fc.log_match(match_value.fc(), legacy);
TTCN_Logger::log_event_str(", vgcs := ");
single_value->field_vgcs.log_match(match_value.vgcs(), legacy);
TTCN_Logger::log_event_str(", vbs := ");
single_value->field_vbs.log_match(match_value.vbs(), legacy);
TTCN_Logger::log_event_str(", sm_Capability := ");
single_value->field_sm__Capability.log_match(match_value.sm__Capability(), legacy);
TTCN_Logger::log_event_str(", ss_ScreenIndicator := ");
single_value->field_ss__ScreenIndicator.log_match(match_value.ss__ScreenIndicator(), legacy);
TTCN_Logger::log_event_str(", ps_Capability := ");
single_value->field_ps__Capability.log_match(match_value.ps__Capability(), legacy);
TTCN_Logger::log_event_str(", spare2_1 := ");
single_value->field_spare2__1.log_match(match_value.spare2__1(), 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 MobileStationClassmark2__oct4_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (fc().is_bound()) fc().set_implicit_omit();
if (vgcs().is_bound()) vgcs().set_implicit_omit();
if (vbs().is_bound()) vbs().set_implicit_omit();
if (sm__Capability().is_bound()) sm__Capability().set_implicit_omit();
if (ss__ScreenIndicator().is_bound()) ss__ScreenIndicator().set_implicit_omit();
if (ps__Capability().is_bound()) ps__Capability().set_implicit_omit();
if (spare2__1().is_bound()) spare2__1().set_implicit_omit();
}

void MobileStationClassmark2__oct4_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_fc.encode_text(text_buf);
single_value->field_vgcs.encode_text(text_buf);
single_value->field_vbs.encode_text(text_buf);
single_value->field_sm__Capability.encode_text(text_buf);
single_value->field_ss__ScreenIndicator.encode_text(text_buf);
single_value->field_ps__Capability.encode_text(text_buf);
single_value->field_spare2__1.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_CommonIE_Types.MobileStationClassmark2_oct4.");
}
}

void MobileStationClassmark2__oct4_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_fc.decode_text(text_buf);
single_value->field_vgcs.decode_text(text_buf);
single_value->field_vbs.decode_text(text_buf);
single_value->field_sm__Capability.decode_text(text_buf);
single_value->field_ss__ScreenIndicator.decode_text(text_buf);
single_value->field_ps__Capability.decode_text(text_buf);
single_value->field_spare2__1.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 MobileStationClassmark2__oct4_template[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_CommonIE_Types.MobileStationClassmark2_oct4.");
}
}

void MobileStationClassmark2__oct4_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: {
    MobileStationClassmark2__oct4_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_CommonIE_Types.MobileStationClassmark2_oct4 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) fc().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) sm__Capability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ss__ScreenIndicator().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ps__Capability().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare2__1().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(), "fc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vgcs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vgcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vbs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vbs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sm_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sm__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_ScreenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__ScreenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2__1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct4: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileStationClassmark2__oct4_template* precondition = new MobileStationClassmark2__oct4_template;
    precondition->set_param(*param.get_elem(0));
    MobileStationClassmark2__oct4_template* implied_template = new MobileStationClassmark2__oct4_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileStationClassmark2__oct4_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileStationClassmark2__oct4_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_fc.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
single_value->field_vgcs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
single_value->field_vbs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
single_value->field_sm__Capability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
single_value->field_ss__ScreenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
single_value->field_ps__Capability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
single_value->field_spare2__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct4");
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_CommonIE_Types.MobileStationClassmark2_oct4");
}

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

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

MobileStationClassmark2__oct5::MobileStationClassmark2__oct5()
{
}

MobileStationClassmark2__oct5::MobileStationClassmark2__oct5(const BITSTRING& par_a5__2,
    const BITSTRING& par_a5__3,
    const BITSTRING& par_cmsp,
    const BITSTRING& par_solsa,
    const BITSTRING& par_ucs2,
    const BITSTRING& par_lcsva__cap,
    const BITSTRING& par_spare5__7,
    const BITSTRING& par_cm3)
  :   field_a5__2(par_a5__2),
  field_a5__3(par_a5__3),
  field_cmsp(par_cmsp),
  field_solsa(par_solsa),
  field_ucs2(par_ucs2),
  field_lcsva__cap(par_lcsva__cap),
  field_spare5__7(par_spare5__7),
  field_cm3(par_cm3)
{
}

MobileStationClassmark2__oct5::MobileStationClassmark2__oct5(const MobileStationClassmark2__oct5& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
if (other_value.a5__2().is_bound()) field_a5__2 = other_value.a5__2();
else field_a5__2.clean_up();
if (other_value.a5__3().is_bound()) field_a5__3 = other_value.a5__3();
else field_a5__3.clean_up();
if (other_value.cmsp().is_bound()) field_cmsp = other_value.cmsp();
else field_cmsp.clean_up();
if (other_value.solsa().is_bound()) field_solsa = other_value.solsa();
else field_solsa.clean_up();
if (other_value.ucs2().is_bound()) field_ucs2 = other_value.ucs2();
else field_ucs2.clean_up();
if (other_value.lcsva__cap().is_bound()) field_lcsva__cap = other_value.lcsva__cap();
else field_lcsva__cap.clean_up();
if (other_value.spare5__7().is_bound()) field_spare5__7 = other_value.spare5__7();
else field_spare5__7.clean_up();
if (other_value.cm3().is_bound()) field_cm3 = other_value.cm3();
else field_cm3.clean_up();
}

void MobileStationClassmark2__oct5::clean_up()
{
field_a5__2.clean_up();
field_a5__3.clean_up();
field_cmsp.clean_up();
field_solsa.clean_up();
field_ucs2.clean_up();
field_lcsva__cap.clean_up();
field_spare5__7.clean_up();
field_cm3.clean_up();
}

const TTCN_Typedescriptor_t* MobileStationClassmark2__oct5::get_descriptor() const { return &MobileStationClassmark2__oct5_descr_; }
MobileStationClassmark2__oct5& MobileStationClassmark2__oct5::operator=(const MobileStationClassmark2__oct5& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
  if (other_value.a5__2().is_bound()) field_a5__2 = other_value.a5__2();
  else field_a5__2.clean_up();
  if (other_value.a5__3().is_bound()) field_a5__3 = other_value.a5__3();
  else field_a5__3.clean_up();
  if (other_value.cmsp().is_bound()) field_cmsp = other_value.cmsp();
  else field_cmsp.clean_up();
  if (other_value.solsa().is_bound()) field_solsa = other_value.solsa();
  else field_solsa.clean_up();
  if (other_value.ucs2().is_bound()) field_ucs2 = other_value.ucs2();
  else field_ucs2.clean_up();
  if (other_value.lcsva__cap().is_bound()) field_lcsva__cap = other_value.lcsva__cap();
  else field_lcsva__cap.clean_up();
  if (other_value.spare5__7().is_bound()) field_spare5__7 = other_value.spare5__7();
  else field_spare5__7.clean_up();
  if (other_value.cm3().is_bound()) field_cm3 = other_value.cm3();
  else field_cm3.clean_up();
}
return *this;
}

boolean MobileStationClassmark2__oct5::operator==(const MobileStationClassmark2__oct5& other_value) const
{
return field_a5__2==other_value.field_a5__2
  && field_a5__3==other_value.field_a5__3
  && field_cmsp==other_value.field_cmsp
  && field_solsa==other_value.field_solsa
  && field_ucs2==other_value.field_ucs2
  && field_lcsva__cap==other_value.field_lcsva__cap
  && field_spare5__7==other_value.field_spare5__7
  && field_cm3==other_value.field_cm3;
}

boolean MobileStationClassmark2__oct5::is_bound() const
{
return (field_a5__2.is_bound())
  || (field_a5__3.is_bound())
  || (field_cmsp.is_bound())
  || (field_solsa.is_bound())
  || (field_ucs2.is_bound())
  || (field_lcsva__cap.is_bound())
  || (field_spare5__7.is_bound())
  || (field_cm3.is_bound());
}
boolean MobileStationClassmark2__oct5::is_value() const
{
return field_a5__2.is_value()
  && field_a5__3.is_value()
  && field_cmsp.is_value()
  && field_solsa.is_value()
  && field_ucs2.is_value()
  && field_lcsva__cap.is_value()
  && field_spare5__7.is_value()
  && field_cm3.is_value();
}
void MobileStationClassmark2__oct5::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ a5_2 := ");
field_a5__2.log();
TTCN_Logger::log_event_str(", a5_3 := ");
field_a5__3.log();
TTCN_Logger::log_event_str(", cmsp := ");
field_cmsp.log();
TTCN_Logger::log_event_str(", solsa := ");
field_solsa.log();
TTCN_Logger::log_event_str(", ucs2 := ");
field_ucs2.log();
TTCN_Logger::log_event_str(", lcsva_cap := ");
field_lcsva__cap.log();
TTCN_Logger::log_event_str(", spare5_7 := ");
field_spare5__7.log();
TTCN_Logger::log_event_str(", cm3 := ");
field_cm3.log();
TTCN_Logger::log_event_str(" }");
}

void MobileStationClassmark2__oct5::set_implicit_omit()
{
if (a5__2().is_bound()) a5__2().set_implicit_omit();
if (a5__3().is_bound()) a5__3().set_implicit_omit();
if (cmsp().is_bound()) cmsp().set_implicit_omit();
if (solsa().is_bound()) solsa().set_implicit_omit();
if (ucs2().is_bound()) ucs2().set_implicit_omit();
if (lcsva__cap().is_bound()) lcsva__cap().set_implicit_omit();
if (spare5__7().is_bound()) spare5__7().set_implicit_omit();
if (cm3().is_bound()) cm3().set_implicit_omit();
}

void MobileStationClassmark2__oct5::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_CommonIE_Types.MobileStationClassmark2_oct5 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) a5__2().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a5__3().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cmsp().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) solsa().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ucs2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lcsva__cap().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare5__7().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) cm3().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(), "a5_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cmsp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cmsp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "solsa")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          solsa().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ucs2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ucs2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lcsva_cap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lcsva__cap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare5_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare5__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cm3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cm3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
  }
}

void MobileStationClassmark2__oct5::encode_text(Text_Buf& text_buf) const
{
field_a5__2.encode_text(text_buf);
field_a5__3.encode_text(text_buf);
field_cmsp.encode_text(text_buf);
field_solsa.encode_text(text_buf);
field_ucs2.encode_text(text_buf);
field_lcsva__cap.encode_text(text_buf);
field_spare5__7.encode_text(text_buf);
field_cm3.encode_text(text_buf);
}

void MobileStationClassmark2__oct5::decode_text(Text_Buf& text_buf)
{
field_a5__2.decode_text(text_buf);
field_a5__3.decode_text(text_buf);
field_cmsp.decode_text(text_buf);
field_solsa.decode_text(text_buf);
field_ucs2.decode_text(text_buf);
field_lcsva__cap.decode_text(text_buf);
field_spare5__7.decode_text(text_buf);
field_cm3.decode_text(text_buf);
}

void MobileStationClassmark2__oct5::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 MobileStationClassmark2__oct5::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 MobileStationClassmark2__oct5::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_a5__2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_a5__3.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_cmsp.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_solsa.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_ucs2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_lcsva__cap.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare5__7.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cm3.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MobileStationClassmark2__oct5::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT1_descr_.raw);
  encoded_length += field_a5__2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_a5__3.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cmsp.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_solsa.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_ucs2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_lcsva__cap.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare5__7.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_cm3.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct MobileStationClassmark2__oct5_template::single_value_struct {
BITSTRING_template field_a5__2;
BITSTRING_template field_a5__3;
BITSTRING_template field_cmsp;
BITSTRING_template field_solsa;
BITSTRING_template field_ucs2;
BITSTRING_template field_lcsva__cap;
BITSTRING_template field_spare5__7;
BITSTRING_template field_cm3;
};

void MobileStationClassmark2__oct5_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_a5__2 = ANY_VALUE;
single_value->field_a5__3 = ANY_VALUE;
single_value->field_cmsp = ANY_VALUE;
single_value->field_solsa = ANY_VALUE;
single_value->field_ucs2 = ANY_VALUE;
single_value->field_lcsva__cap = ANY_VALUE;
single_value->field_spare5__7 = ANY_VALUE;
single_value->field_cm3 = ANY_VALUE;
}
}
}

void MobileStationClassmark2__oct5_template::copy_value(const MobileStationClassmark2__oct5& other_value)
{
single_value = new single_value_struct;
if (other_value.a5__2().is_bound()) {
  single_value->field_a5__2 = other_value.a5__2();
} else {
  single_value->field_a5__2.clean_up();
}
if (other_value.a5__3().is_bound()) {
  single_value->field_a5__3 = other_value.a5__3();
} else {
  single_value->field_a5__3.clean_up();
}
if (other_value.cmsp().is_bound()) {
  single_value->field_cmsp = other_value.cmsp();
} else {
  single_value->field_cmsp.clean_up();
}
if (other_value.solsa().is_bound()) {
  single_value->field_solsa = other_value.solsa();
} else {
  single_value->field_solsa.clean_up();
}
if (other_value.ucs2().is_bound()) {
  single_value->field_ucs2 = other_value.ucs2();
} else {
  single_value->field_ucs2.clean_up();
}
if (other_value.lcsva__cap().is_bound()) {
  single_value->field_lcsva__cap = other_value.lcsva__cap();
} else {
  single_value->field_lcsva__cap.clean_up();
}
if (other_value.spare5__7().is_bound()) {
  single_value->field_spare5__7 = other_value.spare5__7();
} else {
  single_value->field_spare5__7.clean_up();
}
if (other_value.cm3().is_bound()) {
  single_value->field_cm3 = other_value.cm3();
} else {
  single_value->field_cm3.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileStationClassmark2__oct5_template::copy_template(const MobileStationClassmark2__oct5_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.a5__2().get_selection()) {
single_value->field_a5__2 = other_value.a5__2();
} else {
single_value->field_a5__2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5__3().get_selection()) {
single_value->field_a5__3 = other_value.a5__3();
} else {
single_value->field_a5__3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cmsp().get_selection()) {
single_value->field_cmsp = other_value.cmsp();
} else {
single_value->field_cmsp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.solsa().get_selection()) {
single_value->field_solsa = other_value.solsa();
} else {
single_value->field_solsa.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ucs2().get_selection()) {
single_value->field_ucs2 = other_value.ucs2();
} else {
single_value->field_ucs2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lcsva__cap().get_selection()) {
single_value->field_lcsva__cap = other_value.lcsva__cap();
} else {
single_value->field_lcsva__cap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare5__7().get_selection()) {
single_value->field_spare5__7 = other_value.spare5__7();
} else {
single_value->field_spare5__7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cm3().get_selection()) {
single_value->field_cm3 = other_value.cm3();
} else {
single_value->field_cm3.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 MobileStationClassmark2__oct5_template[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 MobileStationClassmark2__oct5_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileStationClassmark2__oct5_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_CommonIE_Types.MobileStationClassmark2_oct5.");
break;
}
set_selection(other_value);
}

MobileStationClassmark2__oct5_template::MobileStationClassmark2__oct5_template()
{
}

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

MobileStationClassmark2__oct5_template::MobileStationClassmark2__oct5_template(const MobileStationClassmark2__oct5& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileStationClassmark2__oct5_template::match(const MobileStationClassmark2__oct5& 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.a5__2().is_bound()) return FALSE;
if(!single_value->field_a5__2.match(other_value.a5__2(), legacy))return FALSE;
if(!other_value.a5__3().is_bound()) return FALSE;
if(!single_value->field_a5__3.match(other_value.a5__3(), legacy))return FALSE;
if(!other_value.cmsp().is_bound()) return FALSE;
if(!single_value->field_cmsp.match(other_value.cmsp(), legacy))return FALSE;
if(!other_value.solsa().is_bound()) return FALSE;
if(!single_value->field_solsa.match(other_value.solsa(), legacy))return FALSE;
if(!other_value.ucs2().is_bound()) return FALSE;
if(!single_value->field_ucs2.match(other_value.ucs2(), legacy))return FALSE;
if(!other_value.lcsva__cap().is_bound()) return FALSE;
if(!single_value->field_lcsva__cap.match(other_value.lcsva__cap(), legacy))return FALSE;
if(!other_value.spare5__7().is_bound()) return FALSE;
if(!single_value->field_spare5__7.match(other_value.spare5__7(), legacy))return FALSE;
if(!other_value.cm3().is_bound()) return FALSE;
if(!single_value->field_cm3.match(other_value.cm3(), 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_CommonIE_Types.MobileStationClassmark2_oct5.");
}
return FALSE;
}

boolean MobileStationClassmark2__oct5_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_a5__2.is_bound()
 || single_value->field_a5__3.is_bound()
 || single_value->field_cmsp.is_bound()
 || single_value->field_solsa.is_bound()
 || single_value->field_ucs2.is_bound()
 || single_value->field_lcsva__cap.is_bound()
 || single_value->field_spare5__7.is_bound()
 || single_value->field_cm3.is_bound();
}

boolean MobileStationClassmark2__oct5_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_a5__2.is_value()
 && single_value->field_a5__3.is_value()
 && single_value->field_cmsp.is_value()
 && single_value->field_solsa.is_value()
 && single_value->field_ucs2.is_value()
 && single_value->field_lcsva__cap.is_value()
 && single_value->field_spare5__7.is_value()
 && single_value->field_cm3.is_value();
}

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

MobileStationClassmark2__oct5 MobileStationClassmark2__oct5_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_CommonIE_Types.MobileStationClassmark2_oct5.");
MobileStationClassmark2__oct5 ret_val;
if (single_value->field_a5__2.is_bound()) {
ret_val.a5__2() = single_value->field_a5__2.valueof();
}
if (single_value->field_a5__3.is_bound()) {
ret_val.a5__3() = single_value->field_a5__3.valueof();
}
if (single_value->field_cmsp.is_bound()) {
ret_val.cmsp() = single_value->field_cmsp.valueof();
}
if (single_value->field_solsa.is_bound()) {
ret_val.solsa() = single_value->field_solsa.valueof();
}
if (single_value->field_ucs2.is_bound()) {
ret_val.ucs2() = single_value->field_ucs2.valueof();
}
if (single_value->field_lcsva__cap.is_bound()) {
ret_val.lcsva__cap() = single_value->field_lcsva__cap.valueof();
}
if (single_value->field_spare5__7.is_bound()) {
ret_val.spare5__7() = single_value->field_spare5__7.valueof();
}
if (single_value->field_cm3.is_bound()) {
ret_val.cm3() = single_value->field_cm3.valueof();
}
return ret_val;
}

void MobileStationClassmark2__oct5_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_CommonIE_Types.MobileStationClassmark2_oct5.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileStationClassmark2__oct5_template[list_length];
}

MobileStationClassmark2__oct5_template& MobileStationClassmark2__oct5_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_CommonIE_Types.MobileStationClassmark2_oct5.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return value_list.list_value[list_index];
}

BITSTRING_template& MobileStationClassmark2__oct5_template::a5__2()
{
set_specific();
return single_value->field_a5__2;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::a5__2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_2 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_a5__2;
}

BITSTRING_template& MobileStationClassmark2__oct5_template::a5__3()
{
set_specific();
return single_value->field_a5__3;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::a5__3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_3 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_a5__3;
}

BITSTRING_template& MobileStationClassmark2__oct5_template::cmsp()
{
set_specific();
return single_value->field_cmsp;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::cmsp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cmsp of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_cmsp;
}

BITSTRING_template& MobileStationClassmark2__oct5_template::solsa()
{
set_specific();
return single_value->field_solsa;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::solsa() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field solsa of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_solsa;
}

BITSTRING_template& MobileStationClassmark2__oct5_template::ucs2()
{
set_specific();
return single_value->field_ucs2;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::ucs2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ucs2 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_ucs2;
}

BITSTRING_template& MobileStationClassmark2__oct5_template::lcsva__cap()
{
set_specific();
return single_value->field_lcsva__cap;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::lcsva__cap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lcsva_cap of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_lcsva__cap;
}

BITSTRING_template& MobileStationClassmark2__oct5_template::spare5__7()
{
set_specific();
return single_value->field_spare5__7;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::spare5__7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare5_7 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_spare5__7;
}

BITSTRING_template& MobileStationClassmark2__oct5_template::cm3()
{
set_specific();
return single_value->field_cm3;
}

const BITSTRING_template& MobileStationClassmark2__oct5_template::cm3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cm3 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5.");
return single_value->field_cm3;
}

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

void MobileStationClassmark2__oct5_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ a5_2 := ");
single_value->field_a5__2.log();
TTCN_Logger::log_event_str(", a5_3 := ");
single_value->field_a5__3.log();
TTCN_Logger::log_event_str(", cmsp := ");
single_value->field_cmsp.log();
TTCN_Logger::log_event_str(", solsa := ");
single_value->field_solsa.log();
TTCN_Logger::log_event_str(", ucs2 := ");
single_value->field_ucs2.log();
TTCN_Logger::log_event_str(", lcsva_cap := ");
single_value->field_lcsva__cap.log();
TTCN_Logger::log_event_str(", spare5_7 := ");
single_value->field_spare5__7.log();
TTCN_Logger::log_event_str(", cm3 := ");
single_value->field_cm3.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 MobileStationClassmark2__oct5_template::log_match(const MobileStationClassmark2__oct5& 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_a5__2.match(match_value.a5__2(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_2");
single_value->field_a5__2.log_match(match_value.a5__2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a5__3.match(match_value.a5__3(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_3");
single_value->field_a5__3.log_match(match_value.a5__3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cmsp.match(match_value.cmsp(), legacy)){
TTCN_Logger::log_logmatch_info(".cmsp");
single_value->field_cmsp.log_match(match_value.cmsp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_solsa.match(match_value.solsa(), legacy)){
TTCN_Logger::log_logmatch_info(".solsa");
single_value->field_solsa.log_match(match_value.solsa(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ucs2.match(match_value.ucs2(), legacy)){
TTCN_Logger::log_logmatch_info(".ucs2");
single_value->field_ucs2.log_match(match_value.ucs2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lcsva__cap.match(match_value.lcsva__cap(), legacy)){
TTCN_Logger::log_logmatch_info(".lcsva_cap");
single_value->field_lcsva__cap.log_match(match_value.lcsva__cap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare5__7.match(match_value.spare5__7(), legacy)){
TTCN_Logger::log_logmatch_info(".spare5_7");
single_value->field_spare5__7.log_match(match_value.spare5__7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cm3.match(match_value.cm3(), legacy)){
TTCN_Logger::log_logmatch_info(".cm3");
single_value->field_cm3.log_match(match_value.cm3(), 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("{ a5_2 := ");
single_value->field_a5__2.log_match(match_value.a5__2(), legacy);
TTCN_Logger::log_event_str(", a5_3 := ");
single_value->field_a5__3.log_match(match_value.a5__3(), legacy);
TTCN_Logger::log_event_str(", cmsp := ");
single_value->field_cmsp.log_match(match_value.cmsp(), legacy);
TTCN_Logger::log_event_str(", solsa := ");
single_value->field_solsa.log_match(match_value.solsa(), legacy);
TTCN_Logger::log_event_str(", ucs2 := ");
single_value->field_ucs2.log_match(match_value.ucs2(), legacy);
TTCN_Logger::log_event_str(", lcsva_cap := ");
single_value->field_lcsva__cap.log_match(match_value.lcsva__cap(), legacy);
TTCN_Logger::log_event_str(", spare5_7 := ");
single_value->field_spare5__7.log_match(match_value.spare5__7(), legacy);
TTCN_Logger::log_event_str(", cm3 := ");
single_value->field_cm3.log_match(match_value.cm3(), 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 MobileStationClassmark2__oct5_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (a5__2().is_bound()) a5__2().set_implicit_omit();
if (a5__3().is_bound()) a5__3().set_implicit_omit();
if (cmsp().is_bound()) cmsp().set_implicit_omit();
if (solsa().is_bound()) solsa().set_implicit_omit();
if (ucs2().is_bound()) ucs2().set_implicit_omit();
if (lcsva__cap().is_bound()) lcsva__cap().set_implicit_omit();
if (spare5__7().is_bound()) spare5__7().set_implicit_omit();
if (cm3().is_bound()) cm3().set_implicit_omit();
}

void MobileStationClassmark2__oct5_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_a5__2.encode_text(text_buf);
single_value->field_a5__3.encode_text(text_buf);
single_value->field_cmsp.encode_text(text_buf);
single_value->field_solsa.encode_text(text_buf);
single_value->field_ucs2.encode_text(text_buf);
single_value->field_lcsva__cap.encode_text(text_buf);
single_value->field_spare5__7.encode_text(text_buf);
single_value->field_cm3.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_CommonIE_Types.MobileStationClassmark2_oct5.");
}
}

void MobileStationClassmark2__oct5_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_a5__2.decode_text(text_buf);
single_value->field_a5__3.decode_text(text_buf);
single_value->field_cmsp.decode_text(text_buf);
single_value->field_solsa.decode_text(text_buf);
single_value->field_ucs2.decode_text(text_buf);
single_value->field_lcsva__cap.decode_text(text_buf);
single_value->field_spare5__7.decode_text(text_buf);
single_value->field_cm3.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 MobileStationClassmark2__oct5_template[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_CommonIE_Types.MobileStationClassmark2_oct5.");
}
}

void MobileStationClassmark2__oct5_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: {
    MobileStationClassmark2__oct5_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_CommonIE_Types.MobileStationClassmark2_oct5 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) a5__2().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a5__3().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cmsp().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) solsa().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ucs2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lcsva__cap().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare5__7().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) cm3().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(), "a5_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cmsp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cmsp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "solsa")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          solsa().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ucs2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ucs2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lcsva_cap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lcsva__cap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare5_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare5__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cm3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cm3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_oct5: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileStationClassmark2__oct5_template* precondition = new MobileStationClassmark2__oct5_template;
    precondition->set_param(*param.get_elem(0));
    MobileStationClassmark2__oct5_template* implied_template = new MobileStationClassmark2__oct5_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileStationClassmark2__oct5_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileStationClassmark2__oct5_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_a5__2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
single_value->field_a5__3.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
single_value->field_cmsp.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
single_value->field_solsa.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
single_value->field_ucs2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
single_value->field_lcsva__cap.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
single_value->field_spare5__7.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
single_value->field_cm3.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_oct5");
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_CommonIE_Types.MobileStationClassmark2_oct5");
}

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

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

MobileStationClassmark2__LV::MobileStationClassmark2__LV()
{
}

MobileStationClassmark2__LV::MobileStationClassmark2__LV(const INTEGER& par_lengthIndicator,
    const BITSTRING& par_rf__PowerCapability,
    const BITSTRING& par_a5__1,
    const BITSTRING& par_esind,
    const BITSTRING& par_revisionLevel,
    const BITSTRING& par_spare1__1,
    const OPTIONAL< MobileStationClassmark2__oct4 >& par_mobileStationClassmark2__oct4,
    const OPTIONAL< MobileStationClassmark2__oct5 >& par_mobileStationClassmark2__oct5)
  :   field_lengthIndicator(par_lengthIndicator),
  field_rf__PowerCapability(par_rf__PowerCapability),
  field_a5__1(par_a5__1),
  field_esind(par_esind),
  field_revisionLevel(par_revisionLevel),
  field_spare1__1(par_spare1__1),
  field_mobileStationClassmark2__oct4(par_mobileStationClassmark2__oct4),
  field_mobileStationClassmark2__oct5(par_mobileStationClassmark2__oct5)
{
}

MobileStationClassmark2__LV::MobileStationClassmark2__LV(const MobileStationClassmark2__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
else field_rf__PowerCapability.clean_up();
if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
else field_a5__1.clean_up();
if (other_value.esind().is_bound()) field_esind = other_value.esind();
else field_esind.clean_up();
if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
else field_revisionLevel.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.mobileStationClassmark2__oct4().is_bound()) field_mobileStationClassmark2__oct4 = other_value.mobileStationClassmark2__oct4();
else field_mobileStationClassmark2__oct4.clean_up();
if (other_value.mobileStationClassmark2__oct5().is_bound()) field_mobileStationClassmark2__oct5 = other_value.mobileStationClassmark2__oct5();
else field_mobileStationClassmark2__oct5.clean_up();
}

void MobileStationClassmark2__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_rf__PowerCapability.clean_up();
field_a5__1.clean_up();
field_esind.clean_up();
field_revisionLevel.clean_up();
field_spare1__1.clean_up();
field_mobileStationClassmark2__oct4.clean_up();
field_mobileStationClassmark2__oct5.clean_up();
}

const TTCN_Typedescriptor_t* MobileStationClassmark2__LV::get_descriptor() const { return &MobileStationClassmark2__LV_descr_; }
MobileStationClassmark2__LV& MobileStationClassmark2__LV::operator=(const MobileStationClassmark2__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
  else field_rf__PowerCapability.clean_up();
  if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
  else field_a5__1.clean_up();
  if (other_value.esind().is_bound()) field_esind = other_value.esind();
  else field_esind.clean_up();
  if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
  else field_revisionLevel.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.mobileStationClassmark2__oct4().is_bound()) field_mobileStationClassmark2__oct4 = other_value.mobileStationClassmark2__oct4();
  else field_mobileStationClassmark2__oct4.clean_up();
  if (other_value.mobileStationClassmark2__oct5().is_bound()) field_mobileStationClassmark2__oct5 = other_value.mobileStationClassmark2__oct5();
  else field_mobileStationClassmark2__oct5.clean_up();
}
return *this;
}

boolean MobileStationClassmark2__LV::operator==(const MobileStationClassmark2__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_rf__PowerCapability==other_value.field_rf__PowerCapability
  && field_a5__1==other_value.field_a5__1
  && field_esind==other_value.field_esind
  && field_revisionLevel==other_value.field_revisionLevel
  && field_spare1__1==other_value.field_spare1__1
  && field_mobileStationClassmark2__oct4==other_value.field_mobileStationClassmark2__oct4
  && field_mobileStationClassmark2__oct5==other_value.field_mobileStationClassmark2__oct5;
}

boolean MobileStationClassmark2__LV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_rf__PowerCapability.is_bound())
  || (field_a5__1.is_bound())
  || (field_esind.is_bound())
  || (field_revisionLevel.is_bound())
  || (field_spare1__1.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark2__oct4.get_selection() || field_mobileStationClassmark2__oct4.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark2__oct5.get_selection() || field_mobileStationClassmark2__oct5.is_bound());
}
boolean MobileStationClassmark2__LV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_rf__PowerCapability.is_value()
  && field_a5__1.is_value()
  && field_esind.is_value()
  && field_revisionLevel.is_value()
  && field_spare1__1.is_value()
  && (OPTIONAL_OMIT == field_mobileStationClassmark2__oct4.get_selection() || field_mobileStationClassmark2__oct4.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark2__oct5.get_selection() || field_mobileStationClassmark2__oct5.is_value());
}
int MobileStationClassmark2__LV::size_of() const
{
  int ret_val = 6;
  if (field_mobileStationClassmark2__oct4.ispresent()) ret_val++;
  if (field_mobileStationClassmark2__oct5.ispresent()) ret_val++;
  return ret_val;
}

void MobileStationClassmark2__LV::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(", rf_PowerCapability := ");
field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
field_spare1__1.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2_oct4 := ");
field_mobileStationClassmark2__oct4.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2_oct5 := ");
field_mobileStationClassmark2__oct5.log();
TTCN_Logger::log_event_str(" }");
}

void MobileStationClassmark2__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
if (!mobileStationClassmark2__oct4().is_bound()) mobileStationClassmark2__oct4() = OMIT_VALUE;
else mobileStationClassmark2__oct4().set_implicit_omit();
if (!mobileStationClassmark2__oct5().is_bound()) mobileStationClassmark2__oct5() = OMIT_VALUE;
else mobileStationClassmark2__oct5().set_implicit_omit();
}

void MobileStationClassmark2__LV::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_CommonIE_Types.MobileStationClassmark2_LV has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rf__PowerCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare1__1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2__oct4().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2__oct5().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "mobileStationClassmark2_oct4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2__oct4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_oct5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2__oct5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
  }
}

void MobileStationClassmark2__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_rf__PowerCapability.encode_text(text_buf);
field_a5__1.encode_text(text_buf);
field_esind.encode_text(text_buf);
field_revisionLevel.encode_text(text_buf);
field_spare1__1.encode_text(text_buf);
field_mobileStationClassmark2__oct4.encode_text(text_buf);
field_mobileStationClassmark2__oct5.encode_text(text_buf);
}

void MobileStationClassmark2__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_rf__PowerCapability.decode_text(text_buf);
field_a5__1.decode_text(text_buf);
field_esind.decode_text(text_buf);
field_revisionLevel.decode_text(text_buf);
field_spare1__1.decode_text(text_buf);
field_mobileStationClassmark2__oct4.decode_text(text_buf);
field_mobileStationClassmark2__oct5.decode_text(text_buf);
}

void MobileStationClassmark2__LV::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 MobileStationClassmark2__LV::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 MobileStationClassmark2__LV::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, MobileStationClassmark2__LV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MobileStationClassmark2__LV_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(MobileStationClassmark2__LV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_rf__PowerCapability.RAW_decode(General__Types::BIT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_a5__1.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_esind.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_revisionLevel.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare1__1.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_mobileStationClassmark2__oct4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileStationClassmark2__oct4_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2__oct4().RAW_decode(MobileStationClassmark2__oct4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark2__oct4 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_mobileStationClassmark2__oct4=OMIT_VALUE;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_mobileStationClassmark2__oct5 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileStationClassmark2__oct5_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2__oct5().RAW_decode(MobileStationClassmark2__oct5_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark2__oct5 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_mobileStationClassmark2__oct5=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MobileStationClassmark2__LV::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, MobileStationClassmark2__LV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  if (field_mobileStationClassmark2__oct4.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileStationClassmark2__oct4_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_mobileStationClassmark2__oct5.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileStationClassmark2__oct5_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &MobileStationClassmark2__LV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 7;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(7);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  if (field_mobileStationClassmark2__oct4.ispresent()) {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].pos = 0;
  }
  if (field_mobileStationClassmark2__oct5.ispresent()) {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].pos = 0;
  }
  encoded_length += field_rf__PowerCapability.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_a5__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_esind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_revisionLevel.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare1__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  if (field_mobileStationClassmark2__oct4.ispresent()) {
  encoded_length += field_mobileStationClassmark2__oct4().RAW_encode(MobileStationClassmark2__oct4_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_mobileStationClassmark2__oct5.ispresent()) {
  encoded_length += field_mobileStationClassmark2__oct5().RAW_encode(MobileStationClassmark2__oct5_descr_, *myleaf.body.node.nodes[7]);
  }
  return myleaf.length = encoded_length;
}

struct MobileStationClassmark2__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
BITSTRING_template field_rf__PowerCapability;
BITSTRING_template field_a5__1;
BITSTRING_template field_esind;
BITSTRING_template field_revisionLevel;
BITSTRING_template field_spare1__1;
MobileStationClassmark2__oct4_template field_mobileStationClassmark2__oct4;
MobileStationClassmark2__oct5_template field_mobileStationClassmark2__oct5;
};

void MobileStationClassmark2__LV_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_rf__PowerCapability = ANY_VALUE;
single_value->field_a5__1 = ANY_VALUE;
single_value->field_esind = ANY_VALUE;
single_value->field_revisionLevel = ANY_VALUE;
single_value->field_spare1__1 = ANY_VALUE;
single_value->field_mobileStationClassmark2__oct4 = ANY_OR_OMIT;
single_value->field_mobileStationClassmark2__oct5 = ANY_OR_OMIT;
}
}
}

void MobileStationClassmark2__LV_template::copy_value(const MobileStationClassmark2__LV& 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.rf__PowerCapability().is_bound()) {
  single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
  single_value->field_rf__PowerCapability.clean_up();
}
if (other_value.a5__1().is_bound()) {
  single_value->field_a5__1 = other_value.a5__1();
} else {
  single_value->field_a5__1.clean_up();
}
if (other_value.esind().is_bound()) {
  single_value->field_esind = other_value.esind();
} else {
  single_value->field_esind.clean_up();
}
if (other_value.revisionLevel().is_bound()) {
  single_value->field_revisionLevel = other_value.revisionLevel();
} else {
  single_value->field_revisionLevel.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.mobileStationClassmark2__oct4().is_bound()) {
  if (other_value.mobileStationClassmark2__oct4().ispresent()) single_value->field_mobileStationClassmark2__oct4 = other_value.mobileStationClassmark2__oct4()();
  else single_value->field_mobileStationClassmark2__oct4 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark2__oct4.clean_up();
}
if (other_value.mobileStationClassmark2__oct5().is_bound()) {
  if (other_value.mobileStationClassmark2__oct5().ispresent()) single_value->field_mobileStationClassmark2__oct5 = other_value.mobileStationClassmark2__oct5()();
  else single_value->field_mobileStationClassmark2__oct5 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark2__oct5.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileStationClassmark2__LV_template::copy_template(const MobileStationClassmark2__LV_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.rf__PowerCapability().get_selection()) {
single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
single_value->field_rf__PowerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5__1().get_selection()) {
single_value->field_a5__1 = other_value.a5__1();
} else {
single_value->field_a5__1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.esind().get_selection()) {
single_value->field_esind = other_value.esind();
} else {
single_value->field_esind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.revisionLevel().get_selection()) {
single_value->field_revisionLevel = other_value.revisionLevel();
} else {
single_value->field_revisionLevel.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.mobileStationClassmark2__oct4().get_selection()) {
single_value->field_mobileStationClassmark2__oct4 = other_value.mobileStationClassmark2__oct4();
} else {
single_value->field_mobileStationClassmark2__oct4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark2__oct5().get_selection()) {
single_value->field_mobileStationClassmark2__oct5 = other_value.mobileStationClassmark2__oct5();
} else {
single_value->field_mobileStationClassmark2__oct5.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 MobileStationClassmark2__LV_template[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 MobileStationClassmark2__LV_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileStationClassmark2__LV_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_CommonIE_Types.MobileStationClassmark2_LV.");
break;
}
set_selection(other_value);
}

MobileStationClassmark2__LV_template::MobileStationClassmark2__LV_template()
{
}

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

MobileStationClassmark2__LV_template::MobileStationClassmark2__LV_template(const MobileStationClassmark2__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileStationClassmark2__LV_template::match(const MobileStationClassmark2__LV& 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.rf__PowerCapability().is_bound()) return FALSE;
if(!single_value->field_rf__PowerCapability.match(other_value.rf__PowerCapability(), legacy))return FALSE;
if(!other_value.a5__1().is_bound()) return FALSE;
if(!single_value->field_a5__1.match(other_value.a5__1(), legacy))return FALSE;
if(!other_value.esind().is_bound()) return FALSE;
if(!single_value->field_esind.match(other_value.esind(), legacy))return FALSE;
if(!other_value.revisionLevel().is_bound()) return FALSE;
if(!single_value->field_revisionLevel.match(other_value.revisionLevel(), 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.mobileStationClassmark2__oct4().is_bound()) return FALSE;
if((other_value.mobileStationClassmark2__oct4().ispresent() ? !single_value->field_mobileStationClassmark2__oct4.match((const MobileStationClassmark2__oct4&)other_value.mobileStationClassmark2__oct4(), legacy) : !single_value->field_mobileStationClassmark2__oct4.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark2__oct5().is_bound()) return FALSE;
if((other_value.mobileStationClassmark2__oct5().ispresent() ? !single_value->field_mobileStationClassmark2__oct5.match((const MobileStationClassmark2__oct5&)other_value.mobileStationClassmark2__oct5(), legacy) : !single_value->field_mobileStationClassmark2__oct5.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_CommonIE_Types.MobileStationClassmark2_LV.");
}
return FALSE;
}

boolean MobileStationClassmark2__LV_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_rf__PowerCapability.is_bound()
 || single_value->field_a5__1.is_bound()
 || single_value->field_esind.is_bound()
 || single_value->field_revisionLevel.is_bound()
 || single_value->field_spare1__1.is_bound()
 || (single_value->field_mobileStationClassmark2__oct4.is_omit() || single_value->field_mobileStationClassmark2__oct4.is_bound())
 || (single_value->field_mobileStationClassmark2__oct5.is_omit() || single_value->field_mobileStationClassmark2__oct5.is_bound());
}

boolean MobileStationClassmark2__LV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_rf__PowerCapability.is_value()
 && single_value->field_a5__1.is_value()
 && single_value->field_esind.is_value()
 && single_value->field_revisionLevel.is_value()
 && single_value->field_spare1__1.is_value()
 && (single_value->field_mobileStationClassmark2__oct4.is_omit() || single_value->field_mobileStationClassmark2__oct4.is_value())
 && (single_value->field_mobileStationClassmark2__oct5.is_omit() || single_value->field_mobileStationClassmark2__oct5.is_value());
}

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

MobileStationClassmark2__LV MobileStationClassmark2__LV_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_CommonIE_Types.MobileStationClassmark2_LV.");
MobileStationClassmark2__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_rf__PowerCapability.is_bound()) {
ret_val.rf__PowerCapability() = single_value->field_rf__PowerCapability.valueof();
}
if (single_value->field_a5__1.is_bound()) {
ret_val.a5__1() = single_value->field_a5__1.valueof();
}
if (single_value->field_esind.is_bound()) {
ret_val.esind() = single_value->field_esind.valueof();
}
if (single_value->field_revisionLevel.is_bound()) {
ret_val.revisionLevel() = single_value->field_revisionLevel.valueof();
}
if (single_value->field_spare1__1.is_bound()) {
ret_val.spare1__1() = single_value->field_spare1__1.valueof();
}
if (single_value->field_mobileStationClassmark2__oct4.is_omit()) ret_val.mobileStationClassmark2__oct4() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark2__oct4.is_bound()) {
ret_val.mobileStationClassmark2__oct4() = single_value->field_mobileStationClassmark2__oct4.valueof();
}
if (single_value->field_mobileStationClassmark2__oct5.is_omit()) ret_val.mobileStationClassmark2__oct5() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark2__oct5.is_bound()) {
ret_val.mobileStationClassmark2__oct5() = single_value->field_mobileStationClassmark2__oct5.valueof();
}
return ret_val;
}

void MobileStationClassmark2__LV_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_CommonIE_Types.MobileStationClassmark2_LV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileStationClassmark2__LV_template[list_length];
}

MobileStationClassmark2__LV_template& MobileStationClassmark2__LV_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_CommonIE_Types.MobileStationClassmark2_LV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& MobileStationClassmark2__LV_template::rf__PowerCapability()
{
set_specific();
return single_value->field_rf__PowerCapability;
}

const BITSTRING_template& MobileStationClassmark2__LV_template::rf__PowerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rf_PowerCapability of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
return single_value->field_rf__PowerCapability;
}

BITSTRING_template& MobileStationClassmark2__LV_template::a5__1()
{
set_specific();
return single_value->field_a5__1;
}

const BITSTRING_template& MobileStationClassmark2__LV_template::a5__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_1 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
return single_value->field_a5__1;
}

BITSTRING_template& MobileStationClassmark2__LV_template::esind()
{
set_specific();
return single_value->field_esind;
}

const BITSTRING_template& MobileStationClassmark2__LV_template::esind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field esind of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
return single_value->field_esind;
}

BITSTRING_template& MobileStationClassmark2__LV_template::revisionLevel()
{
set_specific();
return single_value->field_revisionLevel;
}

const BITSTRING_template& MobileStationClassmark2__LV_template::revisionLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field revisionLevel of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
return single_value->field_revisionLevel;
}

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

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

MobileStationClassmark2__oct4_template& MobileStationClassmark2__LV_template::mobileStationClassmark2__oct4()
{
set_specific();
return single_value->field_mobileStationClassmark2__oct4;
}

const MobileStationClassmark2__oct4_template& MobileStationClassmark2__LV_template::mobileStationClassmark2__oct4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2_oct4 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
return single_value->field_mobileStationClassmark2__oct4;
}

MobileStationClassmark2__oct5_template& MobileStationClassmark2__LV_template::mobileStationClassmark2__oct5()
{
set_specific();
return single_value->field_mobileStationClassmark2__oct5;
}

const MobileStationClassmark2__oct5_template& MobileStationClassmark2__LV_template::mobileStationClassmark2__oct5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2_oct5 of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
return single_value->field_mobileStationClassmark2__oct5;
}

int MobileStationClassmark2__LV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_mobileStationClassmark2__oct4.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark2__oct5.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_CommonIE_Types.MobileStationClassmark2_LV 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_CommonIE_Types.MobileStationClassmark2_LV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV.");
  }
  return 0;
}

void MobileStationClassmark2__LV_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(", rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
single_value->field_spare1__1.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2_oct4 := ");
single_value->field_mobileStationClassmark2__oct4.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2_oct5 := ");
single_value->field_mobileStationClassmark2__oct5.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 MobileStationClassmark2__LV_template::log_match(const MobileStationClassmark2__LV& 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_rf__PowerCapability.match(match_value.rf__PowerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".rf_PowerCapability");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a5__1.match(match_value.a5__1(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_1");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_esind.match(match_value.esind(), legacy)){
TTCN_Logger::log_logmatch_info(".esind");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_revisionLevel.match(match_value.revisionLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".revisionLevel");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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 (match_value.mobileStationClassmark2__oct4().ispresent()){
if(!single_value->field_mobileStationClassmark2__oct4.match(match_value.mobileStationClassmark2__oct4(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2_oct4");
single_value->field_mobileStationClassmark2__oct4.log_match(match_value.mobileStationClassmark2__oct4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark2__oct4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark2_oct4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark2__oct4.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark2__oct5().ispresent()){
if(!single_value->field_mobileStationClassmark2__oct5.match(match_value.mobileStationClassmark2__oct5(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2_oct5");
single_value->field_mobileStationClassmark2__oct5.log_match(match_value.mobileStationClassmark2__oct5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark2__oct5.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark2_oct5 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark2__oct5.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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(", mobileStationClassmark2_oct4 := ");
if (match_value.mobileStationClassmark2__oct4().ispresent()) {
single_value->field_mobileStationClassmark2__oct4.log_match(match_value.mobileStationClassmark2__oct4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark2__oct4.log();
if (single_value->field_mobileStationClassmark2__oct4.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark2_oct5 := ");
if (match_value.mobileStationClassmark2__oct5().ispresent()) {
single_value->field_mobileStationClassmark2__oct5.log_match(match_value.mobileStationClassmark2__oct5(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark2__oct5.log();
if (single_value->field_mobileStationClassmark2__oct5.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 MobileStationClassmark2__LV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
if (!mobileStationClassmark2__oct4().is_bound()) mobileStationClassmark2__oct4() = OMIT_VALUE;
else mobileStationClassmark2__oct4().set_implicit_omit();
if (!mobileStationClassmark2__oct5().is_bound()) mobileStationClassmark2__oct5() = OMIT_VALUE;
else mobileStationClassmark2__oct5().set_implicit_omit();
}

void MobileStationClassmark2__LV_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_rf__PowerCapability.encode_text(text_buf);
single_value->field_a5__1.encode_text(text_buf);
single_value->field_esind.encode_text(text_buf);
single_value->field_revisionLevel.encode_text(text_buf);
single_value->field_spare1__1.encode_text(text_buf);
single_value->field_mobileStationClassmark2__oct4.encode_text(text_buf);
single_value->field_mobileStationClassmark2__oct5.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_CommonIE_Types.MobileStationClassmark2_LV.");
}
}

void MobileStationClassmark2__LV_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_rf__PowerCapability.decode_text(text_buf);
single_value->field_a5__1.decode_text(text_buf);
single_value->field_esind.decode_text(text_buf);
single_value->field_revisionLevel.decode_text(text_buf);
single_value->field_spare1__1.decode_text(text_buf);
single_value->field_mobileStationClassmark2__oct4.decode_text(text_buf);
single_value->field_mobileStationClassmark2__oct5.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 MobileStationClassmark2__LV_template[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_CommonIE_Types.MobileStationClassmark2_LV.");
}
}

void MobileStationClassmark2__LV_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: {
    MobileStationClassmark2__LV_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_CommonIE_Types.MobileStationClassmark2_LV has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rf__PowerCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare1__1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2__oct4().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2__oct5().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "mobileStationClassmark2_oct4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2__oct4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_oct5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2__oct5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileStationClassmark2__LV_template* precondition = new MobileStationClassmark2__LV_template;
    precondition->set_param(*param.get_elem(0));
    MobileStationClassmark2__LV_template* implied_template = new MobileStationClassmark2__LV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileStationClassmark2__LV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileStationClassmark2__LV_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_CommonIE_Types.MobileStationClassmark2_LV");
single_value->field_rf__PowerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
single_value->field_a5__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
single_value->field_esind.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
single_value->field_revisionLevel.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
single_value->field_spare1__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
single_value->field_mobileStationClassmark2__oct4.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
single_value->field_mobileStationClassmark2__oct5.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_LV");
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_CommonIE_Types.MobileStationClassmark2_LV");
}

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

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

MobileStationClassmark2__TLV::MobileStationClassmark2__TLV()
{
}

MobileStationClassmark2__TLV::MobileStationClassmark2__TLV(const OCTETSTRING& par_elementIdentifier,
    const MobileStationClassmark2__LV& par_mobileStationClassmark2LV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_mobileStationClassmark2LV(par_mobileStationClassmark2LV)
{
}

MobileStationClassmark2__TLV::MobileStationClassmark2__TLV(const MobileStationClassmark2__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.mobileStationClassmark2LV().is_bound()) field_mobileStationClassmark2LV = other_value.mobileStationClassmark2LV();
else field_mobileStationClassmark2LV.clean_up();
}

void MobileStationClassmark2__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_mobileStationClassmark2LV.clean_up();
}

const TTCN_Typedescriptor_t* MobileStationClassmark2__TLV::get_descriptor() const { return &MobileStationClassmark2__TLV_descr_; }
MobileStationClassmark2__TLV& MobileStationClassmark2__TLV::operator=(const MobileStationClassmark2__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark2_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.mobileStationClassmark2LV().is_bound()) field_mobileStationClassmark2LV = other_value.mobileStationClassmark2LV();
  else field_mobileStationClassmark2LV.clean_up();
}
return *this;
}

boolean MobileStationClassmark2__TLV::operator==(const MobileStationClassmark2__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_mobileStationClassmark2LV==other_value.field_mobileStationClassmark2LV;
}

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

void MobileStationClassmark2__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (mobileStationClassmark2LV().is_bound()) mobileStationClassmark2LV().set_implicit_omit();
}

void MobileStationClassmark2__TLV::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_CommonIE_Types.MobileStationClassmark2_TLV 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) mobileStationClassmark2LV().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(), "mobileStationClassmark2LV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2LV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileStationClassmark2_TLV");
  }
}

void MobileStationClassmark2__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_mobileStationClassmark2LV.encode_text(text_buf);
}

void MobileStationClassmark2__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_mobileStationClassmark2LV.decode_text(text_buf);
}

void MobileStationClassmark2__TLV::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 MobileStationClassmark2__TLV::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 MobileStationClassmark2__TLV::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, MobileStationClassmark2__LV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2LV.RAW_decode(MobileStationClassmark2__LV_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 MobileStationClassmark2__TLV::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, MobileStationClassmark2__LV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mobileStationClassmark2LV.RAW_encode(MobileStationClassmark2__LV_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 MobileStationClassmark2__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
MobileStationClassmark2__LV_template field_mobileStationClassmark2LV;
};

void MobileStationClassmark2__TLV_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_mobileStationClassmark2LV = ANY_VALUE;
}
}
}

void MobileStationClassmark2__TLV_template::copy_value(const MobileStationClassmark2__TLV& 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.mobileStationClassmark2LV().is_bound()) {
  single_value->field_mobileStationClassmark2LV = other_value.mobileStationClassmark2LV();
} else {
  single_value->field_mobileStationClassmark2LV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileStationClassmark2__TLV_template::copy_template(const MobileStationClassmark2__TLV_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.mobileStationClassmark2LV().get_selection()) {
single_value->field_mobileStationClassmark2LV = other_value.mobileStationClassmark2LV();
} else {
single_value->field_mobileStationClassmark2LV.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 MobileStationClassmark2__TLV_template[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 MobileStationClassmark2__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileStationClassmark2__TLV_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_CommonIE_Types.MobileStationClassmark2_TLV.");
break;
}
set_selection(other_value);
}

MobileStationClassmark2__TLV_template::MobileStationClassmark2__TLV_template()
{
}

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

MobileStationClassmark2__TLV_template::MobileStationClassmark2__TLV_template(const MobileStationClassmark2__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileStationClassmark2__TLV_template::match(const MobileStationClassmark2__TLV& 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.mobileStationClassmark2LV().is_bound()) return FALSE;
if(!single_value->field_mobileStationClassmark2LV.match(other_value.mobileStationClassmark2LV(), 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_CommonIE_Types.MobileStationClassmark2_TLV.");
}
return FALSE;
}

boolean MobileStationClassmark2__TLV_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_mobileStationClassmark2LV.is_bound();
}

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

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

MobileStationClassmark2__TLV MobileStationClassmark2__TLV_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_CommonIE_Types.MobileStationClassmark2_TLV.");
MobileStationClassmark2__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_mobileStationClassmark2LV.is_bound()) {
ret_val.mobileStationClassmark2LV() = single_value->field_mobileStationClassmark2LV.valueof();
}
return ret_val;
}

void MobileStationClassmark2__TLV_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_CommonIE_Types.MobileStationClassmark2_TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileStationClassmark2__TLV_template[list_length];
}

MobileStationClassmark2__TLV_template& MobileStationClassmark2__TLV_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_CommonIE_Types.MobileStationClassmark2_TLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_TLV.");
return value_list.list_value[list_index];
}

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

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

MobileStationClassmark2__LV_template& MobileStationClassmark2__TLV_template::mobileStationClassmark2LV()
{
set_specific();
return single_value->field_mobileStationClassmark2LV;
}

const MobileStationClassmark2__LV_template& MobileStationClassmark2__TLV_template::mobileStationClassmark2LV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2LV of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark2_TLV.");
return single_value->field_mobileStationClassmark2LV;
}

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

void MobileStationClassmark2__TLV_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(", mobileStationClassmark2LV := ");
single_value->field_mobileStationClassmark2LV.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 MobileStationClassmark2__TLV_template::log_match(const MobileStationClassmark2__TLV& 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_mobileStationClassmark2LV.match(match_value.mobileStationClassmark2LV(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2LV");
single_value->field_mobileStationClassmark2LV.log_match(match_value.mobileStationClassmark2LV(), 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(", mobileStationClassmark2LV := ");
single_value->field_mobileStationClassmark2LV.log_match(match_value.mobileStationClassmark2LV(), 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 MobileStationClassmark2__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (mobileStationClassmark2LV().is_bound()) mobileStationClassmark2LV().set_implicit_omit();
}

void MobileStationClassmark2__TLV_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_mobileStationClassmark2LV.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_CommonIE_Types.MobileStationClassmark2_TLV.");
}
}

void MobileStationClassmark2__TLV_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_mobileStationClassmark2LV.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 MobileStationClassmark2__TLV_template[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_CommonIE_Types.MobileStationClassmark2_TLV.");
}
}

void MobileStationClassmark2__TLV_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: {
    MobileStationClassmark2__TLV_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_CommonIE_Types.MobileStationClassmark2_TLV 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) mobileStationClassmark2LV().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(), "mobileStationClassmark2LV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2LV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark2_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileStationClassmark2__TLV_template* precondition = new MobileStationClassmark2__TLV_template;
    precondition->set_param(*param.get_elem(0));
    MobileStationClassmark2__TLV_template* implied_template = new MobileStationClassmark2__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileStationClassmark2__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileStationClassmark2_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileStationClassmark2__TLV_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_CommonIE_Types.MobileStationClassmark2_TLV");
single_value->field_mobileStationClassmark2LV.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark2_TLV");
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_CommonIE_Types.MobileStationClassmark2_TLV");
}

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

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

ClassmarkInformationType2__forUMTS::ClassmarkInformationType2__forUMTS()
{
}

ClassmarkInformationType2__forUMTS::ClassmarkInformationType2__forUMTS(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_rf__PowerCapability,
    const BITSTRING& par_a5__1,
    const BITSTRING& par_esind,
    const BITSTRING& par_revisionLevel,
    const BITSTRING& par_spare1__1,
    const BITSTRING& par_fc,
    const BITSTRING& par_vgcs,
    const BITSTRING& par_vbs,
    const BITSTRING& par_sm__Capability,
    const BITSTRING& par_ss__ScreenIndicator,
    const BITSTRING& par_ps__Capability,
    const BITSTRING& par_spare2__1,
    const BITSTRING& par_a5__2,
    const BITSTRING& par_a5__3,
    const BITSTRING& par_cmsp,
    const BITSTRING& par_solsa,
    const BITSTRING& par_ucs2,
    const BITSTRING& par_lcsva__cap,
    const BITSTRING& par_spare5__7,
    const BITSTRING& par_cm3)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_rf__PowerCapability(par_rf__PowerCapability),
  field_a5__1(par_a5__1),
  field_esind(par_esind),
  field_revisionLevel(par_revisionLevel),
  field_spare1__1(par_spare1__1),
  field_fc(par_fc),
  field_vgcs(par_vgcs),
  field_vbs(par_vbs),
  field_sm__Capability(par_sm__Capability),
  field_ss__ScreenIndicator(par_ss__ScreenIndicator),
  field_ps__Capability(par_ps__Capability),
  field_spare2__1(par_spare2__1),
  field_a5__2(par_a5__2),
  field_a5__3(par_a5__3),
  field_cmsp(par_cmsp),
  field_solsa(par_solsa),
  field_ucs2(par_ucs2),
  field_lcsva__cap(par_lcsva__cap),
  field_spare5__7(par_spare5__7),
  field_cm3(par_cm3)
{
}

ClassmarkInformationType2__forUMTS::ClassmarkInformationType2__forUMTS(const ClassmarkInformationType2__forUMTS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
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.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
else field_rf__PowerCapability.clean_up();
if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
else field_a5__1.clean_up();
if (other_value.esind().is_bound()) field_esind = other_value.esind();
else field_esind.clean_up();
if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
else field_revisionLevel.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.fc().is_bound()) field_fc = other_value.fc();
else field_fc.clean_up();
if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs();
else field_vgcs.clean_up();
if (other_value.vbs().is_bound()) field_vbs = other_value.vbs();
else field_vbs.clean_up();
if (other_value.sm__Capability().is_bound()) field_sm__Capability = other_value.sm__Capability();
else field_sm__Capability.clean_up();
if (other_value.ss__ScreenIndicator().is_bound()) field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
else field_ss__ScreenIndicator.clean_up();
if (other_value.ps__Capability().is_bound()) field_ps__Capability = other_value.ps__Capability();
else field_ps__Capability.clean_up();
if (other_value.spare2__1().is_bound()) field_spare2__1 = other_value.spare2__1();
else field_spare2__1.clean_up();
if (other_value.a5__2().is_bound()) field_a5__2 = other_value.a5__2();
else field_a5__2.clean_up();
if (other_value.a5__3().is_bound()) field_a5__3 = other_value.a5__3();
else field_a5__3.clean_up();
if (other_value.cmsp().is_bound()) field_cmsp = other_value.cmsp();
else field_cmsp.clean_up();
if (other_value.solsa().is_bound()) field_solsa = other_value.solsa();
else field_solsa.clean_up();
if (other_value.ucs2().is_bound()) field_ucs2 = other_value.ucs2();
else field_ucs2.clean_up();
if (other_value.lcsva__cap().is_bound()) field_lcsva__cap = other_value.lcsva__cap();
else field_lcsva__cap.clean_up();
if (other_value.spare5__7().is_bound()) field_spare5__7 = other_value.spare5__7();
else field_spare5__7.clean_up();
if (other_value.cm3().is_bound()) field_cm3 = other_value.cm3();
else field_cm3.clean_up();
}

void ClassmarkInformationType2__forUMTS::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_rf__PowerCapability.clean_up();
field_a5__1.clean_up();
field_esind.clean_up();
field_revisionLevel.clean_up();
field_spare1__1.clean_up();
field_fc.clean_up();
field_vgcs.clean_up();
field_vbs.clean_up();
field_sm__Capability.clean_up();
field_ss__ScreenIndicator.clean_up();
field_ps__Capability.clean_up();
field_spare2__1.clean_up();
field_a5__2.clean_up();
field_a5__3.clean_up();
field_cmsp.clean_up();
field_solsa.clean_up();
field_ucs2.clean_up();
field_lcsva__cap.clean_up();
field_spare5__7.clean_up();
field_cm3.clean_up();
}

const TTCN_Typedescriptor_t* ClassmarkInformationType2__forUMTS::get_descriptor() const { return &ClassmarkInformationType2__forUMTS_descr_; }
ClassmarkInformationType2__forUMTS& ClassmarkInformationType2__forUMTS::operator=(const ClassmarkInformationType2__forUMTS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
  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.rf__PowerCapability().is_bound()) field_rf__PowerCapability = other_value.rf__PowerCapability();
  else field_rf__PowerCapability.clean_up();
  if (other_value.a5__1().is_bound()) field_a5__1 = other_value.a5__1();
  else field_a5__1.clean_up();
  if (other_value.esind().is_bound()) field_esind = other_value.esind();
  else field_esind.clean_up();
  if (other_value.revisionLevel().is_bound()) field_revisionLevel = other_value.revisionLevel();
  else field_revisionLevel.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.fc().is_bound()) field_fc = other_value.fc();
  else field_fc.clean_up();
  if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs();
  else field_vgcs.clean_up();
  if (other_value.vbs().is_bound()) field_vbs = other_value.vbs();
  else field_vbs.clean_up();
  if (other_value.sm__Capability().is_bound()) field_sm__Capability = other_value.sm__Capability();
  else field_sm__Capability.clean_up();
  if (other_value.ss__ScreenIndicator().is_bound()) field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
  else field_ss__ScreenIndicator.clean_up();
  if (other_value.ps__Capability().is_bound()) field_ps__Capability = other_value.ps__Capability();
  else field_ps__Capability.clean_up();
  if (other_value.spare2__1().is_bound()) field_spare2__1 = other_value.spare2__1();
  else field_spare2__1.clean_up();
  if (other_value.a5__2().is_bound()) field_a5__2 = other_value.a5__2();
  else field_a5__2.clean_up();
  if (other_value.a5__3().is_bound()) field_a5__3 = other_value.a5__3();
  else field_a5__3.clean_up();
  if (other_value.cmsp().is_bound()) field_cmsp = other_value.cmsp();
  else field_cmsp.clean_up();
  if (other_value.solsa().is_bound()) field_solsa = other_value.solsa();
  else field_solsa.clean_up();
  if (other_value.ucs2().is_bound()) field_ucs2 = other_value.ucs2();
  else field_ucs2.clean_up();
  if (other_value.lcsva__cap().is_bound()) field_lcsva__cap = other_value.lcsva__cap();
  else field_lcsva__cap.clean_up();
  if (other_value.spare5__7().is_bound()) field_spare5__7 = other_value.spare5__7();
  else field_spare5__7.clean_up();
  if (other_value.cm3().is_bound()) field_cm3 = other_value.cm3();
  else field_cm3.clean_up();
}
return *this;
}

boolean ClassmarkInformationType2__forUMTS::operator==(const ClassmarkInformationType2__forUMTS& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_rf__PowerCapability==other_value.field_rf__PowerCapability
  && field_a5__1==other_value.field_a5__1
  && field_esind==other_value.field_esind
  && field_revisionLevel==other_value.field_revisionLevel
  && field_spare1__1==other_value.field_spare1__1
  && field_fc==other_value.field_fc
  && field_vgcs==other_value.field_vgcs
  && field_vbs==other_value.field_vbs
  && field_sm__Capability==other_value.field_sm__Capability
  && field_ss__ScreenIndicator==other_value.field_ss__ScreenIndicator
  && field_ps__Capability==other_value.field_ps__Capability
  && field_spare2__1==other_value.field_spare2__1
  && field_a5__2==other_value.field_a5__2
  && field_a5__3==other_value.field_a5__3
  && field_cmsp==other_value.field_cmsp
  && field_solsa==other_value.field_solsa
  && field_ucs2==other_value.field_ucs2
  && field_lcsva__cap==other_value.field_lcsva__cap
  && field_spare5__7==other_value.field_spare5__7
  && field_cm3==other_value.field_cm3;
}

boolean ClassmarkInformationType2__forUMTS::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_rf__PowerCapability.is_bound())
  || (field_a5__1.is_bound())
  || (field_esind.is_bound())
  || (field_revisionLevel.is_bound())
  || (field_spare1__1.is_bound())
  || (field_fc.is_bound())
  || (field_vgcs.is_bound())
  || (field_vbs.is_bound())
  || (field_sm__Capability.is_bound())
  || (field_ss__ScreenIndicator.is_bound())
  || (field_ps__Capability.is_bound())
  || (field_spare2__1.is_bound())
  || (field_a5__2.is_bound())
  || (field_a5__3.is_bound())
  || (field_cmsp.is_bound())
  || (field_solsa.is_bound())
  || (field_ucs2.is_bound())
  || (field_lcsva__cap.is_bound())
  || (field_spare5__7.is_bound())
  || (field_cm3.is_bound());
}
boolean ClassmarkInformationType2__forUMTS::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_rf__PowerCapability.is_value()
  && field_a5__1.is_value()
  && field_esind.is_value()
  && field_revisionLevel.is_value()
  && field_spare1__1.is_value()
  && field_fc.is_value()
  && field_vgcs.is_value()
  && field_vbs.is_value()
  && field_sm__Capability.is_value()
  && field_ss__ScreenIndicator.is_value()
  && field_ps__Capability.is_value()
  && field_spare2__1.is_value()
  && field_a5__2.is_value()
  && field_a5__3.is_value()
  && field_cmsp.is_value()
  && field_solsa.is_value()
  && field_ucs2.is_value()
  && field_lcsva__cap.is_value()
  && field_spare5__7.is_value()
  && field_cm3.is_value();
}
void ClassmarkInformationType2__forUMTS::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(", rf_PowerCapability := ");
field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
field_spare1__1.log();
TTCN_Logger::log_event_str(", fc := ");
field_fc.log();
TTCN_Logger::log_event_str(", vgcs := ");
field_vgcs.log();
TTCN_Logger::log_event_str(", vbs := ");
field_vbs.log();
TTCN_Logger::log_event_str(", sm_Capability := ");
field_sm__Capability.log();
TTCN_Logger::log_event_str(", ss_ScreenIndicator := ");
field_ss__ScreenIndicator.log();
TTCN_Logger::log_event_str(", ps_Capability := ");
field_ps__Capability.log();
TTCN_Logger::log_event_str(", spare2_1 := ");
field_spare2__1.log();
TTCN_Logger::log_event_str(", a5_2 := ");
field_a5__2.log();
TTCN_Logger::log_event_str(", a5_3 := ");
field_a5__3.log();
TTCN_Logger::log_event_str(", cmsp := ");
field_cmsp.log();
TTCN_Logger::log_event_str(", solsa := ");
field_solsa.log();
TTCN_Logger::log_event_str(", ucs2 := ");
field_ucs2.log();
TTCN_Logger::log_event_str(", lcsva_cap := ");
field_lcsva__cap.log();
TTCN_Logger::log_event_str(", spare5_7 := ");
field_spare5__7.log();
TTCN_Logger::log_event_str(", cm3 := ");
field_cm3.log();
TTCN_Logger::log_event_str(" }");
}

void ClassmarkInformationType2__forUMTS::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
if (fc().is_bound()) fc().set_implicit_omit();
if (vgcs().is_bound()) vgcs().set_implicit_omit();
if (vbs().is_bound()) vbs().set_implicit_omit();
if (sm__Capability().is_bound()) sm__Capability().set_implicit_omit();
if (ss__ScreenIndicator().is_bound()) ss__ScreenIndicator().set_implicit_omit();
if (ps__Capability().is_bound()) ps__Capability().set_implicit_omit();
if (spare2__1().is_bound()) spare2__1().set_implicit_omit();
if (a5__2().is_bound()) a5__2().set_implicit_omit();
if (a5__3().is_bound()) a5__3().set_implicit_omit();
if (cmsp().is_bound()) cmsp().set_implicit_omit();
if (solsa().is_bound()) solsa().set_implicit_omit();
if (ucs2().is_bound()) ucs2().set_implicit_omit();
if (lcsva__cap().is_bound()) lcsva__cap().set_implicit_omit();
if (spare5__7().is_bound()) spare5__7().set_implicit_omit();
if (cm3().is_bound()) cm3().set_implicit_omit();
}

void ClassmarkInformationType2__forUMTS::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 (22<param.get_size()) {
      param.error("record value of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS has 22 fields but 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) rf__PowerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare1__1().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) fc().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) sm__Capability().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) ss__ScreenIndicator().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) ps__Capability().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) spare2__1().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) a5__2().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) a5__3().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) cmsp().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) solsa().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) ucs2().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) lcsva__cap().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) spare5__7().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) cm3().set_param(*param.get_elem(21));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "fc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vgcs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vgcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vbs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vbs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sm_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sm__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_ScreenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__ScreenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2__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(), "a5_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cmsp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cmsp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "solsa")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          solsa().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ucs2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ucs2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lcsva_cap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lcsva__cap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare5_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare5__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cm3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cm3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
  }
}

void ClassmarkInformationType2__forUMTS::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_rf__PowerCapability.encode_text(text_buf);
field_a5__1.encode_text(text_buf);
field_esind.encode_text(text_buf);
field_revisionLevel.encode_text(text_buf);
field_spare1__1.encode_text(text_buf);
field_fc.encode_text(text_buf);
field_vgcs.encode_text(text_buf);
field_vbs.encode_text(text_buf);
field_sm__Capability.encode_text(text_buf);
field_ss__ScreenIndicator.encode_text(text_buf);
field_ps__Capability.encode_text(text_buf);
field_spare2__1.encode_text(text_buf);
field_a5__2.encode_text(text_buf);
field_a5__3.encode_text(text_buf);
field_cmsp.encode_text(text_buf);
field_solsa.encode_text(text_buf);
field_ucs2.encode_text(text_buf);
field_lcsva__cap.encode_text(text_buf);
field_spare5__7.encode_text(text_buf);
field_cm3.encode_text(text_buf);
}

void ClassmarkInformationType2__forUMTS::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_rf__PowerCapability.decode_text(text_buf);
field_a5__1.decode_text(text_buf);
field_esind.decode_text(text_buf);
field_revisionLevel.decode_text(text_buf);
field_spare1__1.decode_text(text_buf);
field_fc.decode_text(text_buf);
field_vgcs.decode_text(text_buf);
field_vbs.decode_text(text_buf);
field_sm__Capability.decode_text(text_buf);
field_ss__ScreenIndicator.decode_text(text_buf);
field_ps__Capability.decode_text(text_buf);
field_spare2__1.decode_text(text_buf);
field_a5__2.decode_text(text_buf);
field_a5__3.decode_text(text_buf);
field_cmsp.decode_text(text_buf);
field_solsa.decode_text(text_buf);
field_ucs2.decode_text(text_buf);
field_lcsva__cap.decode_text(text_buf);
field_spare5__7.decode_text(text_buf);
field_cm3.decode_text(text_buf);
}

void ClassmarkInformationType2__forUMTS::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 ClassmarkInformationType2__forUMTS::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 ClassmarkInformationType2__forUMTS::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, ClassmarkInformationType2__forUMTS_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(ClassmarkInformationType2__forUMTS_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(ClassmarkInformationType2__forUMTS_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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_rf__PowerCapability.RAW_decode(General__Types::BIT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_a5__1.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_esind.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_revisionLevel.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare1__1.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_fc.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_vgcs.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_9_force_omit(9, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_vbs.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_10_force_omit(10, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_sm__Capability.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_11_force_omit(11, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_ss__ScreenIndicator.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_12_force_omit(12, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_ps__Capability.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_13_force_omit(13, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare2__1.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_14_force_omit(14, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_a5__2.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_15_force_omit(15, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_a5__3.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_16_force_omit(16, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cmsp.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_17_force_omit(17, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_solsa.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_18_force_omit(18, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_ucs2.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_19_force_omit(19, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_lcsva__cap.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_20_force_omit(20, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare5__7.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_21_force_omit(21, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cm3.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 0) return 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 ClassmarkInformationType2__forUMTS::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 = 22;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(22);
  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, ClassmarkInformationType2__forUMTS_lengthIndicator_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, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, General__Types::BIT1_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 = &ClassmarkInformationType2__forUMTS_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 20;
  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(20);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].level = myleaf.body.node.nodes[9]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].pos = myleaf.body.node.nodes[9]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].level = myleaf.body.node.nodes[10]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].pos = myleaf.body.node.nodes[10]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[9].level = myleaf.body.node.nodes[11]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[9].pos = myleaf.body.node.nodes[11]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[10].level = myleaf.body.node.nodes[12]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[10].pos = myleaf.body.node.nodes[12]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[11].level = myleaf.body.node.nodes[13]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[11].pos = myleaf.body.node.nodes[13]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[12].level = myleaf.body.node.nodes[14]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[12].pos = myleaf.body.node.nodes[14]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[13].level = myleaf.body.node.nodes[15]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[13].pos = myleaf.body.node.nodes[15]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[14].level = myleaf.body.node.nodes[16]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[14].pos = myleaf.body.node.nodes[16]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[15].level = myleaf.body.node.nodes[17]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[15].pos = myleaf.body.node.nodes[17]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[16].level = myleaf.body.node.nodes[18]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[16].pos = myleaf.body.node.nodes[18]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[17].level = myleaf.body.node.nodes[19]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[17].pos = myleaf.body.node.nodes[19]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[18].level = myleaf.body.node.nodes[20]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[18].pos = myleaf.body.node.nodes[20]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[19].level = myleaf.body.node.nodes[21]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[19].pos = myleaf.body.node.nodes[21]->curr_pos.pos;
  encoded_length += field_rf__PowerCapability.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_a5__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_esind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_revisionLevel.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare1__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_fc.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_vgcs.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_vbs.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_sm__Capability.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[10]);
  encoded_length += field_ss__ScreenIndicator.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[11]);
  encoded_length += field_ps__Capability.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[12]);
  encoded_length += field_spare2__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[13]);
  encoded_length += field_a5__2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[14]);
  encoded_length += field_a5__3.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[15]);
  encoded_length += field_cmsp.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[16]);
  encoded_length += field_solsa.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[17]);
  encoded_length += field_ucs2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[18]);
  encoded_length += field_lcsva__cap.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[19]);
  encoded_length += field_spare5__7.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[20]);
  encoded_length += field_cm3.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[21]);
  return myleaf.length = encoded_length;
}

struct ClassmarkInformationType2__forUMTS_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_rf__PowerCapability;
BITSTRING_template field_a5__1;
BITSTRING_template field_esind;
BITSTRING_template field_revisionLevel;
BITSTRING_template field_spare1__1;
BITSTRING_template field_fc;
BITSTRING_template field_vgcs;
BITSTRING_template field_vbs;
BITSTRING_template field_sm__Capability;
BITSTRING_template field_ss__ScreenIndicator;
BITSTRING_template field_ps__Capability;
BITSTRING_template field_spare2__1;
BITSTRING_template field_a5__2;
BITSTRING_template field_a5__3;
BITSTRING_template field_cmsp;
BITSTRING_template field_solsa;
BITSTRING_template field_ucs2;
BITSTRING_template field_lcsva__cap;
BITSTRING_template field_spare5__7;
BITSTRING_template field_cm3;
};

void ClassmarkInformationType2__forUMTS_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_rf__PowerCapability = ANY_VALUE;
single_value->field_a5__1 = ANY_VALUE;
single_value->field_esind = ANY_VALUE;
single_value->field_revisionLevel = ANY_VALUE;
single_value->field_spare1__1 = ANY_VALUE;
single_value->field_fc = ANY_VALUE;
single_value->field_vgcs = ANY_VALUE;
single_value->field_vbs = ANY_VALUE;
single_value->field_sm__Capability = ANY_VALUE;
single_value->field_ss__ScreenIndicator = ANY_VALUE;
single_value->field_ps__Capability = ANY_VALUE;
single_value->field_spare2__1 = ANY_VALUE;
single_value->field_a5__2 = ANY_VALUE;
single_value->field_a5__3 = ANY_VALUE;
single_value->field_cmsp = ANY_VALUE;
single_value->field_solsa = ANY_VALUE;
single_value->field_ucs2 = ANY_VALUE;
single_value->field_lcsva__cap = ANY_VALUE;
single_value->field_spare5__7 = ANY_VALUE;
single_value->field_cm3 = ANY_VALUE;
}
}
}

void ClassmarkInformationType2__forUMTS_template::copy_value(const ClassmarkInformationType2__forUMTS& 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.rf__PowerCapability().is_bound()) {
  single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
  single_value->field_rf__PowerCapability.clean_up();
}
if (other_value.a5__1().is_bound()) {
  single_value->field_a5__1 = other_value.a5__1();
} else {
  single_value->field_a5__1.clean_up();
}
if (other_value.esind().is_bound()) {
  single_value->field_esind = other_value.esind();
} else {
  single_value->field_esind.clean_up();
}
if (other_value.revisionLevel().is_bound()) {
  single_value->field_revisionLevel = other_value.revisionLevel();
} else {
  single_value->field_revisionLevel.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.fc().is_bound()) {
  single_value->field_fc = other_value.fc();
} else {
  single_value->field_fc.clean_up();
}
if (other_value.vgcs().is_bound()) {
  single_value->field_vgcs = other_value.vgcs();
} else {
  single_value->field_vgcs.clean_up();
}
if (other_value.vbs().is_bound()) {
  single_value->field_vbs = other_value.vbs();
} else {
  single_value->field_vbs.clean_up();
}
if (other_value.sm__Capability().is_bound()) {
  single_value->field_sm__Capability = other_value.sm__Capability();
} else {
  single_value->field_sm__Capability.clean_up();
}
if (other_value.ss__ScreenIndicator().is_bound()) {
  single_value->field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
} else {
  single_value->field_ss__ScreenIndicator.clean_up();
}
if (other_value.ps__Capability().is_bound()) {
  single_value->field_ps__Capability = other_value.ps__Capability();
} else {
  single_value->field_ps__Capability.clean_up();
}
if (other_value.spare2__1().is_bound()) {
  single_value->field_spare2__1 = other_value.spare2__1();
} else {
  single_value->field_spare2__1.clean_up();
}
if (other_value.a5__2().is_bound()) {
  single_value->field_a5__2 = other_value.a5__2();
} else {
  single_value->field_a5__2.clean_up();
}
if (other_value.a5__3().is_bound()) {
  single_value->field_a5__3 = other_value.a5__3();
} else {
  single_value->field_a5__3.clean_up();
}
if (other_value.cmsp().is_bound()) {
  single_value->field_cmsp = other_value.cmsp();
} else {
  single_value->field_cmsp.clean_up();
}
if (other_value.solsa().is_bound()) {
  single_value->field_solsa = other_value.solsa();
} else {
  single_value->field_solsa.clean_up();
}
if (other_value.ucs2().is_bound()) {
  single_value->field_ucs2 = other_value.ucs2();
} else {
  single_value->field_ucs2.clean_up();
}
if (other_value.lcsva__cap().is_bound()) {
  single_value->field_lcsva__cap = other_value.lcsva__cap();
} else {
  single_value->field_lcsva__cap.clean_up();
}
if (other_value.spare5__7().is_bound()) {
  single_value->field_spare5__7 = other_value.spare5__7();
} else {
  single_value->field_spare5__7.clean_up();
}
if (other_value.cm3().is_bound()) {
  single_value->field_cm3 = other_value.cm3();
} else {
  single_value->field_cm3.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ClassmarkInformationType2__forUMTS_template::copy_template(const ClassmarkInformationType2__forUMTS_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.rf__PowerCapability().get_selection()) {
single_value->field_rf__PowerCapability = other_value.rf__PowerCapability();
} else {
single_value->field_rf__PowerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5__1().get_selection()) {
single_value->field_a5__1 = other_value.a5__1();
} else {
single_value->field_a5__1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.esind().get_selection()) {
single_value->field_esind = other_value.esind();
} else {
single_value->field_esind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.revisionLevel().get_selection()) {
single_value->field_revisionLevel = other_value.revisionLevel();
} else {
single_value->field_revisionLevel.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.fc().get_selection()) {
single_value->field_fc = other_value.fc();
} else {
single_value->field_fc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vgcs().get_selection()) {
single_value->field_vgcs = other_value.vgcs();
} else {
single_value->field_vgcs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vbs().get_selection()) {
single_value->field_vbs = other_value.vbs();
} else {
single_value->field_vbs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sm__Capability().get_selection()) {
single_value->field_sm__Capability = other_value.sm__Capability();
} else {
single_value->field_sm__Capability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__ScreenIndicator().get_selection()) {
single_value->field_ss__ScreenIndicator = other_value.ss__ScreenIndicator();
} else {
single_value->field_ss__ScreenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ps__Capability().get_selection()) {
single_value->field_ps__Capability = other_value.ps__Capability();
} else {
single_value->field_ps__Capability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2__1().get_selection()) {
single_value->field_spare2__1 = other_value.spare2__1();
} else {
single_value->field_spare2__1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5__2().get_selection()) {
single_value->field_a5__2 = other_value.a5__2();
} else {
single_value->field_a5__2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5__3().get_selection()) {
single_value->field_a5__3 = other_value.a5__3();
} else {
single_value->field_a5__3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cmsp().get_selection()) {
single_value->field_cmsp = other_value.cmsp();
} else {
single_value->field_cmsp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.solsa().get_selection()) {
single_value->field_solsa = other_value.solsa();
} else {
single_value->field_solsa.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ucs2().get_selection()) {
single_value->field_ucs2 = other_value.ucs2();
} else {
single_value->field_ucs2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lcsva__cap().get_selection()) {
single_value->field_lcsva__cap = other_value.lcsva__cap();
} else {
single_value->field_lcsva__cap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare5__7().get_selection()) {
single_value->field_spare5__7 = other_value.spare5__7();
} else {
single_value->field_spare5__7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cm3().get_selection()) {
single_value->field_cm3 = other_value.cm3();
} else {
single_value->field_cm3.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 ClassmarkInformationType2__forUMTS_template[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 ClassmarkInformationType2__forUMTS_template(*other_value.implication_.precondition);
implication_.implied_template = new ClassmarkInformationType2__forUMTS_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_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
break;
}
set_selection(other_value);
}

ClassmarkInformationType2__forUMTS_template::ClassmarkInformationType2__forUMTS_template()
{
}

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

ClassmarkInformationType2__forUMTS_template::ClassmarkInformationType2__forUMTS_template(const ClassmarkInformationType2__forUMTS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ClassmarkInformationType2__forUMTS_template::match(const ClassmarkInformationType2__forUMTS& 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.rf__PowerCapability().is_bound()) return FALSE;
if(!single_value->field_rf__PowerCapability.match(other_value.rf__PowerCapability(), legacy))return FALSE;
if(!other_value.a5__1().is_bound()) return FALSE;
if(!single_value->field_a5__1.match(other_value.a5__1(), legacy))return FALSE;
if(!other_value.esind().is_bound()) return FALSE;
if(!single_value->field_esind.match(other_value.esind(), legacy))return FALSE;
if(!other_value.revisionLevel().is_bound()) return FALSE;
if(!single_value->field_revisionLevel.match(other_value.revisionLevel(), 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.fc().is_bound()) return FALSE;
if(!single_value->field_fc.match(other_value.fc(), legacy))return FALSE;
if(!other_value.vgcs().is_bound()) return FALSE;
if(!single_value->field_vgcs.match(other_value.vgcs(), legacy))return FALSE;
if(!other_value.vbs().is_bound()) return FALSE;
if(!single_value->field_vbs.match(other_value.vbs(), legacy))return FALSE;
if(!other_value.sm__Capability().is_bound()) return FALSE;
if(!single_value->field_sm__Capability.match(other_value.sm__Capability(), legacy))return FALSE;
if(!other_value.ss__ScreenIndicator().is_bound()) return FALSE;
if(!single_value->field_ss__ScreenIndicator.match(other_value.ss__ScreenIndicator(), legacy))return FALSE;
if(!other_value.ps__Capability().is_bound()) return FALSE;
if(!single_value->field_ps__Capability.match(other_value.ps__Capability(), legacy))return FALSE;
if(!other_value.spare2__1().is_bound()) return FALSE;
if(!single_value->field_spare2__1.match(other_value.spare2__1(), legacy))return FALSE;
if(!other_value.a5__2().is_bound()) return FALSE;
if(!single_value->field_a5__2.match(other_value.a5__2(), legacy))return FALSE;
if(!other_value.a5__3().is_bound()) return FALSE;
if(!single_value->field_a5__3.match(other_value.a5__3(), legacy))return FALSE;
if(!other_value.cmsp().is_bound()) return FALSE;
if(!single_value->field_cmsp.match(other_value.cmsp(), legacy))return FALSE;
if(!other_value.solsa().is_bound()) return FALSE;
if(!single_value->field_solsa.match(other_value.solsa(), legacy))return FALSE;
if(!other_value.ucs2().is_bound()) return FALSE;
if(!single_value->field_ucs2.match(other_value.ucs2(), legacy))return FALSE;
if(!other_value.lcsva__cap().is_bound()) return FALSE;
if(!single_value->field_lcsva__cap.match(other_value.lcsva__cap(), legacy))return FALSE;
if(!other_value.spare5__7().is_bound()) return FALSE;
if(!single_value->field_spare5__7.match(other_value.spare5__7(), legacy))return FALSE;
if(!other_value.cm3().is_bound()) return FALSE;
if(!single_value->field_cm3.match(other_value.cm3(), 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_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
}
return FALSE;
}

boolean ClassmarkInformationType2__forUMTS_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_rf__PowerCapability.is_bound()
 || single_value->field_a5__1.is_bound()
 || single_value->field_esind.is_bound()
 || single_value->field_revisionLevel.is_bound()
 || single_value->field_spare1__1.is_bound()
 || single_value->field_fc.is_bound()
 || single_value->field_vgcs.is_bound()
 || single_value->field_vbs.is_bound()
 || single_value->field_sm__Capability.is_bound()
 || single_value->field_ss__ScreenIndicator.is_bound()
 || single_value->field_ps__Capability.is_bound()
 || single_value->field_spare2__1.is_bound()
 || single_value->field_a5__2.is_bound()
 || single_value->field_a5__3.is_bound()
 || single_value->field_cmsp.is_bound()
 || single_value->field_solsa.is_bound()
 || single_value->field_ucs2.is_bound()
 || single_value->field_lcsva__cap.is_bound()
 || single_value->field_spare5__7.is_bound()
 || single_value->field_cm3.is_bound();
}

boolean ClassmarkInformationType2__forUMTS_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_rf__PowerCapability.is_value()
 && single_value->field_a5__1.is_value()
 && single_value->field_esind.is_value()
 && single_value->field_revisionLevel.is_value()
 && single_value->field_spare1__1.is_value()
 && single_value->field_fc.is_value()
 && single_value->field_vgcs.is_value()
 && single_value->field_vbs.is_value()
 && single_value->field_sm__Capability.is_value()
 && single_value->field_ss__ScreenIndicator.is_value()
 && single_value->field_ps__Capability.is_value()
 && single_value->field_spare2__1.is_value()
 && single_value->field_a5__2.is_value()
 && single_value->field_a5__3.is_value()
 && single_value->field_cmsp.is_value()
 && single_value->field_solsa.is_value()
 && single_value->field_ucs2.is_value()
 && single_value->field_lcsva__cap.is_value()
 && single_value->field_spare5__7.is_value()
 && single_value->field_cm3.is_value();
}

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

ClassmarkInformationType2__forUMTS ClassmarkInformationType2__forUMTS_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_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
ClassmarkInformationType2__forUMTS 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_rf__PowerCapability.is_bound()) {
ret_val.rf__PowerCapability() = single_value->field_rf__PowerCapability.valueof();
}
if (single_value->field_a5__1.is_bound()) {
ret_val.a5__1() = single_value->field_a5__1.valueof();
}
if (single_value->field_esind.is_bound()) {
ret_val.esind() = single_value->field_esind.valueof();
}
if (single_value->field_revisionLevel.is_bound()) {
ret_val.revisionLevel() = single_value->field_revisionLevel.valueof();
}
if (single_value->field_spare1__1.is_bound()) {
ret_val.spare1__1() = single_value->field_spare1__1.valueof();
}
if (single_value->field_fc.is_bound()) {
ret_val.fc() = single_value->field_fc.valueof();
}
if (single_value->field_vgcs.is_bound()) {
ret_val.vgcs() = single_value->field_vgcs.valueof();
}
if (single_value->field_vbs.is_bound()) {
ret_val.vbs() = single_value->field_vbs.valueof();
}
if (single_value->field_sm__Capability.is_bound()) {
ret_val.sm__Capability() = single_value->field_sm__Capability.valueof();
}
if (single_value->field_ss__ScreenIndicator.is_bound()) {
ret_val.ss__ScreenIndicator() = single_value->field_ss__ScreenIndicator.valueof();
}
if (single_value->field_ps__Capability.is_bound()) {
ret_val.ps__Capability() = single_value->field_ps__Capability.valueof();
}
if (single_value->field_spare2__1.is_bound()) {
ret_val.spare2__1() = single_value->field_spare2__1.valueof();
}
if (single_value->field_a5__2.is_bound()) {
ret_val.a5__2() = single_value->field_a5__2.valueof();
}
if (single_value->field_a5__3.is_bound()) {
ret_val.a5__3() = single_value->field_a5__3.valueof();
}
if (single_value->field_cmsp.is_bound()) {
ret_val.cmsp() = single_value->field_cmsp.valueof();
}
if (single_value->field_solsa.is_bound()) {
ret_val.solsa() = single_value->field_solsa.valueof();
}
if (single_value->field_ucs2.is_bound()) {
ret_val.ucs2() = single_value->field_ucs2.valueof();
}
if (single_value->field_lcsva__cap.is_bound()) {
ret_val.lcsva__cap() = single_value->field_lcsva__cap.valueof();
}
if (single_value->field_spare5__7.is_bound()) {
ret_val.spare5__7() = single_value->field_spare5__7.valueof();
}
if (single_value->field_cm3.is_bound()) {
ret_val.cm3() = single_value->field_cm3.valueof();
}
return ret_val;
}

void ClassmarkInformationType2__forUMTS_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_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ClassmarkInformationType2__forUMTS_template[list_length];
}

ClassmarkInformationType2__forUMTS_template& ClassmarkInformationType2__forUMTS_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_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return value_list.list_value[list_index];
}

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

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

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

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

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::rf__PowerCapability()
{
set_specific();
return single_value->field_rf__PowerCapability;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::rf__PowerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rf_PowerCapability of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_rf__PowerCapability;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::a5__1()
{
set_specific();
return single_value->field_a5__1;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::a5__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_1 of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_a5__1;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::esind()
{
set_specific();
return single_value->field_esind;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::esind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field esind of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_esind;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::revisionLevel()
{
set_specific();
return single_value->field_revisionLevel;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::revisionLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field revisionLevel of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_revisionLevel;
}

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

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

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::fc()
{
set_specific();
return single_value->field_fc;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::fc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fc of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_fc;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::vgcs()
{
set_specific();
return single_value->field_vgcs;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::vgcs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vgcs of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_vgcs;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::vbs()
{
set_specific();
return single_value->field_vbs;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::vbs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vbs of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_vbs;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::sm__Capability()
{
set_specific();
return single_value->field_sm__Capability;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::sm__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sm_Capability of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_sm__Capability;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::ss__ScreenIndicator()
{
set_specific();
return single_value->field_ss__ScreenIndicator;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::ss__ScreenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_ScreenIndicator of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_ss__ScreenIndicator;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::ps__Capability()
{
set_specific();
return single_value->field_ps__Capability;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::ps__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ps_Capability of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_ps__Capability;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::spare2__1()
{
set_specific();
return single_value->field_spare2__1;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::spare2__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare2_1 of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_spare2__1;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::a5__2()
{
set_specific();
return single_value->field_a5__2;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::a5__2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_2 of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_a5__2;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::a5__3()
{
set_specific();
return single_value->field_a5__3;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::a5__3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5_3 of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_a5__3;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::cmsp()
{
set_specific();
return single_value->field_cmsp;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::cmsp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cmsp of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_cmsp;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::solsa()
{
set_specific();
return single_value->field_solsa;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::solsa() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field solsa of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_solsa;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::ucs2()
{
set_specific();
return single_value->field_ucs2;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::ucs2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ucs2 of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_ucs2;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::lcsva__cap()
{
set_specific();
return single_value->field_lcsva__cap;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::lcsva__cap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lcsva_cap of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_lcsva__cap;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::spare5__7()
{
set_specific();
return single_value->field_spare5__7;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::spare5__7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare5_7 of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_spare5__7;
}

BITSTRING_template& ClassmarkInformationType2__forUMTS_template::cm3()
{
set_specific();
return single_value->field_cm3;
}

const BITSTRING_template& ClassmarkInformationType2__forUMTS_template::cm3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cm3 of a non-specific template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
return single_value->field_cm3;
}

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

void ClassmarkInformationType2__forUMTS_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(", rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log();
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log();
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log();
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log();
TTCN_Logger::log_event_str(", spare1_1 := ");
single_value->field_spare1__1.log();
TTCN_Logger::log_event_str(", fc := ");
single_value->field_fc.log();
TTCN_Logger::log_event_str(", vgcs := ");
single_value->field_vgcs.log();
TTCN_Logger::log_event_str(", vbs := ");
single_value->field_vbs.log();
TTCN_Logger::log_event_str(", sm_Capability := ");
single_value->field_sm__Capability.log();
TTCN_Logger::log_event_str(", ss_ScreenIndicator := ");
single_value->field_ss__ScreenIndicator.log();
TTCN_Logger::log_event_str(", ps_Capability := ");
single_value->field_ps__Capability.log();
TTCN_Logger::log_event_str(", spare2_1 := ");
single_value->field_spare2__1.log();
TTCN_Logger::log_event_str(", a5_2 := ");
single_value->field_a5__2.log();
TTCN_Logger::log_event_str(", a5_3 := ");
single_value->field_a5__3.log();
TTCN_Logger::log_event_str(", cmsp := ");
single_value->field_cmsp.log();
TTCN_Logger::log_event_str(", solsa := ");
single_value->field_solsa.log();
TTCN_Logger::log_event_str(", ucs2 := ");
single_value->field_ucs2.log();
TTCN_Logger::log_event_str(", lcsva_cap := ");
single_value->field_lcsva__cap.log();
TTCN_Logger::log_event_str(", spare5_7 := ");
single_value->field_spare5__7.log();
TTCN_Logger::log_event_str(", cm3 := ");
single_value->field_cm3.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 ClassmarkInformationType2__forUMTS_template::log_match(const ClassmarkInformationType2__forUMTS& 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_rf__PowerCapability.match(match_value.rf__PowerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".rf_PowerCapability");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a5__1.match(match_value.a5__1(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_1");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_esind.match(match_value.esind(), legacy)){
TTCN_Logger::log_logmatch_info(".esind");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_revisionLevel.match(match_value.revisionLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".revisionLevel");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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_fc.match(match_value.fc(), legacy)){
TTCN_Logger::log_logmatch_info(".fc");
single_value->field_fc.log_match(match_value.fc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vgcs.match(match_value.vgcs(), legacy)){
TTCN_Logger::log_logmatch_info(".vgcs");
single_value->field_vgcs.log_match(match_value.vgcs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vbs.match(match_value.vbs(), legacy)){
TTCN_Logger::log_logmatch_info(".vbs");
single_value->field_vbs.log_match(match_value.vbs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sm__Capability.match(match_value.sm__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".sm_Capability");
single_value->field_sm__Capability.log_match(match_value.sm__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ss__ScreenIndicator.match(match_value.ss__ScreenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_ScreenIndicator");
single_value->field_ss__ScreenIndicator.log_match(match_value.ss__ScreenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ps__Capability.match(match_value.ps__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".ps_Capability");
single_value->field_ps__Capability.log_match(match_value.ps__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare2__1.match(match_value.spare2__1(), legacy)){
TTCN_Logger::log_logmatch_info(".spare2_1");
single_value->field_spare2__1.log_match(match_value.spare2__1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a5__2.match(match_value.a5__2(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_2");
single_value->field_a5__2.log_match(match_value.a5__2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a5__3.match(match_value.a5__3(), legacy)){
TTCN_Logger::log_logmatch_info(".a5_3");
single_value->field_a5__3.log_match(match_value.a5__3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cmsp.match(match_value.cmsp(), legacy)){
TTCN_Logger::log_logmatch_info(".cmsp");
single_value->field_cmsp.log_match(match_value.cmsp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_solsa.match(match_value.solsa(), legacy)){
TTCN_Logger::log_logmatch_info(".solsa");
single_value->field_solsa.log_match(match_value.solsa(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ucs2.match(match_value.ucs2(), legacy)){
TTCN_Logger::log_logmatch_info(".ucs2");
single_value->field_ucs2.log_match(match_value.ucs2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lcsva__cap.match(match_value.lcsva__cap(), legacy)){
TTCN_Logger::log_logmatch_info(".lcsva_cap");
single_value->field_lcsva__cap.log_match(match_value.lcsva__cap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare5__7.match(match_value.spare5__7(), legacy)){
TTCN_Logger::log_logmatch_info(".spare5_7");
single_value->field_spare5__7.log_match(match_value.spare5__7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cm3.match(match_value.cm3(), legacy)){
TTCN_Logger::log_logmatch_info(".cm3");
single_value->field_cm3.log_match(match_value.cm3(), 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(", rf_PowerCapability := ");
single_value->field_rf__PowerCapability.log_match(match_value.rf__PowerCapability(), legacy);
TTCN_Logger::log_event_str(", a5_1 := ");
single_value->field_a5__1.log_match(match_value.a5__1(), legacy);
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::log_event_str(", revisionLevel := ");
single_value->field_revisionLevel.log_match(match_value.revisionLevel(), 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(", fc := ");
single_value->field_fc.log_match(match_value.fc(), legacy);
TTCN_Logger::log_event_str(", vgcs := ");
single_value->field_vgcs.log_match(match_value.vgcs(), legacy);
TTCN_Logger::log_event_str(", vbs := ");
single_value->field_vbs.log_match(match_value.vbs(), legacy);
TTCN_Logger::log_event_str(", sm_Capability := ");
single_value->field_sm__Capability.log_match(match_value.sm__Capability(), legacy);
TTCN_Logger::log_event_str(", ss_ScreenIndicator := ");
single_value->field_ss__ScreenIndicator.log_match(match_value.ss__ScreenIndicator(), legacy);
TTCN_Logger::log_event_str(", ps_Capability := ");
single_value->field_ps__Capability.log_match(match_value.ps__Capability(), legacy);
TTCN_Logger::log_event_str(", spare2_1 := ");
single_value->field_spare2__1.log_match(match_value.spare2__1(), legacy);
TTCN_Logger::log_event_str(", a5_2 := ");
single_value->field_a5__2.log_match(match_value.a5__2(), legacy);
TTCN_Logger::log_event_str(", a5_3 := ");
single_value->field_a5__3.log_match(match_value.a5__3(), legacy);
TTCN_Logger::log_event_str(", cmsp := ");
single_value->field_cmsp.log_match(match_value.cmsp(), legacy);
TTCN_Logger::log_event_str(", solsa := ");
single_value->field_solsa.log_match(match_value.solsa(), legacy);
TTCN_Logger::log_event_str(", ucs2 := ");
single_value->field_ucs2.log_match(match_value.ucs2(), legacy);
TTCN_Logger::log_event_str(", lcsva_cap := ");
single_value->field_lcsva__cap.log_match(match_value.lcsva__cap(), legacy);
TTCN_Logger::log_event_str(", spare5_7 := ");
single_value->field_spare5__7.log_match(match_value.spare5__7(), legacy);
TTCN_Logger::log_event_str(", cm3 := ");
single_value->field_cm3.log_match(match_value.cm3(), 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 ClassmarkInformationType2__forUMTS_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 (rf__PowerCapability().is_bound()) rf__PowerCapability().set_implicit_omit();
if (a5__1().is_bound()) a5__1().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (revisionLevel().is_bound()) revisionLevel().set_implicit_omit();
if (spare1__1().is_bound()) spare1__1().set_implicit_omit();
if (fc().is_bound()) fc().set_implicit_omit();
if (vgcs().is_bound()) vgcs().set_implicit_omit();
if (vbs().is_bound()) vbs().set_implicit_omit();
if (sm__Capability().is_bound()) sm__Capability().set_implicit_omit();
if (ss__ScreenIndicator().is_bound()) ss__ScreenIndicator().set_implicit_omit();
if (ps__Capability().is_bound()) ps__Capability().set_implicit_omit();
if (spare2__1().is_bound()) spare2__1().set_implicit_omit();
if (a5__2().is_bound()) a5__2().set_implicit_omit();
if (a5__3().is_bound()) a5__3().set_implicit_omit();
if (cmsp().is_bound()) cmsp().set_implicit_omit();
if (solsa().is_bound()) solsa().set_implicit_omit();
if (ucs2().is_bound()) ucs2().set_implicit_omit();
if (lcsva__cap().is_bound()) lcsva__cap().set_implicit_omit();
if (spare5__7().is_bound()) spare5__7().set_implicit_omit();
if (cm3().is_bound()) cm3().set_implicit_omit();
}

void ClassmarkInformationType2__forUMTS_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_rf__PowerCapability.encode_text(text_buf);
single_value->field_a5__1.encode_text(text_buf);
single_value->field_esind.encode_text(text_buf);
single_value->field_revisionLevel.encode_text(text_buf);
single_value->field_spare1__1.encode_text(text_buf);
single_value->field_fc.encode_text(text_buf);
single_value->field_vgcs.encode_text(text_buf);
single_value->field_vbs.encode_text(text_buf);
single_value->field_sm__Capability.encode_text(text_buf);
single_value->field_ss__ScreenIndicator.encode_text(text_buf);
single_value->field_ps__Capability.encode_text(text_buf);
single_value->field_spare2__1.encode_text(text_buf);
single_value->field_a5__2.encode_text(text_buf);
single_value->field_a5__3.encode_text(text_buf);
single_value->field_cmsp.encode_text(text_buf);
single_value->field_solsa.encode_text(text_buf);
single_value->field_ucs2.encode_text(text_buf);
single_value->field_lcsva__cap.encode_text(text_buf);
single_value->field_spare5__7.encode_text(text_buf);
single_value->field_cm3.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_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
}
}

void ClassmarkInformationType2__forUMTS_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_rf__PowerCapability.decode_text(text_buf);
single_value->field_a5__1.decode_text(text_buf);
single_value->field_esind.decode_text(text_buf);
single_value->field_revisionLevel.decode_text(text_buf);
single_value->field_spare1__1.decode_text(text_buf);
single_value->field_fc.decode_text(text_buf);
single_value->field_vgcs.decode_text(text_buf);
single_value->field_vbs.decode_text(text_buf);
single_value->field_sm__Capability.decode_text(text_buf);
single_value->field_ss__ScreenIndicator.decode_text(text_buf);
single_value->field_ps__Capability.decode_text(text_buf);
single_value->field_spare2__1.decode_text(text_buf);
single_value->field_a5__2.decode_text(text_buf);
single_value->field_a5__3.decode_text(text_buf);
single_value->field_cmsp.decode_text(text_buf);
single_value->field_solsa.decode_text(text_buf);
single_value->field_ucs2.decode_text(text_buf);
single_value->field_lcsva__cap.decode_text(text_buf);
single_value->field_spare5__7.decode_text(text_buf);
single_value->field_cm3.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 ClassmarkInformationType2__forUMTS_template[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_CommonIE_Types.ClassmarkInformationType2_forUMTS.");
}
}

void ClassmarkInformationType2__forUMTS_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: {
    ClassmarkInformationType2__forUMTS_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 (22<param.get_size()) {
      param.error("record template of type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS has 22 fields but 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) rf__PowerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) a5__1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) revisionLevel().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare1__1().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) fc().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) sm__Capability().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) ss__ScreenIndicator().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) ps__Capability().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) spare2__1().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) a5__2().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) a5__3().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) cmsp().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) solsa().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) ucs2().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) lcsva__cap().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) spare5__7().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) cm3().set_param(*param.get_elem(21));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "rf_PowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rf__PowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__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(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "fc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vgcs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vgcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vbs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vbs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sm_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sm__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_ScreenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__ScreenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2__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(), "a5_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5_3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5__3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cmsp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cmsp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "solsa")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          solsa().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ucs2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ucs2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lcsva_cap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lcsva__cap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare5_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare5__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cm3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cm3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ClassmarkInformationType2__forUMTS_template* precondition = new ClassmarkInformationType2__forUMTS_template;
    precondition->set_param(*param.get_elem(0));
    ClassmarkInformationType2__forUMTS_template* implied_template = new ClassmarkInformationType2__forUMTS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ClassmarkInformationType2__forUMTS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
  }
  is_ifpresent = param.get_ifpresent();
}

void ClassmarkInformationType2__forUMTS_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_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_rf__PowerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_a5__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_esind.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_revisionLevel.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_spare1__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_fc.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_vgcs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_vbs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_sm__Capability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_ss__ScreenIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_ps__Capability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_spare2__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_a5__2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_a5__3.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_cmsp.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_solsa.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_ucs2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_lcsva__cap.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_spare5__7.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
single_value->field_cm3.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.ClassmarkInformationType2_forUMTS");
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_CommonIE_Types.ClassmarkInformationType2_forUMTS");
}

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

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

MobileStationClassmark3__TLV::MobileStationClassmark3__TLV()
{
}

MobileStationClassmark3__TLV::MobileStationClassmark3__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_valuePart)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valuePart(par_valuePart)
{
}

MobileStationClassmark3__TLV::MobileStationClassmark3__TLV(const MobileStationClassmark3__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark3_TLV.");
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.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void MobileStationClassmark3__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* MobileStationClassmark3__TLV::get_descriptor() const { return &MobileStationClassmark3__TLV_descr_; }
MobileStationClassmark3__TLV& MobileStationClassmark3__TLV::operator=(const MobileStationClassmark3__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CommonIE_Types.MobileStationClassmark3_TLV.");
  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.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

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

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

void MobileStationClassmark3__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void MobileStationClassmark3__TLV::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_CommonIE_Types.MobileStationClassmark3_TLV 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark3_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV");
  }
}

void MobileStationClassmark3__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_valuePart.encode_text(text_buf);
}

void MobileStationClassmark3__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valuePart.decode_text(text_buf);
}

void MobileStationClassmark3__TLV::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 MobileStationClassmark3__TLV::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 MobileStationClassmark3__TLV::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, MobileStationClassmark3__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MobileStationClassmark3__TLV_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(MobileStationClassmark3__TLV_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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_valuePart.RAW_decode(General__Types::OCTN_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_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 MobileStationClassmark3__TLV::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, MobileStationClassmark3__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCTN_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 = &MobileStationClassmark3__TLV_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_valuePart.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[2]);
  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 MobileStationClassmark3__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valuePart;
};

void MobileStationClassmark3__TLV_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_valuePart = ANY_VALUE;
}
}
}

void MobileStationClassmark3__TLV_template::copy_value(const MobileStationClassmark3__TLV& 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.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MobileStationClassmark3__TLV_template::copy_template(const MobileStationClassmark3__TLV_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.valuePart().get_selection()) {
single_value->field_valuePart = other_value.valuePart();
} else {
single_value->field_valuePart.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 MobileStationClassmark3__TLV_template[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 MobileStationClassmark3__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MobileStationClassmark3__TLV_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_CommonIE_Types.MobileStationClassmark3_TLV.");
break;
}
set_selection(other_value);
}

MobileStationClassmark3__TLV_template::MobileStationClassmark3__TLV_template()
{
}

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

MobileStationClassmark3__TLV_template::MobileStationClassmark3__TLV_template(const MobileStationClassmark3__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MobileStationClassmark3__TLV_template::match(const MobileStationClassmark3__TLV& 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.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), 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_CommonIE_Types.MobileStationClassmark3_TLV.");
}
return FALSE;
}

boolean MobileStationClassmark3__TLV_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_valuePart.is_bound();
}

boolean MobileStationClassmark3__TLV_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_valuePart.is_value();
}

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

MobileStationClassmark3__TLV MobileStationClassmark3__TLV_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_CommonIE_Types.MobileStationClassmark3_TLV.");
MobileStationClassmark3__TLV 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_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

void MobileStationClassmark3__TLV_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_CommonIE_Types.MobileStationClassmark3_TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MobileStationClassmark3__TLV_template[list_length];
}

MobileStationClassmark3__TLV_template& MobileStationClassmark3__TLV_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_CommonIE_Types.MobileStationClassmark3_TLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CommonIE_Types.MobileStationClassmark3_TLV.");
return value_list.list_value[list_index];
}

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

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

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

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

OCTETSTRING_template& MobileStationClassmark3__TLV_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const OCTETSTRING_template& MobileStationClassmark3__TLV_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_CommonIE_Types.MobileStationClassmark3_TLV.");
return single_value->field_valuePart;
}

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

void MobileStationClassmark3__TLV_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(", valuePart := ");
single_value->field_valuePart.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 MobileStationClassmark3__TLV_template::log_match(const MobileStationClassmark3__TLV& 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_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), 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(", valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), 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 MobileStationClassmark3__TLV_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 (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void MobileStationClassmark3__TLV_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_valuePart.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_CommonIE_Types.MobileStationClassmark3_TLV.");
}
}

void MobileStationClassmark3__TLV_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_valuePart.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 MobileStationClassmark3__TLV_template[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_CommonIE_Types.MobileStationClassmark3_TLV.");
}
}

void MobileStationClassmark3__TLV_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: {
    MobileStationClassmark3__TLV_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_CommonIE_Types.MobileStationClassmark3_TLV 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CommonIE_Types.MobileStationClassmark3_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MobileStationClassmark3__TLV_template* precondition = new MobileStationClassmark3__TLV_template;
    precondition->set_param(*param.get_elem(0));
    MobileStationClassmark3__TLV_template* implied_template = new MobileStationClassmark3__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MobileStationClassmark3__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MobileStationClassmark3__TLV_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_CommonIE_Types.MobileStationClassmark3_TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV");
single_value->field_valuePart.check_restriction(t_res, t_name ? t_name : "@MobileL3_CommonIE_Types.MobileStationClassmark3_TLV");
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_CommonIE_Types.MobileStationClassmark3_TLV");
}

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

boolean MobileStationClassmark3__TLV_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 */
